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
13 changes: 13 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,19 @@ docstring gives: it is a record, not a claim about now.
[#1691](https://github.com/Gerrrt/HomeLab/issues/1691), by
[`move-the-wan-onto-neo.md`](runbooks/move-the-wan-onto-neo.md). Until then
the remedy for `WanReceiveErrors` is still rebooting `morpheus`.
- **`morpheus`'s GUI serves a leaf from the estate CA.** It was pfSense's
default self-signed certificate, 398 days, due 2027-04-16, which the
2026-11-13 audit listed. The new leaf is `morpheus-ui.matrix.elysium`, 825
days, due 2029-02-25, with SANs for `morpheus.matrix.elysium`, `10.0.99.1`
and `10.7.7.1`. It has its own name because `morpheus.matrix.elysium` is the
syslog client leaf. The CA and the leaf were imported into pfSense's
certificate manager from the firewall's shell, after a fresh
`make backup-firewall`, so the key never reached a screen, and the staged
copies were deleted afterwards. The handshake on both addresses verifies
against `ca.pem`, and `pfsense-ui`'s expiry reads 2029-02-25. The
self-signed certificate stays in the manager as the rollback. Browsers on
the Mac still warn, since nothing there trusts this CA.
`generate-certificates.md` has the reissue steps and a trust-table row.

- **`morpheus`'s three add-ons are updated: Suricata, net-snmp and System
Patches.** Each was installed with `pfSense-upgrade -y -i`, the path Package
Expand Down
80 changes: 77 additions & 3 deletions docs/runbooks/generate-certificates.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ the certificate somewhere and not recording it is how it goes stale
| Prometheus and the ingest proxy on `alexander` (the lab guest) | `ca_file` on Prometheus, the copy carried there with the lab leaf by [`build-the-lab-guest.md`](build-the-lab-guest.md) §5. The proxy serves that leaf on the lab's TLS ingest ports (#1430) | Reissue the lab leaf and carry both files through the Mac again — `99 → 30` is closed. The six lab agents above then verify the new leaf against the new root |
| The operator's Mac — system keychain | **Not imported.** Confirmed on the device 2026-09-20: not present in Keychain Access, and an import attempt that day was refused with an "invalid key" error. ADR-0037's "the Mac's system store, at least" was wrong; Safari and Chrome do not trust the estate's CA | Nothing |
| The operator's Mac — Firefox | **Not imported.** Confirmed on the device 2026-09-20: not under Authorities. So no browser on the Mac trusts the estate's CA, and Grafana over `https` there warns until one does — which is a choice, not a defect, and importing it is the row you add here | Nothing |
| pfSense's certificate manager on `morpheus` | Imported 2026-11-23 as *Matrix Elysium Internal CA (estate)*, the CA of the GUI's leaf, so the GUI serves the chain. pfSense does not use it to verify anything | Import the new `ca.pem` there, then reissue the GUI leaf as in *The pfSense GUI's leaf* |
| The monitoring host's own OS store | **Not imported.** Checked 2026-09-19: nothing under `/usr/local/share/ca-certificates/` and no match in the system bundle | Nothing |
| The Grafana image renderer | **Does not trust it** and cannot — Chromium reads NSS, not `SSL_CERT_FILE`; it ignores certificate errors instead ([`compose.yaml`](../../stacks/observability/compose.yaml), the renderer's `BROWSER_FLAGS`) | Nothing |
| Household devices, phones | **Only those that read the wiki, and none yet.** Until 2026-10-07 this row said *never*: the estate's CA was the operator's alone. [ADR-0082](../adr/0082-serve-the-wiki-over-tls-and-deploy-it-from-a-verified-checkout.md) put the wiki behind a leaf from it, so a phone that reads the wiki trusts this root as well as the tier's. Add a row per device when it is installed; none had been on the day this was written | Re-install the profile on every phone listed, and on iOS re-enable full trust |
Expand Down Expand Up @@ -223,8 +224,10 @@ verifies the same chain on its scrape.

## Management console certificates

Four consoles serve self-signed certificates that this CA never issued, and
the blackbox probes above cannot reach any of them: each answers Hicks only.
Four consoles serve certificates the blackbox probes above cannot reach: each
answers Hicks only. Three are self-signed. The pfSense GUI's has been a leaf
from this CA since 2026-11-23, `morpheus-ui.matrix.elysium` (see *The pfSense
GUI's leaf* below).
`scripts/collect-cert-expiry.sh` reads each one's expiry off a handshake made
inside its own segment and writes `homelab_cert_expiry_timestamp_seconds`;
`ManagementCertificateExpiringSoon` warns at 30 days and
Expand All @@ -234,7 +237,7 @@ inside its own segment and writes `homelab_cert_expiry_timestamp_seconds`;

| `endpoint` | Console | Read by | Reissue |
| --- | --- | --- | --- |
| `pfsense-ui` | pfSense GUI on `morpheus` | `make gateway-state` on the monitoring host, over its ssh, every 15 minutes | `pfSsh.php playback generateguicert` in the firewall's shell. That is how the 2026-09-28 regeneration was done, and it gives 398 days, so the 2027-04-16 expiry recurs |
| `pfsense-ui` | pfSense GUI on `morpheus` | `make gateway-state` on the monitoring host, over its ssh, every 15 minutes | A leaf from this CA, 825 days, due 2029-02-25: *The pfSense GUI's leaf* below. Until 2026-11-23 it was pfSense's own self-signed certificate, 398 days, regenerated with `pfSsh.php playback generateguicert` |
| `pve-ui` | Proxmox UI on `Saruman`, `:8006` | `homelab-cert-expiry.timer` on Saruman, daily | `pvecm updatecerts --force`, then `systemctl restart pveproxy`, at Saruman's console |
| `ilo-ui` | iLO on `shiva`, `10.0.30.10` | the same timer on Saruman, which shares its segment | The iLO's own UI: **Administration → Security → SSL Certificate** |
| `truenas-ui` | TrueNAS UI on `smaug` | a root cron job on smaug ([`build-the-nas.md`](build-the-nas.md) §6.10), daily | **Credentials → Certificates**, then select it under **System → General → GUI** |
Expand All @@ -257,6 +260,77 @@ A console whose certificate cannot be read raises
`ManagementCertificateUnchecked` after six hours rather than going silent. Run
the collector with `--print` to see which probe failed.

### The pfSense GUI's leaf

The GUI serves `morpheus-ui.matrix.elysium`, with SANs for
`morpheus.matrix.elysium`, `10.0.99.1` (Hicks) and `10.7.7.1` (the LAN's
anti-lockout way in). It has its own name because `morpheus.matrix.elysium`
is already taken: that file is the syslog client leaf, and reissuing over it
would break log shipping. pfSense keeps the leaf and its key in `config.xml`,
beside the estate CA it imported as *Matrix Elysium Internal CA (estate)*, so a
config restore brings both back. Browsers on the Mac still warn, because
nothing there trusts this CA (§4).

To reissue, from the main checkout on the monitoring host:

```bash
make certs ARGS="--host morpheus-ui.matrix.elysium --dns morpheus.matrix.elysium --ip 10.0.99.1 --ip 10.7.7.1 --force"
ssh root@10.0.99.1 'install -d -m 700 /root/guicert'
scp certificates/ca.pem certificates/morpheus-ui.matrix.elysium.pem \
certificates/morpheus-ui.matrix.elysium-key.pem root@10.0.99.1:/root/guicert/
```

Then import it and point the GUI at it, in the firewall's shell. The script
reads the files and prints only reference ids, so the key never reaches a
screen:

```bash
ssh root@10.0.99.1 'cat > /root/guicert/import.php' <<'EOF'
<?php
require_once("config.inc");
require_once("certs.inc");
$d = "/root/guicert/";
$cert = array("refid" => uniqid(), "descr" => "morpheus GUI (estate CA leaf) " . date("Y-m-d"));
cert_import($cert, file_get_contents($d . "morpheus-ui.matrix.elysium.pem"),
file_get_contents($d . "morpheus-ui.matrix.elysium-key.pem"));
$certs = config_get_path("cert", []);
$certs[] = $cert;
config_set_path("cert", $certs);
config_set_path("system/webgui/ssl-certref", $cert["refid"]);
write_config("GUI certificate: reissued estate-CA leaf");
echo "cert ", $cert["refid"], " caref=", ($cert["caref"] ?? "-"), "\n";
EOF
ssh root@10.0.99.1 'php -f /root/guicert/import.php && /etc/rc.restart_webgui'
```

`caref` should name the CA entry. If it prints `-`, the CA in the manager is
not the one that signed the leaf: import `ca.pem` first with `ca_import()`,
which is what the first install did. The previous leaf stays in the manager;
delete it in **System → Certificates** once the new one is served.

Then delete the staged copies, and check what is served from the firewall
itself, since the GUI is closed to the monitoring host:

```bash
ssh root@10.0.99.1 'rm /root/guicert/* && rmdir /root/guicert'
```

This deletes; it does not overwrite. `rm -P` has been a no-op since FreeBSD
13, and `morpheus`'s root is ZFS, which is copy-on-write, so no overwrite
would reach the old blocks anyway. That leaves no exposure the firewall does
not already carry: pfSense stores the same key in `config.xml` on the same
disk, which is what the root-only directory and the encrypted backups are
for.

```bash
ssh root@10.0.99.1 'echo | openssl s_client -connect 10.0.99.1:443 2>/dev/null | openssl x509 -noout -issuer -enddate'
```

The first install, on 2026-11-23, ran the same script with a `ca_import()`
of `ca.pem` ahead of it. The self-signed *GUI default* is still in the
certificate manager, as the rollback: select it under **System → Advanced → Admin Access → SSL/TLS
Certificate**.

## If something goes wrong

| Symptom | Cause | Fix |
Expand Down
Loading