SEO-tools

CSP Starter Policy Generator

Genereer een Content-Security-Policy header voor statische sites met CDN-, analytics-, lettertype- en embedopties.

Tool laden...

Wat is CSP Starter Policy Generator?

CSP Starter Policy Generator is een browsertool voor deze taak: Genereer een Content-Security-Policy header voor statische sites met CDN-, analytics-, lettertype- en embedopties. De uitvoer blijft leesbaar, zodat je die kunt controleren voordat je hem publiceert.

Quick answer

A Content Security Policy blocks cross-site scripting and data injection attacks by restricting which resources the browser can load. Start with a restrictive policy and widen only when needed.

Limitations

  • CSP does not protect against server-side vulnerabilities or compromised third-party libraries already included in the policy.
  • Inline event handlers and javascript: URLs are blocked unless 'unsafe-inline' or a hash/nonce is set.
  • GitHub Pages does not support custom HTTP headers; use a meta tag-based CSP instead, which has limited directive support compared to the HTTP header.

Zo gebruik je deze tool

  1. Open de tool en vul de relevante waarden in.
  2. Controleer de uitvoer in het resultaatpaneel.
  3. Kopieer alleen het deel dat bij je página past.
  4. Test de wijziging voordat je publiceert.

Waarvoor je het kunt gebruiken

  • Terugkerend publicatiewerk sneller afronden.
  • Markup, CSS of checklists voorbereiden voor een launch.
  • Kleine fouten vermijden die bij statische sites makkelijk worden gemist.

Veelgemaakte fouten

  • Uitvoer kopieren zonder controle.
  • Lokale URL's gebruiken in plaats van publieke URL's.
  • Na de build niet controleren of het bestand in de publicatiemap staat.

Verification

  1. Deploy the CSP in report-only mode first by using Content-Security-Policy-Report-Only and check the browser console for violation reports.
  2. Switch to the enforce header only after confirming no legitimate resources are being blocked.

Comparison

CSP vs Permissions-Policy vs Referrer-Policy

AspectContent-Security-PolicyPermissions-PolicyReferrer-Policy
What it controlsWhich resources (scripts, styles, images, fonts) the page can load and from which originsWhich browser features (camera, microphone, geolocation, payment) the page can accessHow much referrer information is sent when the page navigates to or loads a resource from another origin
Example directivesdefault-src 'self'; script-src 'self' cdn.example.com; img-src *camera=(), geolocation=(self), fullscreen=*strict-origin-when-cross-origin, no-referrer, same-origin
Delivered as header or metaBoth. HTTP header is preferred. Meta tag works but does not support frame-ancestors or report-uri.HTTP header only. Meta tag is not supported for Permissions-Policy.Both. Meta tag works and is commonly used for static pages.
What happens if misconfiguredResources are blocked. The page may appear broken with missing styles, scripts, or images.Features silently fail. JavaScript calls to blocked APIs throw without visible browser UI.Referrer data is sent with unintended detail or is missing when analytics need it.

CSP controls resource loading, Permissions-Policy controls feature access, and Referrer-Policy controls referrer data sent to other origins. They are complementary security headers that serve different purposes.

FAQ

Vragen over CSP Starter Policy Generator

Draait CSP Starter Policy Generator lokaal in de browser?

Ja. De huidige tools zijn ontworpen voor browseruitvoer en kopieerbare resultaten.

Moet ik de uitvoer testen?

Ja. Controleer altijd je template, browser en hostingconfiguratie.

Gerelateerde tools

Meer seo-tools

Probeer ook

Probeer ook