Skip to content

feat(wd_mycloud): install break-glass SSH keys and restore them at boot - #499

Merged
MrCodeEU merged 2 commits into
mainfrom
feat/wd-breakglass-keys
Nov 4, 2026
Merged

MrCodeEU merged 2 commits into
mainfrom
feat/wd-breakglass-keys

Conversation

@MrCodeEU

@MrCodeEU MrCodeEU commented Nov 4, 2026

Copy link
Copy Markdown
Owner

Summary

Phase 1 of docs/ZERO_TRUST_PLAN.md, break-glass for wd_mycloud.

wd_mycloud's root filesystem is a RAM disk (/dev/ram0), so /home/root/.ssh is lost at every reboot. It currently has no key files and allows password login. This PR:

  • Keeps the keys on disk: writes breakglass_pubkeys to /mnt/HD/HD_a2/breakglass/authorized_keys on the data disk.
  • Installs them now: copies the keys into /home/root/.ssh/authorized_keys (0700/0600).
  • Restores them at boot: adds a managed block to clamAV's start.sh, the same boot hook the Tailscale watchdog uses, which copies the keys again at every boot.
  • Follows the existing pattern: breakglass-check.sh (read-only guard) and breakglass-apply.sh, run by roles::wd_mycloud_proxy on nuc like the other wd_mycloud execs.

The guard is a shell test -f ... && bash .... Without it, the first noop (before the scripts exist on nuc) logs a "Could not find command" error, which the live-noop CI check treats as a failure.

Password login is deliberately left on until a key login has been tested. A follow-up switches it off at boot.

Also updates the roles::ssh_hardening header: nas got the YubiKey key by hand on 2026-11-04. A backup is at /boot/config/ssh/root/authorized_keys.pre-yk1-20261104.

Verification

  • make test and shellcheck pass.
  • Ran breakglass-check.sh locally against the device: it exits 1, as expected before an apply.
  • Noop on nuc: creates the 3 files, the exec would run, 0 errors.

🤖 Generated with Claude Code

MrCodeEU and others added 2 commits November 4, 2026 16:49
wd_mycloud's root filesystem (including /home/root) is a RAM disk, so the
break-glass keys from breakglass_pubkeys are kept on the data disk
(/mnt/HD/HD_a2/breakglass/authorized_keys), copied into root's
~/.ssh now, and again at every boot from a managed block in clamAV's
start.sh. Same check/apply proxy pattern as the other wd_mycloud execs
on nuc. Password login stays on until a key login was tested.

Also notes in roles::ssh_hardening that nas got the YubiKey key by hand.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MrCodeEU
MrCodeEU deployed to production-check November 4, 2026 16:20 — with GitHub Actions Active
@MrCodeEU
MrCodeEU merged commit 33a28f6 into main Nov 4, 2026
13 checks passed
@MrCodeEU
MrCodeEU deleted the feat/wd-breakglass-keys branch November 4, 2026 16:31

This branch was successfully deployed

1 active deployment
production-check — b5c3e9a2 Deployed Nov 4, 2026 by MrCodeEU via Live production noop #330
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant