Adding Content Security Policies in an extensible way. #995
Unanswered
peterMuriuki
asked this question in
Ideas
Replies: 1 comment
-
References
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We have recently found ourselves needing to think about how we should implement CSP(content security policy) for this application. This discussion issue is my attempt at documenting a few thoughts on where best to implement this.
CSP allows us to limit how and from whom the web application loads resources. This hugely mitigates against injection attacks such as XSS.
We have 3 options:
header
directive to the deployment files.The argument for 1 is that we can fine tune the policy for specific pages as needed, thus implying flexibility. On the other hand There are some CSP features not supported by the Meta tag like
report-uri
which makes it a bit of deal breaker.While 3 seemed attractive at first, it would require us to duplicate the directive in each deployment values file which is less than ideal. This could have been solved by defining and using a default directive in the helm-charts we use. However this arg breaks down when you consider that the helm charts are supposed to be flexible enough to use with any web service and not just Nginx.
I went with the option no.2 since majorly its the recommended approach.
Also, We we can make it configurable and reasonably modify our helm-chart to contain the default policy values without necessarily making it coupled to the underlying ingress controller.
Beta Was this translation helpful? Give feedback.
All reactions