Deploying Content Security Policy without guesswork
A useful Content Security Policy describes intended resource trust. A generated list of every origin observed in production usually preserves the existing exposure rather than reducing it.
Start with executable content
Inventory scripts, frames, workers and object embeds by template and owner. Replace inline script allowances with nonces or hashes, remove obsolete vendors and keep the initial policy focused enough that reports can be interpreted.
Operate report-only carefully
Collect violations at a controlled endpoint, sample high-volume browser noise and group by directive, blocked origin and page. Exercise consent states and less common account journeys before assuming a quiet report stream is complete.
Enforce in stages
Begin with a small template group, monitor user-visible failures and retain a rapid header rollback. Expand only when new dependencies enter through a reviewed change that updates both the implementation and policy evidence.
Wildcard sources and unsafe-inline may silence reports, but they remove much of the protection the policy was introduced to provide.