Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Custom CSP #2977

Open
1 task
K8Sewell opened this issue Dec 6, 2024 · 7 comments
Open
1 task

Create Custom CSP #2977

K8Sewell opened this issue Dec 6, 2024 · 7 comments
Assignees

Comments

@K8Sewell
Copy link

K8Sewell commented Dec 6, 2024

Summary

To ensure feature parity until all open source resources are updated to not use inline scripts or styles 'unsafe-inline' was added to the default CSP. It is possible to customize the CSP per page and this will allow for a more secure policy - only allow 'unsafe-inline' in very specific cases until open source packages have updated their style and script injections.

Acceptance Criteria

  • 'unsafe-inline' is removed from the default CSP and all features that require it have their own custom CSP

Engineering Notes

https://api.rubyonrails.org/classes/ActionController/ContentSecurityPolicy/ClassMethods.html#method-i-content_security_policy

#2875 - related ticket

Exceptions to Mitigate

  • Mirador
  • Blacklight Range Limit
  • Webpacker
  • Font Awesome
  • OnClick actions in search bar

Image

Image

Image

Image

@K8Sewell
Copy link
Author

K8Sewell commented Jan 9, 2025

Deployed PRs to Demo for testing - they should be live in about 15 min. if anyone has time to click around a bit later this afternoon to help me get some additional data into honeybadger before marking these PRs as ready to go that would be super appreciated. Thanks so much!

@K8Sewell
Copy link
Author

K8Sewell commented Jan 9, 2025

This font error is back - but we fixed it in ticket #2972 so I'm not sure what changed to create this issue again.

Image

@K8Sewell
Copy link
Author

K8Sewell commented Jan 10, 2025

To further alleviate google tag manager issues - would it be possible to disable a few settings in the GTM dashboard? Found this issue (and recommended suggestion) from October that may help us out with future upgrades.

@K8Sewell
Copy link
Author

K8Sewell commented Jan 10, 2025

PRs ready for review:

Both branches are deployed to Demo currently. There have been no CSP reports or errors in HoneyBadger (for Demo env) since the most recent deploy this afternoon.

@jpengst
Copy link
Collaborator

jpengst commented Jan 13, 2025

Management: Deployed to Test v2.74.1
Blacklight: Deployed to Test v1.65.4

@K8Sewell
Copy link
Author

K8Sewell commented Jan 14, 2025

Got most of it but did miss an elem directive - taking back to in progress to fix. Aside from this error HoneyBadger had no other CSP Reports from Test since these releases were deployed.

Image

Image

Waiting on PR to make it through CI before taking it out of draft - https://github.com/yalelibrary/yul-dc-blacklight/pull/1080/files

@K8Sewell
Copy link
Author

PR ready for review - yalelibrary/yul-dc-blacklight#1080

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

No branches or pull requests

2 participants