CSP Builder & Linter
Compose and audit a Content-Security-Policy interactively — catch unsafe-inline, wildcards, and missing directives, and export the header plus a report-only version.
Proposed stack
- Next.js
- TypeScript
- Tailwind CSS
Goal
Make writing a safe Content-Security-Policy approachable instead of error-prone.
Overview
Build a CSP by adding directives and source tokens, with real-time linting that warns on unsafe-inline, unsafe-eval, wildcards, and missing default-src/frame-ancestors.
Paste an existing policy to parse and lint it, see a plain-English explanation of what it allows, and export the final header plus a report-only version.
Includes presets for common setups.
Architecture
Build / Paste CSP → Lint → Explain → Export Header
Key features
- Interactive directive + source builder.
- Real-time linting of unsafe/weak policies.
- Parse and lint a pasted CSP.
- Plain-English explanation of the policy.
- Export header + report-only version.
Technical challenges
- Covering CSP directive semantics and their interactions.
- Linting unsafe patterns without too many false alarms.
- Explaining a policy in plain language accurately.
How it's built
- 1Next.js + TypeScript + Tailwind with a CSP parser + linter.
- 2Two-way build/parse and report-only export.
- 3Presets for common app setups.
Interested in this work?
Happy to talk through the design, trade-offs, and implementation plan.