Security-focused warnings
Flags unsafe-inline, unsafe-eval and wildcard sources that can weaken CSP.
Start typing to search 227 tools.
Build a Content-Security-Policy header with presets, source directives, Report-Only mode, security warnings, and copy-ready HTTP, nginx, Apache and meta-tag output.
CSP Policy Builder generates a deployable Content-Security-Policy for websites and web applications. Configure directives such as default-src, script-src, style-src, img-src, connect-src, frame-src, object-src, base-uri, form-action and frame-ancestors.
Use Content-Security-Policy-Report-Only to observe violations without blocking resources, then move to enforcement after the policy is verified. The builder accepts common CSP keywords, hosts, schemes, nonces and SHA-256/384/512 hash sources and warns about settings that commonly weaken a policy.
Output is available as a normal HTTP header, an nginx add_header directive, an Apache Header always set line, an HTML meta tag where supported, or the raw policy value.
Focused controls, predictable output, and a workflow designed around this exact transformation.
Flags unsafe-inline, unsafe-eval and wildcard sources that can weaken CSP.
Configure the directives most web applications need without manually assembling the header.
Test a policy before it starts blocking production resources.
Copy HTTP, nginx, Apache, meta-tag or raw policy output.
Practical details about input, output, privacy, limits, and the best way to use this tool.
For an existing production site, usually yes. Report-Only lets you collect violations without blocking resources while you tune the policy.
An enforcing CSP can be delivered with a meta element, but not every directive is supported there. Report-Only must be delivered through an HTTP header.
It broadly allows inline script or style execution. Prefer nonces or hashes where practical, especially for script-src.
It acts as a fallback for many fetch directives when a more specific directive such as script-src or img-src is absent.
A nonce is an unpredictable per-response value placed in the policy and on an allowed inline script or style element.
Yes. CSP supports SHA-256, SHA-384 and SHA-512 hash sources using the required quoted syntax.
No. CSP and HTTPS address different risks. A production site should generally use HTTPS and a carefully tested CSP.
No. Use browser developer tools and CSP violation reports to identify the resources your actual application loads.
A restrictive baseline for sites that serve their own scripts and styles.
default-src 'self'; object-src 'none'; base-uri 'self'
Content-Security-Policy header
Observe violations before switching the same policy to enforcement.
Policy mode: Report-Only
Content-Security-Policy-Report-Only header
A restrictive policy deployed without testing can break scripts, fonts, images, API calls or embedded content. For established sites, start with Content-Security-Policy-Report-Only, observe violations, adjust required sources and then switch to enforcement.
default-src provides a fallback. script-src and style-src control executable scripts and styles. connect-src affects fetch, XHR and WebSocket connections. frame-ancestors controls which pages may embed your site, while object-src none is a common hardening choice.
Nonces and hashes can authorize specific inline resources without broadly enabling unsafe-inline. Nonces must be unpredictable and regenerated for every HTTP response. Hashes must match the exact inline content.
Choose the deployment format that matches your environment. HTTP headers are the most complete delivery method. A meta CSP can be useful when server headers cannot be configured, but it has limitations and cannot deliver Report-Only.
Build other response headers with HTTP Header Builder, inspect TLS with SSL Certificate Checker, or calculate script hashes with SHA-256 Generator.
Review the current MDN Content Security Policy documentation before deploying a production policy.