Repository navigation
fix(security): ship root locked; provision access per node - #275
Merged
Merged
Conversation
The /usr image baked a SHA-512 hash of the public password "bluefin" into the factory /etc/shadow and the console banner advertised it, so anyone with console, IPMI or serial access to any node, or a copy of the public DDI, knew root's password. Seed root as "!unprovisioned" instead: login, su and sulogin treat it as locked, and systemd-firstboot treats it as "root not configured", so a passwd.hashed-password.root / passwd.plaintext-password.root credential still sets it (systemd-sysusers cannot: it only sets passwords for accounts it creates). Drop upstream's --prompt-root-password from systemd-firstboot.service so a node without the credential, and the USB installer's console, boot unattended instead of waiting on a prompt. Replace the banner's default-login line with a pointer to the node access docs, and pin the contract in tests: root ships !unprovisioned, no crypt(5) hash appears under elements/, files/ or include/, firstboot never prompts for a root password, and the banner advertises no credentials. Assisted-by: Claude Opus 5.5 via GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
systemd-ssh-generator socket-activates a per-connection sshd for the ssh.listen credential, AF_VSOCK and the local AF_UNIX socket. It ran without host keys, which ssh-host-keygen.service only generates before sshd.service, so every connection ended in "no hostkeys available". Pull the same one-shot key generation in before it, which makes ssh.listen a working credential-only way to open SSH on a node whose root is locked. Assisted-by: Claude Opus 5.5 via GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add a "Node access" section to the credentials skill: root ships locked, SSH keys come from Ignition or the ssh.authorized_keys.root credential, the console password from passwd.*.root credentials applied by systemd-firstboot, when that applies on diskless and installed nodes (and why it survives A/B updates), how USB-installed nodes get credentials, and what a locked root means for emergency/rescue (no SYSTEMD_SULOGIN_FORCE). Fix factory-integration.md, which still claimed root password login over SSH is permitted (projectbluefin#245), and route "node access" to the skill. Assisted-by: Claude Opus 5.5 via GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…tate DOGFOOD_CREDS=<dir> hands every file in <dir> to the guest as an SMBIOS type 11 credential named after the file, so provisioning credentials (passwd.*.root, ssh.authorized_keys.root, ...) can be dogfooded without editing the harness. Every probe now reports root's `passwd -S` status, and the installed-disk probe whether systemd-firstboot ran. Assisted-by: Claude Opus 5.5 via GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This was referenced Sep 29, 2026
jeefy
added a commit
to jeefy/server
that referenced
this pull request
Sep 29, 2026
Brings in the locked-root provisioning (projectbluefin#275) and binary patch tracking. The only conflicts were the last_updated dates of ddi-installer-build.md and kubeadm-sysext.md; both sides' content is kept. Assisted-by: Claude Opus 5.5 via GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This was referenced Sep 29, 2026
This was referenced Sep 29, 2026
3 of 4 tasks
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.
Motivation
oci/bluefin-server-usr.bstbaked a SHA-512 hash of the passwordbluefin(saltbluefin123, in git) into the factory/etc/shadowfor root, and30-bluefin.issueprintedDefault login: root / bluefinon every console. Anyone with console, IPMI or serial access to any node, or a copy of the public DDI, knew root's password. SSH already refused passwords; the console did not.Change
Root ships locked as
root:!unprovisioned:::::::. I picked!unprovisionedover!/!*because it is the only locked value the stock tools handle correctly end to end (FSDK 26.08 ships systemd v261.2):login,suandsulogintreat any leading!as locked, andpasswd -S rootreportsL.systemd-sysuserswrites the same value for a root account it creates without a credential ("let firstboot set the password later").systemd-firstbootreads!unprovisionedas "root not configured", so it still appliespasswd.hashed-password.root/passwd.plaintext-password.root. With!*it would treat root as configured and never apply them.systemd-sysuserscannot apply those credentials here: it only sets passwords for accounts it creates, and root already exists in the factory/etc/shadowthat the initrd copies in (bluefin-populate-etc.service). So the one documented console-password mechanism issystemd-firstboot, and it works the same way on diskless and installed nodes.systemd-firstboot.servicedrop-in (files/os/creds/.../systemd-firstboot.service.d/10-bluefin-no-root-prompt.conf): upstream runs it with--prompt-root-password. Once root is unprovisioned, that prompt would block every headless boot, and the USB installer's console, until someone typed a password. The drop-in runs upstream's exact command minus that one flag. The credentials still apply, and without one root stays locked.sshd-generated@.servicedrop-in:systemd-ssh-generatorsocket-activates a per-connection sshd for thessh.listencredential, AF_VSOCK and the local AF_UNIX socket. That sshd started without host keys (no hostkeys available -- exiting), becausessh-host-keygen.servicewas only ordered beforesshd.service. The drop-in pulls the same key generation in first, which makesssh.listena working credential-only way to open SSH on a locked node.Banner: the default-login line is gone. In its place is one line:
No default login; root is locked. Provision access: <link to the Node access section>.Docs: the canonical place is the new "Node access" section in
docs/skills/tpm2-credential-sealing.md, which already owns the credential table. It covers:ssh.authorized_keys.rootcredentialssh.listenpasswd.*.rootfactory-integration.mdno longer claims root password login over SSH is allowed (closes #245). The routing tables send "node access" to that skill.ddi-installer-build.mddocumentsDOGFOOD_CREDS.Emergency / rescue: with root locked,
emergency.target/rescue.targeton the booted system get no shell:suloginprintsCannot open access to console, the root account is locked.(seen in QEMU, below). I deliberately do not setSYSTEMD_SULOGIN_FORCE, which would open a passwordless root shell on the console. It can't be set at boot either, because the kernel command line is sealed in the signed UKI. For break-glass console access, provision a password credential;suloginthen asks for it. The initrd already prints errors and reboots rather than offering a shell.Harness:
DOGFOOD_CREDS=<dir>passes each file as an SMBIOS type-11 credential named after the file. Every probe now reportsroot-passwd(passwd -S), and the installed-disk probe also reports whethersystemd-firstbootran.Tests (
tests/unit/test_root_credential_contract.py, replacing the old assertions on the hash and the banner). They check that:!unprovisioned$1$ $2?$ $5$ $6$ $7$ $y$ $gy$ $md5$) appears anywhere underelements/,files/orinclude/(the pattern is self-tested)ExecStartand carries no root/--promptflags, and is installedroot /text and links a heading that exists in the skillRelated
/etctransfer any more.files/os/sysupdate.d/replaces only usr, usr-verity, the UKI and the sysexts, and/etclives on the persistent xfs root (repart.d/50-root.conf). QEMU run F below shows a password set at first boot surviving an A/B update to slot B, without being re-applied (firstboot-ran=no,root-passwd=Pon 26.09.3). I think fix(security): persist the root credential across DDI slot replacements #246 can be closed as obsolete.bluefin-server-ddi.bst, which no longer exists). This PR takes the part of feat: CoreOS-compatible login hardening and core operator key provisioning #80 that still applies: no baked credentials, no banner credentials, key-only SSH. It does not add acoreuser,sudo, or an sshd-on-by-default gate. The credentials skill'scoreexample, which pointed at feat: CoreOS-compatible login hardening and core operator key provisioning #80, is now a generictmpfiles.extraexample. Acoreoperator account can build on top of this later.systemd-sysinstallwith no login, as before (run D3). fix(installer): boot offline, allow credential overrides, quiet repart warnings #268's rename of the sysinstall drop-in doesn't conflict with this PR. For USB-installed nodes the docs say to put encrypted credentials in/loader/credentials/on the installed disk's ESP before its first boot. feat(installer): opt-in network credentials pull (inst.creds_url / inst.creds_sha256) for PXE installs #253's installer credential pull is no longer in the tree.Verification
Gates on the final HEAD:
python3 -m pytest tests/unit -qin a clean detached worktree with no boot keys → 376 passed.bats tests/unit→ 74 ok.python3 .github/scripts/docs-checks.py→ passed.just validate→ passed.QEMU/OVMF with Secure Boot enforcing, using
scripts/dogfood-diskless.shanddogfood-install.sh. Probes report on ttyS1. Images came fromjust export-imageof this branch (26.09.2, plus26.09.3as NEXT).root-passwd=L,shadow-root=!unprovisioned,firstboot=success argv[]=systemd-firstboot --prompt-locale --prompt-keymap-auto --prompt-timezone --mute-console=yes, banner line as above,failed=0, PASSsuloginon ttyS1Cannot open access to console, the root account is locked.The probe then hung onsulogin's "Press Enter" and timed out; that's a probe artifact, and A3 is the clean rerun.DOGFOOD_CREDS:passwd.hashed-password.root(yescrypt),ssh.authorized_keys.root,ssh.listen=22root-passwd=P,shadow-root-matches-cred=yes($y$j9T$…),authorized_keys=… 600 root,ssh-key-login=ok-rootover thessh.listensocket,ssh-password-login=root@127.0.0.1: Permission denied (publickey).,failed=0, PASSsshd-generated@drop-insshd: no hostkeys available -- exiting(this is why the drop-in exists)tests/fixtures/ignition/var-on-disk.ign+ state diskauthorized_keys=ssh-ed25519 AAAA... dogfood 600 root,shadow-root=!unprovisioned,root-passwd=L,var=/dev/vdb1 xfs,failed=0, PASSjust dogfood-install dist/diskless-next, no credentialsfirstboot-ran=yes,root-passwd=L) → update=0 →os=bluefin-server 26.09.3frombluefin_usr_26.09.3(firstboot-ran=no,root-passwd=L);PASS: installed, updated A->B and booted 26.09.3dogfood-install.shwithDOGFOOD_CREDS(password + key)firstboot-ran=yes,root-passwd=P→ A/B to 26.09.3 slot B:firstboot-ran=no,root-passwd=P;PASS: installed, updated A->B and booted 26.09.3(the password persists across A/B)bluefin-server-installer_26.09.2.raw, main vs this branchsystemd-firstbootkeymap prompt on tty0 (the screendumps show the same screen). This is existing behaviour (--prompt-keymap-autoon a VT, and the factory/etchas novconsole.conf); this PR doesn't change it.installer-firstboot=active success(no root password prompt),installer-sysinstall=active runningwithsystemd-sysinstall --variables=yes --reboot=yes --mute-console=yes --definitions=/run/bluefin/installer/bluefin/repart.d --kernel=…/bluefin-server-26.09.2.efi,installer-shadow-root=!unprovisioned,installer-failed=0E and F ran on a build from before the
sshd-generated@drop-in commit. That drop-in only touches the generator's per-connection sshd, not the install or update path. A3, B2 and D3 ran on the final tree.Follow-ups (not in this PR)
systemd-firstbootasks for a keymap beforesystemd-sysinstallstarts. That's existing behaviour, and a separate UX decision: shipvconsole.conf, or drop--prompt-keymap-auto.systemd-sysinstall --load-credential=re-seal installer-side credentials, which fix(installer): boot offline, allow credential overrides, quiet repart warnings #268's drop-in rename makes possible, would remove the manual ESP step.os-creds-prov.bst/bluefin-firstboot-credentialsstill say the /usr is "Flatcar's … built without systemd-firstboot". FSDK builds it (-Dfirstboot=true), and this PR relies on that. A cleanup could fold thefirstboot.*helper into stocksystemd-firstboot.AGENTS.mdshowsjust dogfood-install NEXT=<dir>, butjusttakes the recipe argument positionally (just dogfood-install <dir>).