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

Cloud dot gov fixes #21

Merged
merged 2 commits into from
Jul 15, 2016
Merged

Cloud dot gov fixes #21

merged 2 commits into from
Jul 15, 2016

Conversation

pkarman
Copy link
Contributor

@pkarman pkarman commented Jul 11, 2016

Several small changes to how app is deployed to cloud.gov, most importantly turning off embed_sign so that redirect URLs are smaller than 4k.

@pkarman pkarman force-pushed the cloud-dot-gov-fixes branch 2 times, most recently from d0ea5b4 to 9b44ccc Compare July 12, 2016 18:27
@@ -11,7 +17,7 @@
frame_src: %w('self'), # deprecated in CSP 2.0
child_src: %w('self'), # CSP 2.0 only; replaces frame_src
# frame_ancestors: %w('self'), # CSP 2.0 only; overriden by x_frame_options in some browsers
form_action: %w('self'), # CSP 2.0 only
form_action: %w('self') + whitelisted_domains.uniq!, # CSP 2.0 only
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The secure_headers gem already removes duplicates from this list, so I wouldn't duplicate the effort.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, do the whitelisted domains apply to all controller actions in this app, or only when signing in and out?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

currently it's all controller actions, because it's the logout link in the nav which appears on every page.

However I am currently working on refactor to switch to SP-initiated SLO which may mean this isn't required at all.

@pkarman pkarman force-pushed the cloud-dot-gov-fixes branch from 7eee34a to f2588d3 Compare July 14, 2016 18:55
@pkarman pkarman force-pushed the cloud-dot-gov-fixes branch from f2588d3 to c9ff295 Compare July 14, 2016 18:56
@pkarman
Copy link
Contributor Author

pkarman commented Jul 14, 2016

@monfresh I made /users/logout a GET accessible route, so no need to whitelist any domains for a pseudo form button/link.

@@ -10,6 +10,7 @@
post '/users/sessions' => 'users/sessions#create', as: :user_session
delete '/users/sessions' => 'users/sessions#destroy', as: :destroy_user_session
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be removed if we're going to use get for logging out?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point. I've removed it.

@monfresh
Copy link
Contributor

This looks good. Are there any security concerns with using GET, or issues with bots triggering the sign out link?

@pkarman
Copy link
Contributor Author

pkarman commented Jul 15, 2016

Session management is with Devise, so an un-authenticated GET request to logout would either be denied or a no-op. Typically I don't like to make a non-idempotent request into a GET; this is just a convenience to avoid the browser security. To be honest, I'm not sure exactly sure why DELETE or POST poses a problem, since the action is self which then just re-directs.

Moving to SP-initiated logout in #23 may change this yet again, so I will revisit once both these PRs are merged.

@pkarman
Copy link
Contributor Author

pkarman commented Jul 15, 2016

Please merge this BEFORE #23 as it will cause a needed merge conflict with #23 that I can more cleanly resolve.

@monfresh
Copy link
Contributor

👍

@monfresh monfresh merged commit 73b8d4f into master Jul 15, 2016
@monfresh monfresh deleted the cloud-dot-gov-fixes branch July 15, 2016 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants