Repository navigation
Conversation
The DDI seeds a well-known root password ('bluefin', hash public in this
repo) into every shipped image with shadow last-change 19700, so the
credential never expires and is identical fleet-wide. PR projectbluefin#169 already
restored the sshd drop-in hardening (PermitRootLogin prohibit-password,
PasswordAuthentication no), which closes the remote root path; the
remaining gap from projectbluefin#168 is that console bring-up never forces rotation.
Set the shadow last-change field to 0 (the `chage -d 0 root` equivalent):
every login as root — console included — is forced onto a per-install
password before any shell is granted. Update the console banner to
disclose the forced change, and add a unit contract locking in both the
rotation and the SSH no-password-auth policy as a regression guard.
The long-term removal of the baked password (core operator account,
systemd-credentials key provisioning) is tracked by projectbluefin#80; this is the
minimal interim hardening requested by the issue.
Fixes: projectbluefin#168
Hive-Run: projectbluefin#168
Hive-Plan: Security remediation — interim hardening of seeded root credential (issue projectbluefin#168, recommendation item 2)
Hive-Spec: docs/superpowers/specs/2026-09-09-core-login-design.md#interim-shadow-expiry
Assisted-by: GLM (z-ai/glm-5.3-flash) via GitHub Copilot
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: mendezr <mendezr@users.noreply.github.com>
There was a problem hiding this comment.
The change does what it says for the console path; I have one open question about the key-based SSH path that a human should test before this lands.
Verified:
elements/oci/bluefin-server-ddi.bst:86sets shadow field 3 (lastchg) to0. Pershadow(5),0means "must change at next login", andpam_unixaccount returnsPAM_NEW_AUTHTOK_REQDfor it — so consoleloginforcespasswdbefore a shell, as described.- The DDI currently boots
rw(docs/skills/architecture-roadmap.md:26, "DDI is currently bootedrw"), sopasswdcan persist the new hash to/etc/shadow; this is not a lockout. files/os/ssh/sshd_config.d/bluefin-server.conf:8-11has exactly the three directives the new test asserts.- Test regex at
tests/unit/test_root_credential_contract.py:26matches theprintf 'root:…'line and the field-count check is correct for the 9-field line.
Open question — key-based root SSH after this change. sshd with UsePAM yes (the Flatcar default; this repo's drop-in doesn't override it) runs pam_acct_mgmt for pubkey logins too. When PAM reports PAM_NEW_AUTHTOK_REQD, OpenSSH forces a password change on interactive sessions and, for sessions without a TTY, aborts with Password change required but no TTY available. If that holds here, then until someone rotates the password on the local console:
ssh -i key root@host <command>(non-interactive) fails outright;- interactive key-based root sessions are made to set a password first.
That would undercut the drop-in's intent (PermitRootLogin prohibit-password — key-based root access should work; only passwords are refused) and break unattended provisioning that ssh's in as root with a key. I could not boot an image to confirm, so I'm not calling it a defect. Question for a maintainer: after a fresh install with an injected authorized_keys, does ssh -i <key> root@<host> true succeed before anyone has logged in on the console? If not, an alternative that keeps the console behaviour without touching the PAM account result is worth considering (e.g. a first-boot unit that runs passwd -e root only when no key was injected), or scoping the expiry so sshd's pam_acct_mgmt isn't affected.
Smaller open question: root is on an A/B partition (files/installer/repart.d/20-root-a.conf) with /var as the only separate mount (bluefin-server-ddi.bst:74). If a future root-image update replaces /etc/shadow, the rotation becomes per-update rather than per-install. Pre-existing, but the new comment and banner promise "per-install", so worth a word.
Confidence: 3/5 (needs attention) — 1 medium finding; 1 perspective requires a human decision
— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Hive filed out-of-scope review findings as backlog issues so they do not block this PR:
Cap: 3 backlog issue(s) per PR. |
hanthor
left a comment
There was a problem hiding this comment.
This looks fully superseded by #243: main already has lastchange 0 at elements/oci/bluefin-server-ddi.bst:88, the "(password change forced at first login)" banner text, and tests/unit/test_root_credential_contract.py. I think this can be closed; nothing is left to merge. Thanks for the fix, it landed.
|
Closing as superseded: all changes from this PR (setting shadow last-change field to 0 for forced rotation, console banner note, and |
Summary
Follow-up to the sshd hardening merged in #169, closing the remaining gap from #168: the shipped DDI still seeded the well-known root password ('bluefin', hash public in this repository) with shadow last-change
19700— a fixed date, so the credential never expired, was identical in every image, and no rotation was ever enforced at console login.This PR sets the shadow last-change field to
0— thechage -d 0 rootequivalent — so every login as root (console included) is forced onto a per-install password before any shell is granted. The well-known default is then only ever a one-time bootstrap credential, unusable until rotated.Changes
elements/oci/bluefin-server-ddi.bst: shadow last-change19700→0; comment now states the seeded credential is for local console bring-up only and must never be usable over the network (the sshd drop-in from fix: sshd drop-in — prohibit root password login (files/os/ssh/sshd_config.d/bluefin-server.conf) #169 enforcesPermitRootLogin prohibit-password,PasswordAuthentication no).files/os/issue.d/40-kubestellar.issue: banner now readsDefault login: root / bluefin (password change forced at first login).tests/unit/test_root_credential_contract.py(new): locks in (1) the seeded root shadow line has last-change0, (2) no fixed build date regression (19700), (3) the effective sshd drop-in never permits root-password/password/keyboard-interactive auth (regression guard for fix: sshd drop-in — prohibit root password login (files/os/ssh/sshd_config.d/bluefin-server.conf) #169), and (4) the console banner discloses the forced change.What this intentionally does not do
The long-term removal of the baked root password entirely (core operator account, key-only access via systemd credentials) is the larger redesign tracked by #80. This is the issue's requested interim hardening (recommendation item 2: force password rotation at first login); console bring-up via root / bluefin still works and is now rotated per install.
Verification
python3 -m pytest tests/unit— 336 passed, 1 xfailed (includes the new contract tests)python3 .github/scripts/docs-checks.py— passedjust validate— version checks pass;bst showsteps require the FSDKbst2container (sudo/podman unavailable in this environment), element graph covered by the unit suite which YAML-parses the changed elementFixes: #168
— hive: backend=pi model=openrouter/z-ai/glm-5.3-flash
🐝 Hive Agent:
contributor| SHA:6888c2f