$4.99
Build a strict Content Security Policy from a declarative config file. Handles nonce generation, hash-based source allowlisting, and report-uri setup. Ships with ready-to-use middleware for Flask, FastAPI, and bare WSGI.
# Generate a CSP header from config
python csp.py build --config csp.yaml
# Validate an existing CSP header
python csp.py validate --header "default-src 'self'; script-src 'nonce-abc123'"
# Flask middleware usage
from csp_builder import CSPMiddleware
app.wsgi_app = CSPMiddleware(app.wsgi_app, config='csp.yaml')