Interview practice question
Rolling out a strict Content Security Policy
Frontend Engineering · Async JavaScript and the Browser · Experienced
Security wants a strict Content Security Policy, but your app uses inline scripts and many third-party tags. How do you roll it out without breaking the site?
What a strong answer covers
Your AI report card counts how many of these ideas you cover.
- Start with report-only mode, collect violations.
- Remove inline scripts/handlers; use nonces/hashes.
- Inventory third parties; allow needed origins or strict-dynamic.
- Fix eval usage.
- Enforce gradually.
Practise this topic
Start without signing up. Sign in free to get an AI report card on your answer.