Picto thématique

Rule n° 207 - The website offers a security mechanism that limits the sources of its content.

The server sends a page containing various elements (JavaScript files, CSS, webfonts, etc.) to the browser, which will download and display everything as quickly and efficiently as possible... without questioning the legitimacy of what it is doing. The system called Content Security Policy allows the browser to indicate rules regarding the origin of this content. This makes it possible to determine exactly what it is allowed to execute or display, and thus increases security for users.

#Basics #Development #Security

Goal

  • Reduce the risk of executing or serving content that is undesirable or that comes from an unauthorized source.

Implementation

Enable the Content-Security-Policy HTTP header with the appropriate CSP 1 directives:
  • img-src for images

Control

  • script-src for JavaScript

    By Opquast - Read the license


    Discover Opquast training and certification

    The objective of these rules and the Opquast community mission is ‘making the web better’ for your customers and for everyone! Opquast rules cover the key major areas of risk that can negatively affect website users such as privacy, ecodesign, accessibility and security.

    Opquast training has already allowed over 19,000 web professionals to have their skills certified. Train your teams, contact us

    We offer a 1 hour free discovery module.