[Kerberos] Add realm name & UPN to user metadata#33338
[Kerberos] Add realm name & UPN to user metadata#33338bizybot merged 5 commits intoelastic:masterfrom
Conversation
We have a Kerberos setting to remove realm part from the user principal name (`remove_realm_name`). If this is true then the realm name is removed to form username but in the process, the realm name is lost. For scenarios like Kerberos cross-realm authentication, one could make use of the realm name to determine role mapping for users coming from different realms. This commit adds user metadata for `realm` and `user_principal_name`.
|
Pinging @elastic/es-security |
| } | ||
| } | ||
|
|
||
| } No newline at end of file |
There was a problem hiding this comment.
nit: leave the newline at the end of the file
tvernum
left a comment
There was a problem hiding this comment.
I think we need to change the name of these metadata fields.
| final String realmName = (userAndRealmName.length > 1) ? userAndRealmName[1] : null; | ||
| final Map<String, Object> metadata = new HashMap<>(); | ||
| metadata.put("realm", realmName); | ||
| metadata.put("user_principal_name", userPrincipalName); |
There was a problem hiding this comment.
I think these need to be prefixed with kerberos_ (or similar). In particular, adding "realm" metadata that refers to a Kerberos realm rather than an ES realm feels like a problem.
There's precedent here - the LDAP realm uses ldap_dn and ldap_groups.
There was a problem hiding this comment.
Yes, I think the naming was too generic will change it. Thank you.
|
Hi @tvernum, I have changed the name as suggested. Please review when you get some time. Thank you. |
|
Once #33262 (Authorization realms support) is backported, I will backport this change. Thanks. |
* master: (24 commits) Only notify ready global checkpoint listeners (elastic#33690) Don't count hits via the collector if the hit count can be computed from index stats. (elastic#33701) Expose retries for CCR fetch failures (elastic#33694) Test fix - Graph vertices could appear in different orders based on map insertion sequence (elastic#33709) Structured audit logging (elastic#31931) Core: Add DateFormatter interface for java time parsing (elastic#33467) [CCR] Check whether the rejected execution exception has the shutdown flag set (elastic#33703) Mute ClusterDisruptionIT#testSendingShardFailure Revert "Mute FullClusterRestartSettingsUpgradeIT" Adjust BWC version on settings upgrade test (elastic#33650) [ML] Allow overrides for some file structure detection decisions (elastic#33630) Adapt skip version for doc_values format deprecation [TEST] wait for no initializing shards [Docs] Minor fix in `has_child` javadoc comment (elastic#33674) Mute FullClusterRestartSettingsUpgradeIT [Kerberos] Add realm name & UPN to user metadata (elastic#33338) [TESTS] Disable specific locales for RestrictedTrustManagerTest (elastic#33299) SQL: Return functions in JDBC driver metadata (elastic#33672) SCRIPTING: Move terms_set Context to its Own Class (elastic#33602) AwaitsFix testRestoreMinmal ...
We have a Kerberos setting to remove realm part from the user principal name (remove_realm_name). If this is true then the realm name is removed to form username but in the process, the realm name is lost. For scenarios like Kerberos cross-realm authentication, one could make use of the realm name to determine role mapping for users coming from different realms. This commit adds user metadata for kerberos_realm and kerberos_user_principal_name.
We have a Kerberos setting to remove realm part from the user
principal name (
remove_realm_name). If this is true thenthe realm name is removed to form username but in the process,
the realm name is lost. For scenarios like Kerberos cross-realm
authentication, one could make use of the realm name to determine
role mapping for users coming from different realms.
This commit adds user metadata for
realmanduser_principal_name.