Content Security Policy Rollout Checklist Builder
Plan a low-risk Content Security Policy rollout with report-only testing, directive design, third-party inventory, violation triage, and deployment guardrails.
Prompt Template
You are a senior web application security engineer. Build a Content Security Policy rollout checklist for: Application type: [marketing site, SaaS app, ecommerce, dashboard, docs, embedded widget, multi-tenant app] Frontend stack: [Next.js, React, Vue, Rails, Laravel, static site, CMS] Current third-party scripts: [analytics, ads, tag manager, chat, payments, maps, A/B testing, error tracking] Asset sources: [CDN, image host, font provider, video embeds, API domains, worker scripts] Inline script/style usage: [none, legacy inline code, framework hydration, nonce support, hashes possible] Security goals: [reduce XSS risk, pass audit, meet enterprise requirements, harden checkout] Deployment path: [edge headers, app middleware, CDN config, nginx, platform settings] Reporting tools: [report-uri endpoint, SIEM, log drain, CSP monitor, none yet] Constraints: [legacy plugins, tag manager ownership, partner embeds, localization, strict uptime] Create: 1. Third-party and asset source inventory template 2. Baseline policy recommendation with directives and rationale 3. Report-Only rollout plan with stages, sample headers, and success criteria 4. Violation triage workflow separating real risk from browser noise 5. Nonce/hash strategy for inline scripts and framework requirements 6. Testing checklist for checkout, auth, embedded content, admin, and critical flows 7. Production rollout and rollback plan 8. Monitoring dashboard and alert thresholds 9. Stakeholder checklist for marketing, analytics, security, and engineering owners Prioritize practical rollout safety over an instantly perfect strict policy.
Example Output
# CSP Rollout - B2B SaaS Dashboard
Starting Policy
Use Report-Only first with default-src 'self'; script-src 'self' 'nonce-[generated]' https://www.googletagmanager.com https://js.stripe.com; connect-src 'self' https://api.stripe.com https://*.sentry.io; img-src 'self' data: https:; frame-src https://js.stripe.com.
Rollout Stages
1. Inventory scripts from production pages and tag manager.
2. Run Report-Only for two weeks across login, billing, admin, and dashboard routes.
3. Triage violations by source, route, and user impact.
4. Enforce on low-risk routes first, then billing and admin after clean tests.
Guardrail
Rollback is a single CDN header change, owned by platform engineering, with security notified after incident resolution.
Tips for Best Results
- 💡Start with Report-Only and real production traffic; local testing will miss third-party paths.
- 💡List tag-manager ownership because marketing scripts often decide whether CSP sticks.
- 💡Ask for critical flows so checkout, auth, and embedded widgets get explicit testing.
Related Prompts
WebAuthn Passkey Implementation Checklist Builder
Design a WebAuthn passkey rollout with registration flows, account recovery, device coverage, security controls, browser support, and QA test cases.
Code Review Assistant
Get a thorough, senior-level code review with actionable feedback on quality, security, performance, and best practices.
Debugging Detective
Systematically debug errors and unexpected behavior with root cause analysis and fix suggestions.