Skip to content

Content Security Policy checks

Testomato supports two check types for monitoring your Content-Security-Policy response header.

  1. Content-Security-Policy checks the full header value as a string. Use it to verify the header is present, hasn't changed, or matches an expected pattern.

  2. CSP: <directive> extracts a single directive from the policy and checks its value independently. CSP: script-src gives you just the script-src value — useful for asserting that unsafe-inline is absent without caring about the rest of the policy.

Supported directives: default-src, script-src, style-src, img-src, font-src, connect-src, frame-src, frame-ancestors, form-action, base-uri, object-src, media-src, worker-src, manifest-src, upgrade-insecure-requests.

Both check types support the same operators.

Three things Testomato's CSP checks do not do:

  1. Content-Security-Policy-Report-Only is not checked. If a site only has the report-only header, the Content-Security-Policy check fails with "Missing" as if no policy exists.
  2. No policy analysis. Testomato checks string presence or patterns — it does not evaluate whether a policy is actually effective. Use CSP Evaluator for that.
  3. No violation reporting. These checks monitor the header value, not what the browser blocks or reports. They complement a violation reporting service like Report URI, not replace it.

Good for sites with an existing CSP that haven't been monitoring it yet:

Check What it catches
Content-Security-Policy matches .* Header is present at all
CSP: script-src does not contain unsafe-inline Inline script execution is blocked
CSP: frame-ancestors matches .* Clickjacking protection is in place

Add these once you're confident in your baseline:

Check What it catches
CSP: object-src equals 'none' No legacy plugin content (<object>, <embed>)
CSP: base-uri equals 'self' Base tag injection is blocked
CSP: upgrade-insecure-requests matches .* Mixed content is upgraded automatically