Merged
Conversation
96fb6e1 to
1ce52b3
Compare
1ce52b3 to
882fd4d
Compare
882fd4d to
69a16eb
Compare
69a16eb to
76c96e3
Compare
76c96e3 to
ad9deb9
Compare
43d59e8 to
38313a4
Compare
Contributor
Author
|
Initial intention would be to set the CSP:
This way we don't break anything for clients/users, but DO force our developers to deal with CSP issues ASAP. |
38313a4 to
0fed1c9
Compare
642e2f9 to
3ebb570
Compare
3ebb570 to
f6943f6
Compare
9c2dfe9 to
4a9999c
Compare
dec5833 to
f661f4c
Compare
2a3954c to
932dbc8
Compare
eaa1f6e to
3b22fcd
Compare
04d9a27 to
d7eea10
Compare
932dbc8 to
f9185e3
Compare
f9185e3 to
dc63a37
Compare
dc63a37 to
06ce988
Compare
06ce988 to
04dad33
Compare
04dad33 to
f218d6b
Compare
Contributor
Author
|
I've switched the default mode to |
This file contains hidden or 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
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.
Rework some systems to allow for ENV based configuration:
This lets us control such things using ENV injection via the Infra repo (so Sysops will control this). I've also added support for configuring part of the CSP via a settings file embedded in the Docker image.
-unsecuredimages will disappear, or at least no longer be updated. We can pre-emptively add the vars we want as mentioned below, and change the repositories that use unsecured (there are a bunch of them)Config via ENV
See the Readme for the list of supported ENV keys. Those of note are:
NGINX_CSP_MODE: Defaults toreport-only, set it toenforceto enable enforcement.NGINX_CSP_REPORT_URI: send reports to (e.g.) Sentry.NGINX_FRAME_OPTIONS: Defaults todeny, controls the oldX-Frame-Optionsheader. Set todisableto remove it completely.Config via
defaultsThe same keys (well, most of) can be set via a defaults file located at
/etc/csp-generator/default. The contents of it should look like (note the quotes where needed):Such a file could be placed there with the following in a Dockerfile (TBD, not final filenames):
COPY --from=build /app/.csp-config /etc/csp-generator/defaultDefault configuration
The provided defaults are VERY limited. The generated headers will be (equivalent to):
This CSP would barely allow anything, only connecting to itself, loading from itself, etc…. Existing applications WILL break with this setup.
Quick
unsecuresetupValues for easy "allow everything" (i.e. any HTTPS url, choose what you actually need):