-
Notifications
You must be signed in to change notification settings - Fork 189
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
Fix CSP issue and API status in dashboard #2845
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I read the description in the issue, great catch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -35,7 +35,7 @@ services: | |||
# Specify the status service port | |||
- 'traefik.http.services.status.loadbalancer.server.port=${STATUS_PORT}' | |||
# Define redirect middleware for any requests to /v1/status -> /v1/status/ (trailing slash) | |||
- 'traefik.http.middlewares.status_redirect.redirectregex.regex=(^.*\/status$$)' | |||
- 'traefik.http.middlewares.status_redirect.redirectregex.regex=(^.*\/[^status]+\/status$$)' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clever!
Issue This PR Addresses
Fixes #2511
Type of Change
Description
There are two CSP-related issues that the PR addresses.
script-src
rule violation. This is due to theonclick
handlers written right into the HTML. This was done by the Material UI template. Since there were of no use, they were removed.connect-src
rule violation. This is due to the redirection when requesting the statuses of the APIs, the redirection would slightly change the protocol fromhttps
tohttp
, violating the rule. To avoid redirection, we tighten the regex used to trigger this redirection bytraefik
.Steps to test the PR
pnpm install
)status
service (pnpm run services:start status
)Checklist