CSP Builder

Diagnose security headers and policies in your browser. No input is sent to a server. Use it for first-pass checks before rollout.

Status

Runs in your browser. No input is sent to a server. Use this as a first-pass diagnostic step.

How to use

Select a template, add required domains, then click Build. Verify the generated policy with audit tools before deployment.

Notes (this tool)

  • This output is a starter policy. Adjust it to real script/style/img/connect sources.
  • Use Report-Only first, review violation logs, then enforce for safer rollout.

About this page

What does this tool do?

Provides templates to quickly build CSPs for common setups.

Debugging workflow (recommended)

  • Pick a template
  • Add required domains
  • Validate with CSP Inspect

Recommendations (practical)

  • Start by tightening default-src and script-src
  • Roll out with report-only first
  • Minimize unsafe-inline/unsafe-eval
  • CSP Inspect
  • Security Headers Audit

What this tool does

  • Generate CSP templates
  • Add allowed domains

Operational notes

  • Recommended values are environment-dependent. Validate against functional requirements before applying.
  • In production, use phased rollout with report monitoring.

Referenced specs

  • MDN: CSP

FAQ

Should CSP be strict from day one?

A practical path is starting with Report-Only, observing violations, then tightening gradually.

Is keeping unsafe-inline problematic?

It widens attack surface, so migration to nonce/hash with minimal usage is recommended.

References

  1. MDN: CSP

Page-specific case studies

This page helps design initial CSP with nonce/hash strategy and least-privilege directives.

  • Minimize allowed sources for script-src and style-src.
  • Choose a nonce-based or hash-based policy model.
  • Plan early reduction of unsafe-inline usage.

Page-specific implementation checklist

  • Collect violation logs in Report-Only mode before enforcement.
  • Centralize nonce injection in your template layer.
  • Inventory third-party resource origins.
  • Run regression tests on key pages after CSP changes.

These links are generated from site_map rules in recommended diagnostic order.

  1. CSP Inspect — Parse and evaluate CSP directives
  2. CSP Nonce/Hash Helper — Generate and verify CSP nonce/hash values
  3. CSP Report Analyzer — Analyze CSP report JSON and summarize violation patterns
  4. Security Headers Fix Plan — Create a prioritized header-fix plan
  5. Security Headers Audit — Audit presence of major security headers
  6. Security Headers Recommendation — Suggest recommended values for missing headers
  7. HSTS Inspect — Parse HSTS to verify HTTPS enforcement
  8. Permissions-Policy Inspect — Parse Permissions-Policy and review feature restrictions

Security Headers

Go from missing-header detection to concrete fix planning