Content Security Policy Checklist
Create a practical Content Security Policy (CSP) checklist tailored to your website. Select your site type and identify whether you use inline scripts, eval(), CDNs, or analytics to review relevant CSP configuration and security considerations.
Build a CSP checklist
An API that only returns data loads no scripts or assets, so these options don't apply.
Generated checklist
Recommended CSP header
Checklist
Warnings
What Is a Content Security Policy?
Content Security Policy (CSP) is a browser security mechanism that helps protect websites against cross-site scripting (XSS) and other content-injection attacks. It works through HTTP response headers or a CSP meta element to control which sources can load scripts, styles, images, and other resources.
How to Use the Content Security Policy Checklist
Select your site type: Choose Static Site or the option that best describes your website.
Review your website features: Select whether your site uses inline scripts, eval() or unsafe JavaScript, external CDNs, and analytics services.
Generate Checklist: Click the button to create a checklist based on your selections.
Review the recommendations: Use the results to identify CSP configuration tasks relevant to your website.
Content Security Policy Header Example
A basic CSP header might look like this:
default-src 'self';
script-src 'self';
style-src 'self' 'unsafe-inline';
img-src 'self' data:;
object-src 'none';
base-uri 'self';
frame-ancestors 'none'
This example restricts resources to the site's own origin by default, limits scripts to the same origin, blocks plugin content, and restricts the URLs that can be used as a document base. Test policies carefully before enforcing them on a live website, as they may block resources your site needs.
How to Check for a Content Security Policy Header
Open your website in a browser.
Open Developer Tools and select the Network tab.
Reload the page and select the main document request.
Check Response Headers for Content-Security-Policy or Content-Security-Policy-Report-Only.
Review the browser console for CSP violations and blocked resources.
You can also inspect the response headers using command-line tools such as curl. A policy delivered through a meta element may not appear in the HTTP response headers, so check the page source as well.