Tool Hub

CSP जनरेटर

प्रति-डोमेन नियमों से Content Security Policy हेडर बनाएँ

DirectiveSources
default-src
script-src
style-src
img-src
connect-src
font-src
frame-src
media-src
Content-Security-Policy हेडर
default-src 'self'; script-src 'self'; style-src 'self'; img-src 'self' data:; connect-src 'self'; font-src 'self'; frame-src 'none'; media-src 'self'

एक सामान्य स्रोत टोकन जोड़ने के लिए प्रत्येक निर्देश के नीचे चिप्स पर क्लिक करें।

कैसे उपयोग करें

  1. Review the directives table and type or paste sources into each directive row (script-src, style-src, img-src, etc.).
  2. अपलोड और चुनें
  3. Toggle between Minified and Pretty output views to suit your use case.
  4. Copy the generated Content-Security-Policy header value and paste it into your server configuration or meta tag.

उदाहरण

  • Adding 'self' and https://cdn.example.com to script-src produces script-src 'self' https://cdn.example.com in the header output.
  • Leaving all directives empty and adding only default-src 'none' produces a strict deny-all baseline policy.

उत्पादन में उपयोग से पहले आउटपुट सत्यापित करें। कोई वारंटी नहीं — देखें शर्तें.