Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
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_proxy: fix session revalidation/refresh when group validation isn't being used#286

Open
Jusshersmith wants to merge6 commits intomain
base:main
Choose a base branch
Loading
fromjusshersmith-temp-fix

Conversation

Jusshersmith
Copy link
Contributor

@JusshersmithJusshersmith commentedMar 11, 2020
edited
Loading

Problem

When certain TTL's expire we revalidate or refresh the session (e.g.https://github.com/buzzfeed/sso/blob/master/internal/proxy/oauthproxy.go#L759-L764), which then ends updirectly calling theValidateGroup provider method (https://github.com/buzzfeed/sso/blob/master/internal/proxy/providers/sso.go#L381).

Because here we're not using the validator abstractions,if group validation isn't being utilised, then this causes a403 withuser is no longer in valid groups to be returned, requiring the user to refresh the page to progress further.

Solution

The logic withinValidateGroup to return a success when an empty slice of groups is passed in was removed during some refactoring as, when using 'validator' abstractions this was deemed bad behaviour**, but until we stop callingValidateGroup directly and use those abstractionseverywhere we need to maintain this behaviour.

#275 fixes this in a more permanent, stable fashion by replacing any remaining direct calls toValidateGroup with calls to the validator abstractions, however until that is merged this is one possible temporary fix.

Notes

**This was deemed bad behaviour because if the group validator is theonly validator in use (and not email domains or addresses), then allowingValidateGroup to return successful if an empty list of groups is passed becomes a loophole to allow the defining of no validators, something which we explicitly prevent (https://github.com/buzzfeed/sso/blob/master/internal/proxy/options.go#L205-L213)

@Jusshersmith
Copy link
ContributorAuthor

Jusshersmith commentedMar 11, 2020
edited
Loading

Looking back through this, I have some new thoughts:

Allowing theonly defined validator to be used with a wildcard isn't new to SSO, and also actually remains possible using the other email domain/address validators. Historically, this has probably been classed as less of a 'loophole' and more of a 'workaround'.

It probably makes sense to offer the functionality to say "as long as the request comes from a valid user in my {insert provider} domain, then allow them". But seeing as this does reduce the security footprint somewhat, we should offer this as anexplicit configuration option that can be set, rather than allowing a workaround by defining a validator with a wildcard.

My proposal then becomes:

Maybe we can combine the first and last point together.

@codecov
Copy link

codecovbot commentedMar 11, 2020
edited
Loading

Codecov Report

Merging#286 intomaster willincrease coverage by0.09%.
The diff coverage is100%.

@@            Coverage Diff             @@##           master     #286      +/-   ##==========================================+ Coverage   61.85%   61.94%   +0.09%==========================================  Files          57       57                Lines        4638     4649      +11     ==========================================+ Hits         2869     2880      +11  Misses       1556     1556                Partials      213      213
Impacted FilesCoverage Δ
internal/pkg/options/email_address_validator.go100% <ø> (ø)⬆️
internal/pkg/options/email_domain_validator.go100% <100%> (ø)⬆️
internal/proxy/providers/sso.go68.84% <100%> (+0.24%)⬆️
internal/proxy/options.go86.27% <100%> (+1.6%)⬆️

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

1 participant
@Jusshersmith

[8]ページ先頭

©2009-2025 Movatter.jp