Back to tools

CSP Policy Generator

What is CSP?

Content Security Policy (CSP) is an HTTP header that allows administrators to control which resources can be loaded on a web page. It's one of the best defenses against XSS.

  • default-src: Default policy
  • script-src: Allowed sources for JavaScript
  • style-src: Allowed sources for CSS
  • img-src: Allowed sources for images
  • font-src: Allowed sources for fonts