Skip to content
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

Add Content-Security-Policy to OSIN pages #17021

Closed
simo5 opened this issue Oct 24, 2017 · 7 comments
Closed

Add Content-Security-Policy to OSIN pages #17021

simo5 opened this issue Oct 24, 2017 · 7 comments
Assignees
Labels
area/security component/auth lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. priority/P2 sig/security
Milestone

Comments

@simo5
Copy link
Contributor

simo5 commented Oct 24, 2017

To tighten access to OSIN pages, which deal delicate authorization operations we should probably add a default Content-Security-Policy[1] of: default-src 'self'.
Hoever this will require also to add options to let customers change it as page branding may require them to tweak the CSP so that some images of other assets can be served from a different location than "self".

[1] https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP

@simo5
Copy link
Contributor Author

simo5 commented Oct 24, 2017

@jwforres we need to consider if we can use the same option for all of Openshift, or if each part will want to use their own settings.

@php-coder
Copy link
Contributor

default-src 'self'

Note that this could be dangerous if our code (or one of the dependencies) are using inline styles, inline JavaScript code, eval(), or data: URIs, because they will be blocked.

Perhaps, we could start with directive but use Content-Security-Policy-Report-Only header (alone or with report-uri attribute) in order to ensure that we didn't break anything.

@jwforres
Copy link
Member

Our own oauth pages don't have much to them and can probably be made to work with CSP OOTB. Some testing will def be required.

It is possible we could break a customer's customized templates so we would need to let them turn it off completely if necessary as part of the config.

The console is a different story entirely which is why we haven't tackled it. We are fairly certain there are dependency libraries we use that apply inline styles / JS.

@simo5
Copy link
Contributor Author

simo5 commented Oct 24, 2017

I see inline styles in OSIN too due to branding, whichis why we are not rushing with this and will need to do it later.

@openshift-bot
Copy link
Contributor

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci-robot openshift-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Feb 23, 2018
@jwforres
Copy link
Member

@simo5 I would suggest tracking this in Trello given the scope, and closing the issue. There is already a card on the UI side tracking CSP

@simo5
Copy link
Contributor Author

simo5 commented Feb 26, 2018

Done, thanks @jwforres

@simo5 simo5 closed this as completed Feb 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/security component/auth lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. priority/P2 sig/security
Projects
None yet
Development

No branches or pull requests

5 participants