Courses / Frontend Security & Observability
10. Content Security Policy (CSP)
Configuring CSP headers/metadata to restrict sources of scripts, styles, and other resources.
JavaScript
Content Security Policy (CSP)
A browser header and meta rule set that tells the browser which external sources and behaviors are allowed on a page.
"I want to stop unknown scripts and styles from running on my site without breaking the good ones."
CSP is a security mechanism delivered via HTTP headers or a meta tag that restricts where the page can load scripts, styles, images, frames, and other resources — reducing XSS and data injection risks.
"I want to stop unknown scripts and styles from running on my site without breaking the good ones."
CSP is a security mechanism delivered via HTTP headers or a meta tag that restricts where the page can load scripts, styles, images, frames, and other resources — reducing XSS and data injection risks.