- Notifications
You must be signed in to change notification settings - Fork190
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
sso_*: prevent copying of session between upstreams#299
Conversation
Codecov Report
@@ Coverage Diff @@## master #299 +/- ##==========================================+ Coverage 61.94% 61.98% +0.03%========================================== Files 57 57 Lines 4638 4645 +7 ==========================================+ Hits 2873 2879 +6- Misses 1553 1554 +1 Partials 212 212
Continue to review full report at Codecov.
|
460276a
toa94ea18
Compare// that is being requested, so we trigger the start of the oauth flow. | ||
// This exists primarily to implement some form of grace period while this additional session | ||
// check is being introduced. | ||
p.OAuthStart(rw, req, tags) |
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.
Question: will this invalidate the current validated session for 'foo' upstream?
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.
It doesn't invalidate the session on the original upstream - and because it restarts the oauth flow for thenew request/upstream the UX should be pretty seamless when this is triggered.
Problem
Weonly revalidate group membershipwhen the session is refreshed or revalidated, which means that if a user were to successfully authorize with upstream 'foo', then they can effectively skip group membership validation on adifferent upstream by making the request with a slightly altered version of the saved cookie from the 'foo' upstream (providing the session is still valid and hasn't expired).
Solution
Add a new
AuthorizedUpstream
value to the session which is used to compare the upstream the session has been validated against, to the requested upstream.The
AuthorizedUpstream
value is checked against the request host on each request. For the time being, when caught this check will re-trigger the start of the oauth flow, primarily to help introduce this additional check in a graceful manner.Example log line when triggered:
upstream-1.foo.io
being the original upstream the session was used against, andupstream-2.foo.io
being the newlyrequested upstream.
Notes