Skip to content
Merged
Show file tree
Hide file tree
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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ documents for different readers.
CRITICAL CVEs, and each image with findings has an open issue until a scan
finds it clean.
- **Documented decisions and runbooks.** 134 ADRs covering what was chosen
and what was rejected — including the costs accepted knowingly; 56
and what was rejected — including the costs accepted knowingly; 57
runbooks for the operations that are easy to get wrong at 1am, one of which
is the handover page a successor reads first. Every critical alert links to
one.
Expand Down Expand Up @@ -238,7 +238,7 @@ inbound passes may still reach it. Data flow and the maintained Mermaid topology
│ ├── diagrams/ # the network diagram (SVG) and its predecessors
│ ├── adr/ # 134 ADRs — architecture decision records
│ ├── exercises/ # purple-team exercise records — see its README
│ └── runbooks/ # 56 runbooks; successor-handover.md is the front door
│ └── runbooks/ # 57 runbooks; successor-handover.md is the front door
└── Makefile # make help
```

Expand Down
79 changes: 79 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,38 @@ docstring gives: it is a record, not a claim about now.

## 2026-11-25

- **`harden-saruman.md` is applied on `Saruman`, except §2 and §5's
reboot check.** It closes what the audit of 2026-11-13 found on the host.
- **§1.** A drop-in, `/etc/ssh/sshd_config.d/10-keys-only.conf`, turns off
password and keyboard-interactive logins and X11 forwarding, and keeps
root to keys. Every SSH login since 2026-09-25 had used a key. `sshd -T`
reads `without-password`, `no`, `no`, `no`. A password attempt is offered
`publickey` only and refused, and a key login still works.
- **§3.** `phoenix@pve!builder2` is removed. `pveproxy`'s access logs held
no request from it, against 1,101 from `builder`. `pveum user token list`
shows `builder` alone.
- **§4.** `1password-cli`, `glow` and `gum` are purged, and the 1Password,
charm and debug-symbol sources and their keyrings are gone.
`debian.sources` names each suite once, from `deb.debian.org` and
`security.debian.org`, with `contrib` kept. `apt-get update` warns of
nothing. `sources.list.d` holds `ceph.sources`, `debian.sources`,
`hpe-mcp.list` and `proxmox.sources`.
- **§5.** `rpcbind.socket` and `rpcbind.service` are disabled, stopped and
masked, so no other unit's dependency can start them. Nothing listens on
`111`. The ISO store is still mounted over NFSv4.2 and `active`, and a
fresh NFSv4 mount of the share with both masked succeeded. The reboot
check is owed.
- **§6.** The self-made CA, its leaf and chain, the `pveproxy-ssl.*`
copies and `cluster.fw.new` are deleted from `/root`. None was in use:
`8006` serves a different certificate, and `cluster.fw.new` matched the
live file. `pre-421-s3/` stays until the operator decides.
`proxmox-kernel-6.8.12-9-pve-signed` and six `rc` kernel packages are
purged. `/boot` and GRUB hold 6.8.12-43, 7.0.14-28 and 7.0.14-30, the
three `proxmox-boot-tool kernel list` selects.
- **Not done.** §2, a second factor on `root@pam`, is the operator's.
The `pre449weaknesses` snapshots and the fs-freeze timeouts on `titan`
and `ramuh` are not part of the runbook and are unchanged.

- **`neo` is on RouterOS 7.24.7 long-term.** Upgraded from 7.24.6 at
01:00 UTC under a one-hour silence on `component=~"internet|network"`,
after a verified `make backup-switch`. The download staged in RAM and left
Expand All @@ -34,6 +66,53 @@ docstring gives: it is a record, not a claim about now.

## 2026-11-24

- **An audit of `Saruman`, read-only, found its management plane open to a
password behind the firewall, an undeclared API token, and two snapshots
that could roll back the domain.** It was read on the box on 2026-11-13,
against this repository at `2276e75`.
It is filed on 2026-11-24, when it merged. A read of the box that day
found every item below as described, except ADR-0107.
[`harden-saruman.md`](runbooks/harden-saruman.md) is new and holds the
fixes, none of them applied yet.
- **What matched.** 21 guests with the VMIDs and names in `network.md`
and `tofu/`, and the `on-demand` tag on exactly the guests that should
carry it. Templates 901 and 903–912 are present, and 902 is on `gandalf`.
`golem-nightly` holds exactly the `backup`-tagged guests. Both firewall
levels are on with `policy_in: DROP`, `local_network` is `10.0.30.20`,
and `management` holds only that address. The Zeek mirror runs on 14 of
14 ports. There is no Docker. No updates were pending, and the newest
kernel was running. The array, the cache battery, ECC and the SSDs' SMART
all read OK, and all 12 collectors were fresh. The fans, PSUs and
temperatures were read through `shiva` the same day and are OK.
- **What did not.**
- [ADR-0107](adr/0107-subscribe-trinity-to-the-ups-and-bound-saruman-s-guest-stop.md)'s
`Saruman` half was not applied. It was applied the same day, in its
own change.
- `sshd` took root's password and allowed X11 forwarding, and
`root@pam` had no second factor on `8006`.
- A second token, `phoenix@pve!builder2`, has no expiry and privilege
separation off. Nothing in this repository names it, and its access
logs show no request from 2026-10-12 on.
- The `pre449weaknesses` snapshot from 2026-10-07 is still on 150–153.
Rolling back a domain controller five weeks would roll back the
domain's update sequence numbers.
- The nightly backup's fs-freeze times out on `titan` (152) and `ramuh`
(153). The 2026-11-07 run failed for `garuda` with a write timeout to
`golem`.
- The 1Password, charm and Proxmox debug-symbol apt sources are
configured, and Debian is listed twice. An old self-made CA with its
key, and copies of `pveproxy`'s certificate, sit in `/root`.
- `rpcbind` listens on `111`. One spindle reads a reallocated sector of
1, which only the iLO watches.
- **Corrected here.** `security.md` said the firewall admits `8006` and
`22` from Hicks. It admits `8007` too, as ADR-0014 decided and
`network.md` says, and nothing listens there. The audit also listed the
Ceph source and `ceph-common` and `ceph-fuse` as unneeded.
`libpve-storage-perl` and `pve-qemu-kvm` depend on both, so they stay,
and the runbook says so.
- **Not decided here.** Deleting the snapshots and the freeze on the
two Windows servers are left to the operator. Neither is a host setting.

- **The wall page's files are served with `Cache-Control: no-cache`.** The
card-by-card review's changes, below, reached `trinity` at `c5374a15`,
but `heimdall`'s kiosk kept running the old `wall.js` through a Chromium
Expand Down
209 changes: 209 additions & 0 deletions docs/runbooks/harden-saruman.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,209 @@
# Runbook: Close what `Saruman`'s installer and its history left open

**The hypervisor holds every lab guest. Its firewall is the only control
in front of a root password, and its apt sources trust vendors that the
host does not need.**

> **Status — 2026-11-25: §1, §3, §4 and §6 applied and checked; §5 applied
> and masked, its reboot check owed; §2 not done.** A read-only audit of `Saruman` on
> 2026-11-13 found each item below. Every section ends with the check that
> proves it was applied. §2 is the operator's, in the web UI. §5's check
> waits for the next reboot. `pre-421-s3/` in `/root` is kept until the
> operator decides.

`Saruman`'s Proxmox firewall admits `22`, `8006` and `8007` from Hicks and
`8006` from `phoenix`, and drops everything else
([ADR-0014](../adr/0014-put-ifrit-on-imaginationlan-and-give-the-targets-no-route.md),
[`network.md`](../network.md)). `PveFirewallDisabled` pages if it goes off.
Behind it, sshd still accepts root's password, and so does `8006`. A
workstation on Hicks, or the whole of VLAN 30 if the firewall stops, is one
guessed password from root on the host. `gandalf`
([`build-the-playground.md`](build-the-playground.md) §4) and `golem`
([`build-the-backup-guest.md`](build-the-backup-guest.md) §2) are both closed
the same way. This runbook does the same for `Saruman`.

## 0. Before you start

- **Have the console to hand.** `shiva`'s remote console is the way back if
SSH locks you out. It needs root's password, which this runbook leaves set.
- **Root logs in by key from Hicks.** Every workstation that runs
`deploy-agent.sh` or `install-agent-collectors.sh` against `Saruman` needs
its key in `/root/.ssh/authorized_keys` before §1. Prove it from each one:

```bash
ssh -o PasswordAuthentication=no root@10.0.30.20 true
```

It must return with no password prompt.

## 1. SSH: keys only, no X11

Open a root shell on `Saruman` from Hicks with a key, and leave it open until
the checks pass. `sshd` keeps sessions that are already open, so this shell
is the way back. In it:

```bash
printf '%s\n' \
'# harden-saruman.md §1: keys only. Root logs in by key, never by password.' \
'PermitRootLogin prohibit-password' \
'PasswordAuthentication no' \
'KbdInteractiveAuthentication no' \
'X11Forwarding no' \
> /etc/ssh/sshd_config.d/10-keys-only.conf
sshd -t && systemctl reload ssh
sshd -T | grep -E '^(permitrootlogin|passwordauthentication|kbdinteractiveauthentication|x11forwarding) '
```

**You should see** `permitrootlogin without-password`, `passwordauthentication
no`, `kbdinteractiveauthentication no` and `x11forwarding no`. The drop-in
wins over the main file's `PermitRootLogin yes` because `Include` comes first
in `sshd_config` and `sshd` keeps the first value it reads.

Then, from a second terminal on Hicks:

```bash
ssh -o PubkeyAuthentication=no -o PreferredAuthentications=password root@10.0.30.20 true
ssh -o PasswordAuthentication=no root@10.0.30.20 true
```

The first must fail with `Permission denied (publickey)` and no password
prompt. The second must succeed. If it fails, go back to the open shell,
remove the drop-in and run `systemctl reload ssh`.

## 2. A second factor on `root@pam`

`root@pam` on `8006` can do everything the host can. In the web UI:
*Datacenter → Permissions → Two Factor → Add → TOTP*, user `root@pam`. Then
add *Recovery Keys* for the same user, and keep them with root's password,
not in this repository.

API tokens do not take a second factor, so `phoenix`'s `builder` token is
unaffected. Neither are `qm` and `pvesh` from a root shell, or the console
login.

**Check:** log out, and log in again as `root@pam`. It must ask for the
code. If a phone is lost and the recovery keys with it, a root shell can
remove the factor. `pveum user tfa list root@pam` prints each factor's ID;
`pveum user tfa delete root@pam --id <ID>` removes that one, and with no
`--id` it removes every factor the user has.

## 3. One API token for `phoenix`, not two

[`build-the-jumpbox.md`](build-the-jumpbox.md) declares one token,
`phoenix@pve!builder`, and `tofu/` and Packer use it. `Saruman` also holds
`phoenix@pve!builder2`, with no expiry and privilege separation off, so it
carries all of `phoenix`'s rights. Nothing in this repository or its
history names it, nothing in the journal records its creation, and
`pveproxy`'s access logs show no request from it between 2026-10-12 and
2026-11-14. `builder` made hundreds in the same period.

```bash
pveum user token remove phoenix@pve builder2
pveum user token list phoenix@pve
```

**You should see** one row, `builder`. If something breaks afterwards, it
used the token. Record what it was before giving it a token of its own.

## 4. What the host runs, and the apt sources it trusts

This is what `Saruman` needs:

| Source | For |
| --- | --- |
| Debian `trixie`, `trixie-updates`, `trixie-security` | The base system |
| `download.proxmox.com` `pve-no-subscription` | Proxmox VE |
| `download.proxmox.com` `ceph-tentacle` `no-subscription` | `ceph-common` and `ceph-fuse`. `libpve-storage-perl` and `pve-qemu-kvm` depend on them, so they stay, even with no Ceph cluster |
| HPE `mcp` | `ssacli`, which reads the P440ar ([`fit-the-saruman-ssds.md`](fit-the-saruman-ssds.md)) |

Alloy, the native agent
([ADR-0020](../adr/0020-run-the-lab-stack-in-a-guest-with-its-own-prometheus.md)),
needs no source: `deploy-agent.sh` installs a pinned `.deb` from Grafana's
releases.

Anything else is a vendor running code as root on the host that holds every
guest. The audit found three:

- `1password.list`, for `1password-cli`;
- `charm.list`, for `glow` and `gum`;
- `pve-dbgsym.sources`, with no debug-symbol package installed from it.

It also found Debian listed twice in `debian.sources`, once from
`deb.debian.org` and once from `ftp.us.debian.org`.

```bash
apt-get purge 1password-cli glow gum
rm /etc/apt/sources.list.d/1password.list /etc/apt/sources.list.d/charm.list \
/etc/apt/sources.list.d/pve-dbgsym.sources \
/etc/apt/keyrings/1password.gpg /etc/apt/keyrings/charm.gpg
```

Edit `/etc/apt/sources.list.d/debian.sources` so that each suite appears once,
from `deb.debian.org`. Then:

```bash
apt-get update && ls /etc/apt/sources.list.d/
```

**You should see** `apt-get update` finish with no warning about duplicate
targets, and only `ceph.sources`, `debian.sources`, `hpe-mcp.list` and
`proxmox.sources`.

## 5. `rpcbind` off

The ISO store is mounted over NFSv4.2
([ADR-0072](../adr/0072-put-the-iso-store-on-smaug-over-nfs-to-saruman-alone.md)),
and NFSv4 needs no portmapper on the client. Proxmox's NFS check queries
`smaug`'s portmapper, not this host's. `rpcbind` listens on `111` on every
address anyway. The firewall drops it, but nothing on the host needs it.
`nfs-common` stays for the mount, so mask the two units as well as disabling
them: a mask stops another unit's dependency from starting them again, as
[`build-the-playground.md`](build-the-playground.md) does on `gandalf`.

```bash
systemctl disable --now rpcbind.socket rpcbind.service
Comment thread
Gerrrt marked this conversation as resolved.
Resolved
systemctl mask rpcbind.socket rpcbind.service
```

A fresh NFSv4 mount of the share at a scratch directory proves the mount
needs neither before the reboot does. If an NFSv3 store is ever added,
unmask and enable them first.

**Check:** reboot in a maintenance window, then `findmnt -t nfs4` shows the
ISO share, `pvesm status` shows its storage `active`, and `ss -tlnp | grep
:111` prints nothing.

## 6. Leftovers in `/root`, and old kernels

The audit found these in `/root`, none of them in use:

- `ca.pem`, `ca-key.pem`, `cert.pem`, `cert-key.pem` and `fullchain.pem`
from 2025-09-14: a self-made CA, its leaf and the chain of the two.
`pveproxy` serves the Proxmox CA's certificate.
- The `pveproxy-ssl.*` copies that
[`build-the-lab-templates.md`](build-the-lab-templates.md) makes.
- `cluster.fw.new`, which is identical to the live firewall file.

Read each one before you delete it. Keep `pre-421-s3/` only if it is still
wanted.

Removed kernels left `rc` packages behind: six on 2026-11-24. One more,
`proxmox-kernel-6.8.12-9-pve-signed`, is still installed, and
`proxmox-boot-tool kernel list` does not select it. Leave
`proxmox-kernel-6.8` and the 6.8 kernel it pulls in, 6.8.12-43 on
2026-11-24. `proxmox-boot-tool kernel list` selects it, so it is the way
back if a 7.0 kernel will not boot.

```bash
apt-get purge proxmox-kernel-6.8.12-9-pve-signed
dpkg -l | awk '/^rc/ && /proxmox-kernel/ {print $2}' | xargs -r apt-get purge -y
proxmox-boot-tool refresh
```

**Check:** `dpkg -l | grep -c '^rc'` counts no kernels, and `ls /boot` holds
only kernels in `proxmox-boot-tool kernel list`.

## 7. Write down what is now true

Record each applied section in [`changelog.md`](../changelog.md) on the day,
with what its check printed, and update this runbook's status line.
Loading