-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Prevent chains in authorization_realms #32732
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
Prevent chains in authorization_realms #32732
Conversation
If realm "A" delegates authoriaation to realm "B" then it is not permissible for realm "B" to also be using delegated authorization. A realm which is in the value for "authorization_realms" must handle its own authorization.
|
Pinging @elastic/es-security |
| this.licenseState = licenseState; | ||
| protected DelegatedAuthorizationSupport(Iterable<? extends Realm> allRealms, List<String> lookupRealms, Settings settings, | ||
| ThreadContext threadContext, XPackLicenseState licenseState) { | ||
| final List<Realm> realms = resolveRealms(allRealms, lookupRealms); |
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.
nit: rename realms to say resolvedLookupRealms
| return result; | ||
| } | ||
|
|
||
| private void checkRealms(Iterable<Realm> realms, Settings globalSettings) { |
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.
nit: rename this method name to describe what it checks, would also rename realms as that confused me while reading the code.
bizybot
left a comment
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.
LGTM, except few nits. Thank you.
|
This might come out as a "drive by comment", but it's 💯 legit: I am thinking to have two realm chains, grouping realms in two chains, one chain handling the user name verification (authc realm chain) and the other doing the user attributes lookup (authz realm chain). WDYT Tim and team ? |
If I understand your proposal correctly, then the problems are
On 1, that's an issue for two reasons:
I'd like to do this (in the general case, regardless of whether we have separate chains) but we removed the |
|
@albertzaharovits If you have a strong view that we should take a step back and redesign our approach to We expect this to be a relative niche feature (perhaps more common in Kerberos, but not very common elsewhere), so we're trying to balance:
If we're going down the wrong path, let's talk - we've got time to revisit this before we merge to master, but I don't think this PR is going to be the best place for that discussion. |
|
Alright @tvernum, when you lay it like this, I agree another realm chain in unwarranted. If I understand it correctly, a cycle in the configuration will still function correctly? I have checked the code for Thanks for digging through my vagueness. |
I don't understand. The check simply validates that any realm that is configured as an
Without this check you could have (for example) ldap1 delegating to ldap2 and ldap2 delegating to ldap3. |
|
Okay, thank you for the clarification and example! It would all have been simpler if I would have started with an example myself. Using yours, I think User object from |
albertzaharovits
left a comment
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.
LGTM
That is the current behaviour, and it's probably the more logical behaviour too, but it's still confusing, hence this PR. |
If realm "A" delegates authoriaation to realm "B" then it is not
permissible for realm "B" to also be using delegated authorization.
A realm which is in the value for "authorization_realms" must handle
its own authorization.