fix(mail): open kpasswd (464) so password changes reach the KDC #305
No reviewers
Labels
No labels
bug
enhancement
in-progress
needs-info
needs-triage
p0
ready-for-agent
ready-for-human
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Cloonar/nixos!305
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "lab/20260808-1423"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found while running the M1 verification spikes from #301 (spike 2, the SDDM expired-password test).
What is broken
kadmindonmaillistens on 464 (tcp+udp) and 749, butnixos-fwonly allowed 88. SSSD onnbrunschpass_provider = krb5and, with nokrb5_kpasswdset, assumes the change-password service lives on the KDC — so every password change was aimed at a port that drops packets.The failure is silent. SDDM renders the
CHANGE_EXPIRED_AUTHTOKprompt correctly, accepts a new password, reports no error, and logs the user in. Meanwhile nothing reaches the KDC: the principal keepsREQUIRES_PWCHANGEand its old key. The login succeeds from SSSD's offline cache, sincekrb5_store_password_if_offline = true(hosts/nb/modules/ldap-login.nix:52).Under ADR-0023, where Kerberos becomes the only credential for the identity tenant, that is a user who believes they have rotated a compromised password and has not.
Evidence
kpasswdfromnb:kadmindis listening fine onmail:And after a full greeter-driven password change,
getprincstill showedAttributes: REQUIRES_PWCHANGEwithLast password changeunchanged from the admincpwthat set up the test.The corresponding SSSD journal is two kpasswd attempts timing out and being SIGKILLed, then the backend going offline:
The change
Opens 464 tcp+udp, mirroring how 88 is already handled — source restriction stays with the Hetzner firewall rather than nixos-fw, which has no LAN or WireGuard interface on this host to scope against. 749 stays closed, per ADR-0023 decision 10.
Caveats for the reviewer
nix-instantiatenot found), soscripts/test-configuration mailcould not run and the commit used--no-verify. The diff is a two-element list literal, but it has not been evaluated.iptables -S nixos-fwandnft list rulesetboth returned empty onmail, which is not what a live nixos-fw ruleset should look like. The behaviour is unambiguous and this change is required by ADR-0023 decision 10 regardless, but ifkpasswdstill fails after deploy, the Hetzner firewall is the remaining suspect.hosts/mail/modules/kerberos.nix:5still describes the old Hetzner boundary ("restricts port 88 to fw"). #299 M2 already flags it as stale; left alone here rather than rewriting it to a posture I have not verified.Follow-ups this surfaced (not in this PR)
pam_sssin thepasswordstack has nouse_authtok(/etc/pam.d/login), whilepam_gnome_keyringbelow it does.pam_unixruns first, prompts for new+retype, and fails because identity-tenant users have no local password by design — so the user is asked for the current password twice and a new one four times.Maximum ticket life: 1 dayandMaximum renewable life: 0, against ADR-0023 decision 9'smax_life = 10h/max_renewable_life = 7d.kdc.confrealm defaults do not retroactively apply, so M6 enrolment has to set these per principal.Refs #301, #299.