-
Notifications
You must be signed in to change notification settings - Fork 1
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
[WOR-1824]: Add CSP Header to Swagger Page #502
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aherbst-broad
approved these changes
Sep 30, 2024
|
marctalbott
approved these changes
Sep 30, 2024
fboulnois
added a commit
to DataBiosphere/terra-data-catalog
that referenced
this pull request
Dec 5, 2024
### Addresses https://broadworkbench.atlassian.net/browse/DT-1022 ### Summary Similar to DataBiosphere/terra-landing-zone-service#502 and DataBiosphere/terra-workspace-data-service#941 , adds a Content Security Policy to the Swagger UI using a `meta` tag. The team decided to use this approach instead of the proxy approach since catalog currently has no proxy templating which means that we would either need to modify it for all services or add our own template for catalog, both of which were deemed high risk and low value, especially since catalog is likely to be retired in the near future. Additionally, proxy changes are hard to test, whereas this change was straightforward to test. ### Testing Tested with a catalog instance locally, tried endpoints and the login, no errors were observed in the console. Next, added a CDN delivered resource, and saw failures relating to that resource in the console.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
This PR adds a Content Security Policy (CSP) header to the Landing Zone Service Swagger page to enhance security by reducing the risk of cross-site scripting (XSS) and data injection attacks.
Changes:
unsafe-inline
to enable inline scripts and styles where needed.Testing: