Skip to content
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

Only verify LDAP upndomain matches kerberos domain if set #47

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions path_login.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,14 @@ func (b *backend) pathLoginUpdate(ctx context.Context, req *logical.Request, d *
b.Logger().Debug(fmt.Sprintf("identity: %+v", identity))
username = identity.UserName()

// Verify that the realm on the LDAP config is the same as the identity's
// Verify that the realm on the LDAP config (if set) is the same as the identity's
// realm. The UPNDomain denotes the realm on the LDAP config, and the identity
// domain likewise identifies the realm. This is a case sensitive check.
// This covers an edge case where, potentially, there has been drift between the LDAP
// config's realm and the Kerberos realm. In such a case, it prevents a user from
// passing Kerberos authentication, and then extracting group membership, and
// therefore policies, from a separate directory.
if identity.Domain() != ldapCfg.ConfigEntry.UPNDomain {
if ldapCfg.ConfigEntry.UPNDomain != "" && identity.Domain() != ldapCfg.ConfigEntry.UPNDomain {
w.WriteHeader(400)
_, _ = w.Write([]byte(fmt.Sprintf("identity domain of %q doesn't match LDAP upndomain of %q", identity.Domain(), ldapCfg.ConfigEntry.UPNDomain)))
return
Expand Down