Skip to content

docs: add strict CSP starting example - #287

Open
rajanpanth wants to merge 1 commit into
mozilla:mainfrom
rajanpanth:docs-add-strict-csp-example
Open

docs: add strict CSP starting example#287
rajanpanth wants to merge 1 commit into
mozilla:mainfrom
rajanpanth:docs-add-strict-csp-example

Conversation

@rajanpanth

Copy link
Copy Markdown

Problem

New django-csp users need a safe starting point for a strict CSP. The maintainers asked for a base configuration in the documentation rather than changing the library default policy (see #156).

Closes #156.

Solution

Add a report-only strict-policy example that:

  • Uses the project-provided NONE, NONCE, SELF, and STRICT_DYNAMIC constants.
  • Explains why it must be rolled out in report-only mode first.
  • Links the required nonce middleware/template setup.
  • Warns against weakening the policy with unsafe-inline or unsafe-eval merely to suppress reports.

The example intentionally does not prescribe a universal enforced policy; users add resource-specific directives after reviewing their own violations.

Testing

  • sphinx-build -W -b html docs <temporary output directory>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add an example of a "strict" security policy to the configuration docs

1 participant