-
Notifications
You must be signed in to change notification settings - Fork 9
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
replace CSP with new default, with start/end markers for auto replacement #984
base: develop
Are you sure you want to change the base?
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.
This file is for TeamCity and dev deployments, not cloud deployments. You've removed the bit that enables the enforce CSP on dev enlistments (#useLocalBuild#
) and made it so the CSP reports will be invisible on the test instance. TeamCity tests can't see the CSP warnings if they get sent to labkey.org.
Ah, I see. I didn't realize what all that was doing. Do teamcity or devs need the report block at all? If not, I could leave that out of what I'm copying in from the chef repo (while retaining the #useLocalBuild# comments). Or better/simpler, if we only copy in an uncommented enforce block, but strip "https://www.labkey.org" out of the report-uri, would that work for both dev and teamcity? |
Not all of our TeamCity suites can handle the |
ok, I've got it all fixed up to keep report enabled, enforce hidden by the |
csp.report=\ | ||
default-src 'self' ;\ |
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.
Why do the enforce
rules include https:
but the report
rules don't?
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.
leaving out https:
makes the policy more strict, which needs to be vetted with report
before it is applied to enforce
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.
Removing https
causes some CSP warnings. We have some tests that embed youtube videos (also used on labkey.org).
R reports also have the capacity to add external dependencies. JavaScript dependencies are allowed through by this CSP but CSS dependencies are not ("violated-directive": "style-src-elem"
).
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.
@labkey-adam , were any of these addressed in your recent work?
Should I restore https:
until these dependencies are taken care of?
Or, proceed as is, so we can fix these and maybe catch other warnings as well.
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 did not address these in recent work. I'd be in favor of leaving https: out of the report
policy and adding specific youtube.com URLs as external connections.
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.
Not ready to remove https yet
csp.report=\ | ||
default-src 'self' ;\ |
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.
Removing https
causes some CSP warnings. We have some tests that embed youtube videos (also used on labkey.org).
R reports also have the capacity to add external dependencies. JavaScript dependencies are allowed through by this CSP but CSS dependencies are not ("violated-directive": "style-src-elem"
).
Can tests and labkey.org add YouTube as an allowed external connection? I don't think we want to add that everywhere. And should we support nonces on |
Yes, I was going to suggest adding |
The styles triggering the CSP aren't actually in a |
It would take a gradle plugin update to modify the CSP in this file when deploying dev and test environments. Probably not too tricky but not a freebie. |
I meant, can tests add allowed servers through the Admin Console's External Allowed Sources link? |
Unfortunately, no. |
Rationale
https://github.com/LabKey/kanban/issues/362
we're going to use the syseng-chef-repo's Content Security Policy as the source going forward. Updates there will be automatically sent here by github action.
Related Pull Requests
Changes