Package: gemini_self_protector
gemini_self_protectorGemini - The Runtime Application Self Protection (RASP) Solution Combined With Deep LearningInstallation$ pip install gemini_self_protectorProtect Mode & SensitiveGemini supports 3 modes and recommends sensitivity levels for the application to operate at its best state.ModeSensitiveoffN/Amonitor70block50License KeyThe license key is used for authentication with the API.Key:988907ce-9803-11ed-a8fc-0242ac120002Init Gemini self-protectorCLI Modefrom flask import Flask, request
from gemini_self_protector import GeminiManager

app = Flask(__name__)
gemini = GeminiManager()GUI Modefrom flask import Flask, request
from gemini_self_protector import GeminiManager

app = Flask(__name__)
gemini = GeminiManager(app)Basic UsageWith the basic usage, Gemini runs in the default mode of "monitoring" and allows a sensitivity level of under 50, above which requests will be stored for monitoring purposes.from flask import Flask, request, jsonify
from gemini_self_protector import GeminiManager

app = Flask(__name__)
gemini = GeminiManager(app)

@app.route('/api/login', methods=['POST'])
@gemini.flask_protect_extended() <--- Declare gemini below flask route and without option
def login():
    username = request.json['username']
    password = request.json['password']
    if username == "test" and password == "test":
        response = jsonify({
            "status": "Success",
            "message": "Login successful",
            "access_token": access_token
            })
        return response
    else:
        return jsonify({
            "status": "Fail",
            "message": "Incorrect Username or Password"
            }), 401

if __name__ == "__main__":
    app.run()Advance UsageThe advanced usage of Gemini allows for deeper customization. Specifically, it is possible to specify individual modes for each router and have a dashboard to monitor the activity of the application. The running mode and sensitivity can be adjusted directly on the dashboard, and additional features are currently being developed.from flask import Flask
from flask import jsonify
from flask import request

from gemini_self_protector import GeminiManager

app = Flask(__name__)
gemini = GeminiManager(app)

@app.route('/api/login', methods=['POST'])
@gemini.flask_protect_extended(protect_mode='block') <--- Declare gemini below flask route with protect mode option
def login():
    username = request.json['username']
    password = request.json['password']
    if username == "test" and password == "test":
        response = jsonify({
            "status": "Success",
            "message": "Login successful",
            "access_token": access_token
            })
        return response
    else:
        return jsonify({
            "status": "Fail",
            "message": "Incorrect Username or Password"
            }), 401

if __name__ == "__main__":
    app.run()Gemini Protect AgainstAttacksSupportedMalformed Content TypesHTTP Method Tampering:white_check_mark:Large Requests:white_check_mark:Path TraversalUnvalidated Redirects:white_check_mark:InjectionsSupportedCommand Injection:white_check_mark:Cross-Site Scripting:white_check_mark:Cross-Site Request ForgeryCSS & HTML InjectionJSON & XML InjectionSQL Injection:white_check_mark:WeaknessesSupportedInsecure Cookies & TransportWeak Browser Caching:white_check_mark:Vulnerable Dependencies:white_check_mark:Weak CryptographyHTTP Response Headers:white_check_mark:API Rate Limit:white_check_mark:Gemini Security Response HeadersHTTP Response HeadersDefault configurationX-Frame-OptionsSAMEORIGINX-XSS-Protection1; mode=blockX-Content-Type-OptionsnosniffReferrer-Policyno-referrer-when-downgradeContent-TypeN/AStrict-Transport-Securitymax-age=31536000; includeSubDomains; preloadExpect-CTenforce; max-age=31536000Content-Security-PolicyN/AX-Permitted-Cross-Domain-PoliciesnoneFeature-Policyfullscreen 'self'Cache-Controlno-cache, no-store, must-revalidatePragmano-cacheExpires0X-UA-CompatibleIE=Edge,chrome=1Access-Control-Allow-Origin*Access-Control-Allow-Methods*Access-Control-Allow-Headers*Access-Control-Allow-CredentialstrueCross-Origin-Opener-PolicyN/ACross-Origin-Embedder-PolicyN/ACross-Origin-Resource-PolicyN/APermissions-PolicyN/AFLoCN/AServergeminiX-Powered-ByN/AX-AspNet-VersionN/AX-AspNetMvc-VersionN/AX-DNS-Prefetch-ControlN/AContributingInterested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.Licensegemini_self_protectorwas created by lethanhphuc. It is licensed under the terms of the MIT license.Creditsgemini_self_protectorwas created withcookiecutterand thepy-pkgs-cookiecuttertemplate.