Skip to content

Conversation

@JVickery-TBS
Copy link

Another thing from the VA scan, we need to support the strict-dynamic directive in the Content-Security-Policy header to properly use the WET scripts and WET JS Builder. The strict-dynamic directive basically says that other scripts are allowed to add script node objects to the DOM and those scripts are allowed to get executed. This NEEDS to have nonces to work securely though. And it seems that if you have the strict-dynamic directive set, some browsers will ignore some of the other directives so we need to add the nonce to all assets, hence this code addition.

The CSP_NONCE environ value gets set in the canada_security plugin now from this PR: open-data/ckanext-canada#1599

- Add support for CSP Nonces for strict-dynamic directive.
- Added change log file.
- Continued unsafe inline stuffs.
- More inline things.
- More nonce usage.
- More inline things.
- More nonce usage.
- Move data images to actual images.
- Set no-cache for logged in users.
- Updated change log files.
- Fixed nonce typos.
- Removed dev console log.
- Added TODO comments.
Copy link
Member

@wardi wardi left a comment

Choose a reason for hiding this comment

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

This is going to be rough to merge with the next version of ckan, but maybe still better than copying all these templates to ckanext-canada.

The bits that reference svgs that actually live in ckanext-canada should be moved over there or the svg files should be moved here, though

- Revert any overrides, they ar ein canada plugin now.
@JVickery-TBS
Copy link
Author

Yeah merging is gunna be a pain for sure, made sure to put the comments in so it can help us in the future

- Revert any overrides, they ar ein canada plugin now.
- Revert any overrides, they ar ein canada plugin now.
- New validator for http header values.
@JVickery-TBS JVickery-TBS merged commit f8dc69f into canada-v2.10 Aug 25, 2025
1 check passed
@JVickery-TBS JVickery-TBS deleted the feature/csp_nonce branch August 25, 2025 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants