[Experimental] Make LDAP/AD authconfig UserIDAttribute and GroupIDAttribute fields immutable#1451
Draft
pmatseykanets wants to merge 1 commit into
Draft
Conversation
pmatseykanets
commented
May 11, 2026
|
|
||
| toolchain go1.25.9 | ||
|
|
||
| replace github.com/rancher/rancher/pkg/apis => github.com/pmatseykanets/rancher/pkg/apis v0.0.0-20260504145013-06d2cbb05095 |
Contributor
Author
There was a problem hiding this comment.
This will be removed once the rancher PR is merged.
a18e177 to
c87ffcc
Compare
…mmutable Complements and dependes on rancher/rancher#48699
c87ffcc to
7ecf73c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue: rancher/rancher#55642
Problem
With rancher/rancher#54912 Rancher now has
UserIDAttributeandGroupIDAttributefields in LDAP/AD authconfigs, letting admins choose a stable LDAPattribute (e.g.
sAMAccountName) as the principal identifier instead of DN.These fields must be immutable after the provider is enabled — changing them
would silently break all RBAC bindings (CRTBs, PRTBs, GRBs) that reference
the old principal name. Rancher's
testAndApplyenforces this for theUI/API flow, but
kubectl apply, Terraform, and direct API mutationsbypass it.
Solution
The webhook now enforces two things for
UserIDAttributeandGroupIDAttribute:IsValidLdapAttr(RFC 4512), same as every other LDAP attribute field.
have
Enabled == true, any change to either field is rejected with afield.Invaliderror. To change these fields, the admin must disablethe provider first, apply the change, then re-enable — which is the
supported reconfiguration path.
Depends on rancher/rancher#54912 for the type definitions.
CheckList