Skip to content

task WI-46: Setup CMS using django-csp#672

Closed
chandra-tacc wants to merge 1 commit intomainfrom
task/WI-46-CSP-http-header
Closed

task WI-46: Setup CMS using django-csp#672
chandra-tacc wants to merge 1 commit intomainfrom
task/WI-46-CSP-http-header

Conversation

@chandra-tacc
Copy link
Copy Markdown

@chandra-tacc chandra-tacc commented Jul 14, 2023

Overview

To become fully secure site, adding detailed Content Security Policy is needed.
This uses django-csp to enable csp.

Related

Changes

This PR adds CSP headers for

  • font src
  • script src
  • style src
  • connect src
    Also, ensure the current script tags use nonce.
    The setup right now is in "report only" mode to allow for opt-in and fully functional app.

Testing

  1. Validated the site using UI and reducing console warnings.

UI

No UI change.

Notes:

At this point, due to possibly breaking the app due to CSP, this PR is in draft mode. Other mitigations are deployed via TACC/Camino#32

@wesleyboar wesleyboar added the paused Started but not actively in progress label Jul 14, 2023
@wesleyboar wesleyboar added the priority ━ Medium priority label Nov 13, 2023
@wesleyboar
Copy link
Copy Markdown
Member

Seems important, but I have not heard a request to revisit this, so I'm marking this "medium" priority.

Copy link
Copy Markdown
Member

@wesleyboar wesleyboar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do <link> elements actually use nonce?

  • W3.org states "Nonce sources require a new nonce attribute to be added to both script and style elements."
  • The MDN nonce page does not mention <link>. Only <script> and <style>.

I've created a merge conflict resolution for review — #745 — but it has a bug.

@wesleyboar wesleyboar changed the base branch from release/v4.36.X to main January 30, 2026 23:54
@wesleyboar
Copy link
Copy Markdown
Member

I nor A.I. think this PR is ready to merge. It is also very old. I think it is not worth resolving conflicts. I intend to start fresh since major changes to Core-CMS and Camino.

Conceptually: yes. Using CSP in report-only mode and gradually tightening is the right approach.

Implementation quality: mixed. Based on the visible snippets and notes, nonce usage was partially misunderstood/applied, so the exact patch in that draft was not ready to be the final solution.
— A.I.

@wesleyboar wesleyboar closed this Apr 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

paused Started but not actively in progress priority ━ Medium priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants