Content Security Policy (CSP)
A CSP can restrict permitted script sources in the browser. A report-only policy observes violations but does not enforce those rules.
Content Security Policy, or CSP, is a security policy a website sends to the browser. Its directives can specify which scripts and other resources a document may load. The browser applies the rules that have been defined; the mere presence of a CSP says nothing about how strict it is.
Distinguish reporting from enforcement
A fictional project portal initially plans a policy using the Content-Security-Policy-Report-Only response header with a reporting endpoint configured. This policy reports violations but does not block them. A report can also point to a needed resource missing from the proposed rules; it is not evidence of an attack by itself.
The enforcing version is delivered through Content-Security-Policy. It blocks violations of the rules it covers. When switching, the team therefore also needs to check that the portal's required features still work. An additional enforcing policy already present can remain effective during the trial.
An additional layer of protection
MDN describes CSP as an additional defence against cross-site scripting, among other uses. Safe output locations and the necessary sanitisation of permitted HTML are still required. The portal example explains the two modes; it contains no configuration tested on a real website.
Sources
Related terms
- Cross-site scripting (XSS)In XSS, external content becomes executable code in the browser. The key issue is how an application inserts input into its pages.
- HTMLHTML describes the structure and meaning of web content. It identifies elements such as headings, tables and input fields.
- FrontendThe frontend is an application’s user-facing interface. Helpful browser feedback does not replace authoritative server-side checks.
- Data minimisationData minimisation limits personal data to what is adequate, relevant and necessary for a defined purpose.
- Data retention policyA data retention policy defines the purpose, start, duration and end of storage. Deletion jobs and copies must be addressed in the implementation.
- Envelope encryptionEnvelope encryption separates the data key from the key protecting it. The encrypted file and wrapped data key need to be managed together.
Your project with ASES
Describe your project to us. We will get back to you with an initial assessment.