Share
Build Content Security Policy headers visually with live preview and presets.
Build Content Security Policy (CSP) headers visually. Select directives, add source allowlists, toggle common source keywords like 'self', 'none', and 'unsafe-inline', and get a ready-to-use CSP header string plus an HTML meta tag. Includes Strict, Moderate, and Permissive presets. Helps protect your web app against XSS and data injection attacks.
Create a secure Content Security Policy header to protect your website from XSS and data injection attacks.
Select a security policy preset
Choose from Strict, Moderate, or Permissive presets to automatically populate the builder with recommended security baselines.
Configure individual CSP directives
Navigate through directives like script-src or style-src to define specific security rules for your web application.
Add source allowlists and keywords
Toggle common source keywords such as 'self' or 'unsafe-inline' and manually input trusted domains into the allowlist.
Preview the generated CSP string
Review the live preview of your Content Security Policy header and HTML meta tag to ensure all directives are correct.
Copy and implement the header
Copy the ready-to-use header string or meta tag and paste it into your server configuration or HTML head section.
Estimated time: PT2M
Share this tool
Presets
Directives
upgrade-insecure-requestsblock-all-mixed-content