A simple Flask-based web application to evaluate Content Security Policy (CSP) headers for common security issues. It highlights missing directives, dangerous values, overly permissive configurations, and provides suggestions for modern security enhancements.
Hosted Example: https://csp-evaluator.onrender.com
- Detects missing critical CSP directives
- Flags dangerous values like
unsafe-inline,eval(),data:, wildcards, andhttp: - Warns on overly permissive policies (e.g.,
*, missing'self') - Suggests modern directives (e.g.,
upgrade-insecure-requests,trusted-types) - Detects redundant directives
- Displays CSP syntax errors (e.g., use of
:instead of space) - Generates a clean, readable HTML report via web interface
- Python 3.7+
- Flask
pip install -r requirements.txtpython CSP_evulator.pyVisit http://localhost:5000 in your browser.
Flask==2.3.3
services:
- type: web
name: csp-evaluator
env: python
buildCommand: ""
startCommand: "python CSP_evulator.py"git init
git add .
git commit -m "Initial CSP Evaluator"
git remote add origin https://github.com/yourname/csp-evaluator.git
git push -u origin main- Go to https://render.com
- Create a new Web Service
- Link your GitHub repo
- Set Python as runtime
- Set start command:
python CSP_evulator.py
MIT License. Use freely, contribute if you’d like!