Skip to main content

ShieldAI Zen Firewall — In-app runtime protection for Python (FastAPI, Django, Flask, Starlette). Blocks SQLi, XSS, path traversal, command injection, SSRF.

Project description

shieldai-zen

In-app runtime protection for Python web applications.

Block SQL injection, XSS, path traversal, command injection, and SSRF with less than 1ms overhead. Supports FastAPI, Django, Flask, and any ASGI/WSGI framework.

PyPI version License: MIT


Quick Start

pip install shieldai-zen

FastAPI / Starlette

from fastapi import FastAPI
from shieldai_zen import ZenFirewallMiddleware

app = FastAPI()
app.add_middleware(ZenFirewallMiddleware, token="zen_your_token")

Django

# settings.py
MIDDLEWARE = [
    'shieldai_zen.DjangoZenMiddleware',
    # ... your other middleware
]
SHIELD_ZEN_TOKEN = 'zen_your_token'
SHIELD_ZEN_MODE = 'block'   # or 'monitor'

Flask

from flask import Flask
from shieldai_zen import FlaskZen

app = Flask(__name__)
FlaskZen(app, token="zen_your_token")

What It Blocks

Attack Example Action
SQL Injection ' OR 1=1-- 🛑 Blocked
XSS <script>alert(1)</script> 🛑 Blocked
Path Traversal ../../etc/passwd 🛑 Blocked
Command Injection ; bash -i >& /dev/tcp/... 🛑 Blocked
SSRF http://169.254.169.254/... 🛑 Blocked

Configuration

app.add_middleware(ZenFirewallMiddleware,
    token="zen_your_token",      # from ShieldAI dashboard
    mode="block",                # "block" (default) | "monitor" (log only)
    threshold=60,                # risk score to block (0-100)
    app_name="my-api",           # shown in ShieldAI dashboard
)

Environment Variables

SHIELD_ZEN_TOKEN=zen_xxxxxxxxxxxx
SHIELD_APP_NAME=my-api

Get Your Token

  1. Go to shieldai.dev
  2. Navigate to Protect → Zen Firewall → Add Protected App
  3. Select Python and copy your token

License

MIT © ShieldAI Security

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shieldai_zen-1.0.0.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

shieldai_zen-1.0.0-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file shieldai_zen-1.0.0.tar.gz.

File metadata

  • Download URL: shieldai_zen-1.0.0.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for shieldai_zen-1.0.0.tar.gz
Algorithm Hash digest
SHA256 fe09caea2d77c2da7554b7b14147ae326d6d8891cdb51700bbab987b14717106
MD5 38d83488c8a4d4fbacbce14c21d285d4
BLAKE2b-256 320f3bb506db5257f5d25bc1ec603a68cad606d4adc72813a43f97ca5685d039

See more details on using hashes here.

File details

Details for the file shieldai_zen-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: shieldai_zen-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for shieldai_zen-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 91c4cb9b086d0e38dff197b86d5567095c6531e776e36eadf78e308bad1d18b5
MD5 9b4d4d70afb70a66a83d5bd78ff95e15
BLAKE2b-256 6ee4c9b26415f1c036bde4a955c7c83e9d6ccd96f35c812a676a036927b69bb0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page