What is CSP Policy Generator
This tool helps you build Content Security Policy (CSP) rules visually, balancing security hardening and practical resource loading.
Key Features
- Start from strict, balanced, or development presets.
- Configure directives with selectable sources and custom entries.
- Generate Meta tag, HTTP header, and Nuxt config output.
- Preview directive status in real time and copy instantly.
Steps
- Pick a preset as the baseline.
- Tune directives like
script-srcandstyle-src. - Copy the output format you need.
- Validate on real pages before production rollout.
FAQ
Why do some resources fail after enabling CSP?
Most often, required domains are missing in related directives, such as script hosts not listed in script-src.
Should I use Meta tag or HTTP header first?
For production, prefer HTTP response headers for broader and more reliable policy enforcement.