-
Notifications
You must be signed in to change notification settings - Fork 10
replace CSP with new default, with start/end markers for auto replacement #984
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
Conversation
labkey-tchad
left a comment
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 |
labkey-tchad
left a comment
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
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. |
|
Trey has made the excellent point that the CSP source should be in server repo, then flow on to chef/dockerfile from there. I had dismissed it early on because I thought that copy was only for local dev... didn't realize that's what all the teamcity tests were keyed from. So now the |
labkey-tchad
left a comment
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.
Could you swap the order of the report and enforce block back to how it was? Just to make the diff a bit clearer for future history tracking. (Not a huge deal if it would have other side-effects I'm unaware of)
We'll deal with youtube embedding later. There's just one self-contained test that will trigger a CSP warning.
… enforce/report order
when I tested swapping the order back to how it was, I found and fixed a problem with the push to chef repo, in which the chef recipe version bump was happening even if the application.properties.erb was unchanged. Lucky! |
…ment (#984) * replace CSP with new default, with start/end markers for auto replacement * add copy_csp_blocks action * add guard against updating chef repo when ap file didn't change --------- Co-authored-by: labkey-tchad <tchad@labkey.com>
Rationale
https://github.com/LabKey/kanban/issues/362
we're going to use the
serverrepo's Content Security Policy as the source going forward. Updates there will be automatically sent tosyseng-chef-serverandDockerfilerepos.Both report and enforce policies are copied in full to
syseng-chef-server, with minor changes performed by the action. The 'enforce' policy is copied and uncommented to LabKey/Dockerfile/application.properties.more on the action:
Related Pull Requests
Changes