Build a Content-Security-Policy that is worth deploying — starting in report-only.
Report-only policy generated
The nonce placeholder has to be replaced with a fresh random value on every response and repeated on each script tag — a static nonce is no better than allowing inline script, since an attacker can read it from the page. Report-only is the right way to start: the policy is evaluated and violations reported without anything being blocked, so you find out what the site actually loads before breaking it. Run it for a fortnight, read the reports, then switch the header name.
Content-Security-Policy-Report-Only: default-src 'self'; script-src 'self' 'nonce-{RANDOM}' 'strict-dynamic'; style-src 'self'; img-src 'self' data:; object-src 'none'; base-uri 'self'; frame-ancestors 'none'; form-action 'self'; upgrade-insecure-requestsWhat this cannot tell you
Take this with you
CSP Generator on RunTheTests — free browser-based websec tools, no sign-up.