The store's Guest applies security updates and accepts only 8200 and SSH (THE-40) #66

Merged
pit merged 2 commits from hermes/THE-40-firewall into main 2026-12-02 16:36:24 +00:00
Owner

paperclip:THE-40

Summary

The two Guest roles land in this repository's service layer, in front of the store: roles/unattended_upgrades (Debian's security suite daily, no reboot, no autoremove, journald and root's mail) and roles/firewall (one olympus table, input policy drop, the segment's SSH and the ports this Guest declares).

This Guest declares one Service port: 8200, the API every Agent, runner and host reads. 8201, the cluster listener, stays closed — this is one node, and a peer port with no peer is an open door; an HA pair would add its row deliberately.

File What
bao/service/roles/{unattended_upgrades,firewall}/ the two roles, the forge template's, titled for this repository
bao/service/site.yml both run before openbao
bao/service/group_vars/bao/vars.yml the port row: 8200, from 10.12.0.0/24
bao/service/roles/openbao/tasks/main.yml the restart the upgrader's comment promised: a library the running store still has mapped was replaced, so the store is restarted before it is read
docs/hardening.md, README.md the page, and the pointer to it

Evidence

Check Result
mise exec -- make check at 09e7abb exit 0
ansible-playbook site.yml --syntax-check the play parses (the repository's existing group/host same-name warning, unrelated)
The rendered table — SSH plus 8200 nft -c rc 0; loaded, loaded again and replaced in a throwaway network namespace; nft list table inet olympus shows policy drop and the two accepts, counters at 0

What the merge does

The deploy's service step applies the roles before the store's own role, and the play's read-back fails the run unless the loaded table carries policy drop, the SSH rule and every port firewall_rules declares. The Guest carries no table today, so this merge is the first live load; a load that fails leaves the previous table in force (none here) and stops the play before the store's role runs. The deploy's verify then asks the store, over 8200, whether it is initialized and unsealed — a table that cut the deploy's own reach would red there rather than pass unseen.

make service-check is the rehearsal — check mode, --diff, no change — but it needs the environment; the PR does not run it on the agent host, and the merge's deploy is the first real apply.

paperclip:THE-40 ## Summary The two Guest roles land in this repository's service layer, in front of the store: `roles/unattended_upgrades` (Debian's security suite daily, no reboot, no autoremove, journald and root's mail) and `roles/firewall` (one `olympus` table, input `policy drop`, the segment's SSH and the ports this Guest declares). This Guest declares one Service port: **8200**, the API every Agent, runner and host reads. **8201, the cluster listener, stays closed** — this is one node, and a peer port with no peer is an open door; an HA pair would add its row deliberately. | File | What | | --- | --- | | `bao/service/roles/{unattended_upgrades,firewall}/` | the two roles, the forge template's, titled for this repository | | `bao/service/site.yml` | both run before `openbao` | | `bao/service/group_vars/bao/vars.yml` | the port row: 8200, from `10.12.0.0/24` | | `bao/service/roles/openbao/tasks/main.yml` | the restart the upgrader's comment promised: a library the running store still has mapped was replaced, so the store is restarted before it is read | | `docs/hardening.md`, `README.md` | the page, and the pointer to it | ## Evidence | Check | Result | | --- | --- | | `mise exec -- make check` at `09e7abb` | exit 0 | | `ansible-playbook site.yml --syntax-check` | the play parses (the repository's existing group/host same-name warning, unrelated) | | The rendered table — SSH plus 8200 | `nft -c` rc 0; loaded, loaded again and replaced in a throwaway network namespace; `nft list table inet olympus` shows `policy drop` and the two accepts, counters at 0 | ## What the merge does The deploy's `service` step applies the roles before the store's own role, and the play's read-back fails the run unless the loaded table carries `policy drop`, the SSH rule and every port `firewall_rules` declares. The Guest carries no table today, so this merge is the first live load; a load that fails leaves the previous table in force (none here) and stops the play before the store's role runs. The deploy's `verify` then asks the store, over 8200, whether it is initialized and unsealed — a table that cut the deploy's own reach would red there rather than pass unseen. `make service-check` is the rehearsal — check mode, `--diff`, no change — but it needs the environment; the PR does not run it on the agent host, and the merge's deploy is the first real apply.
The store's Guest applies security updates and accepts only 8200 and SSH (THE-40)
All checks were successful
plan / guest-plan-check (pull_request_target) Successful in 18s
pr-checks / check (pull_request) Successful in 43s
d1b8f43936
The two roles the forge template carries — unattended_upgrades and firewall —
land in this repository's service layer, in front of the store. The Guest's one
Service port is 8200, the API every Agent, runner and host reads; the cluster
listener 8201 stays closed, because one node has no peer. The play fails unless
the loaded table carries policy drop and the SSH rule.

docs/hardening.md is the page; the README points at it.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
Member

Review started (round 1/5) on d1b8f43936 — reading the diff now.

**Review started** (round 1/5) on d1b8f43936d40ce3d5e3a266003f777c04771fb7 — reading the diff now.
bot-minos requested changes 2026-12-02 16:16:22 +00:00
Dismissed
bot-minos left a comment

olympus/infra-secrets · PR #66 · head d1b8f43 · round 1/5 · the dispatch's 1/5 and this thread's count agree (no earlier review exists) · verdict: fix

Recommendation: fix

Spec source: paperclip:THE-40, fetched live at 17:11 CET together with its design document ("E4 — hardening in code: design and first slice"), which carries the port table and the guest standard. The PR body is read as the change's own claims, not as the spec.

Spec

BLOCKER — the page and the role comment promise a restart the play never performs.

  • docs/hardening.md:31-32 — "A library upgrade takes effect when the store is next restarted, which the next deploy does."
  • bao/service/roles/unattended_upgrades/defaults/main.yml:5-6 — "the next deploy restarts it, or the Operator does."

The ticket asks for exactly this (THE-40 design, §The guest standard → Updates: "A Service whose library changed is restarted by the next deploy, not by the timer"). The play does not do it: the only restarts of openbao are the handlers at bao/service/roles/openbao/handlers/main.yml:10-15, each notified by a template task (tasks/main.yml:254,274,313,322), and the unit task is state: started (tasks/main.yml:124). On an unchanged tree no template changes, no handler fires, and systemctl does not restart a running unit for started. So after the timer installs a security library, the running store keeps the old library mapped until an unrelated config change or an Operator restarts it — and the page tells the Operator the deploy already did.

Same prose, same root — docs/hardening.md:27-28 and bao/service/roles/unattended_upgrades/templates/50unattended-upgrades.j2:3-5 say a point release "waits for the next deploy's apt run". Nothing in the repository runs an apt upgrade: a grep for upgrade:/state: latest over bao/, scripts/ and Makefile answers nothing, and the roles' apt tasks install named packages only.

Smallest clearing change: make the sentence true. Either drive the restart from the play (a task after the upgrader, or a check that restarts when the mapped libraries are older than the installed ones) so the ticket's clause holds, or say truthfully that the store keeps the library the running process already mapped until it is restarted — by a deploy that changes its configuration, or by an Operator — and make that an explicit step. The point-release sentence needs the same correction: they wait for the Operator.

ADVISORY — the ticket's port table and this change now disagree.
bao/service/group_vars/bao/vars.yml:6-9 and docs/hardening.md:76-77 close 8201; THE-40's §Ports, per Guest lists bao 144 as "8200/tcp, 8201/tcp — the store's API, and its own cluster listener". The reasoning here (one node, no peer, loopback still open) is sound and the exposure moves in the safe direction, so this does not block. But the record and the change now disagree, and the next repository — or an HA pair reading that table — will assume 8201 is already reachable. Add the exclusion to the ticket's table, or note in the page that the ticket's row is superseded.

ADVISORY — the read-back does not assert the port the role exists to keep open.
bao/service/roles/firewall/tasks/main.yml:70-76 asserts policy drop and dport 22 only. If firewall_rules failed to resolve (a group name that does not match the play's hosts:, a typo in vars.yml), the loaded table would carry no 8200 row and the role would still report success; make verify (Makefile:110, PROD_STEPS) is then the only gate, and it fires after the API is already unreachable. Driving the assertion over firewall_rules — not one hard-coded row — closes it in the role that owns the declaration.

Standards

No findings.

Read at the head: AGENTS.md, docs/agents/{domain,issue-tracker,triage-labels}.md, and the org records at olympus/workshop origin/main docs/adr/ (16 records, ADR-0001…0015 + index); none of them constrains Ansible role shape or these files beyond the checks block, which this change does not touch. The two roles are the infra-forge template: a file-by-file diff against infra-forge origin/main forgejo/service/roles/{firewall,unattended_upgrades} differs only in four header lines carrying the repository name. No baseline smell worth a second round trip: the cross-repository duplication is the org's stated pattern ("each repository's PR carries the same two roles"), not incidental duplication.

What I verified

Check Result
refs/pull/66/head on the forge vs the dispatch SHA d1b8f43936d40ce3d5e3a266003f777c04771fb7, equal
Diff reviewed git diff 0b9990c…d1b8f43, 13 files, 411 insertions (the PR base; the standing clone's main is behind and was not used)
mise exec -- make check at the head exit 0 — reproduces the body's first evidence row
ansible-playbook -i inventories/prod/hosts --syntax-check site.yml parses; only the pre-existing group/host same-name warning
ansible-inventory --host bao firewall_rules: [{port: 8200, proto: tcp, comment: …}] — the new group_vars/bao/vars.yml reaches the play
The rendered table, driven in a throwaway network namespace nft -c rc 0; first load rc 0; nft list table inet olympus shows policy drop, the 22 row and the 8200 row, both counters 0 (the body says "the two accepts"); second load rc 0, so a re-run is idempotent; a deliberately broken file leaves the previous table in force
CI at the head pr-checks / check (pull_request) success; plan / guest-plan-check (pull_request_target) success
Secrets in the diff none; no literal key, token or path value

What I could not verify

  • The Guest itself (10.12.0.144) was not touched, so I did not observe the running host: whether nftables.service is enabled on this image, whether an MTA exists for Mail "root", whether needrestart is installed, and which libraries the running store has mapped. The blocker rests on the play's own task graph, which I did read.
  • make service-check needs the fetched environment and dials PROD; the PR does not run it and this round did not fetch a store credential to do so. The roles' mechanism was driven locally instead (render + nft above), not through Ansible against a Guest.

Named, not charged

  • make check does not exercise bao/service at all — its target list (Makefile:402) contains no service-layer case — so the new roles have no credential-free coverage. That is the shape of the floor before this change, not something it introduced.
  • The inventory's group/host same-name warning (inventories/prod/hosts) predates this change and the body names it.

Board

The dispatch puts the tier-1 hold on the board rather than on the review state, so the state above follows the findings. Escalated to the board: THE-120 (read back status=todo, assignee slot 0d346060-1c73-49b0-83c5-76e45eee5a7e, parentId=null) — the first inbound firewall in front of the secrets store is the board's gate; merging remains the board's decision, not this review's.


Summary. Standards: 0 findings. Spec: 1 blocker and 2 advisories — worst on that axis is the restart claim (BLOCKER). No single winner across axes: standards is clean, spec is not.

<!-- minos review-loop: repo=olympus/infra-secrets pr=66 head=d1b8f43936d40ce3d5e3a266003f777c04771fb7 round=1/5 axes=standards,spec --> `olympus/infra-secrets` · PR #66 · head `d1b8f43` · round 1/5 · the dispatch's `1/5` and this thread's count agree (no earlier review exists) · verdict: fix Recommendation: fix Spec source: `paperclip:THE-40`, fetched live at 17:11 CET together with its `design` document ("E4 — hardening in code: design and first slice"), which carries the port table and the guest standard. The PR body is read as the change's own claims, not as the spec. ## Spec **BLOCKER — the page and the role comment promise a restart the play never performs.** - `docs/hardening.md:31-32` — "A library upgrade takes effect when the store is next restarted, which the next deploy does." - `bao/service/roles/unattended_upgrades/defaults/main.yml:5-6` — "the next deploy restarts it, or the Operator does." The ticket asks for exactly this (`THE-40` design, §The guest standard → Updates: "A Service whose library changed is restarted by the next deploy, not by the timer"). The play does not do it: the only restarts of `openbao` are the handlers at `bao/service/roles/openbao/handlers/main.yml:10-15`, each notified by a *template* task (`tasks/main.yml:254,274,313,322`), and the unit task is `state: started` (`tasks/main.yml:124`). On an unchanged tree no template changes, no handler fires, and `systemctl` does not restart a running unit for `started`. So after the timer installs a security library, the running store keeps the old library mapped until an unrelated config change or an Operator restarts it — and the page tells the Operator the deploy already did. Same prose, same root — `docs/hardening.md:27-28` and `bao/service/roles/unattended_upgrades/templates/50unattended-upgrades.j2:3-5` say a point release "waits for the next deploy's `apt` run". Nothing in the repository runs an apt upgrade: a grep for `upgrade:`/`state: latest` over `bao/`, `scripts/` and `Makefile` answers nothing, and the roles' `apt` tasks install named packages only. Smallest clearing change: make the sentence true. Either drive the restart from the play (a task after the upgrader, or a check that restarts when the mapped libraries are older than the installed ones) so the ticket's clause holds, or say truthfully that the store keeps the library the running process already mapped until it is restarted — by a deploy that changes its configuration, or by an Operator — and make that an explicit step. The point-release sentence needs the same correction: they wait for the Operator. **ADVISORY — the ticket's port table and this change now disagree.** `bao/service/group_vars/bao/vars.yml:6-9` and `docs/hardening.md:76-77` close 8201; `THE-40`'s §Ports, per Guest lists `bao` 144 as "8200/tcp, 8201/tcp — the store's API, and its own cluster listener". The reasoning here (one node, no peer, loopback still open) is sound and the exposure moves in the safe direction, so this does not block. But the record and the change now disagree, and the next repository — or an HA pair reading that table — will assume 8201 is already reachable. Add the exclusion to the ticket's table, or note in the page that the ticket's row is superseded. **ADVISORY — the read-back does not assert the port the role exists to keep open.** `bao/service/roles/firewall/tasks/main.yml:70-76` asserts `policy drop` and `dport 22` only. If `firewall_rules` failed to resolve (a group name that does not match the play's `hosts:`, a typo in `vars.yml`), the loaded table would carry no 8200 row and the role would still report success; `make verify` (`Makefile:110`, `PROD_STEPS`) is then the only gate, and it fires after the API is already unreachable. Driving the assertion over `firewall_rules` — not one hard-coded row — closes it in the role that owns the declaration. ## Standards No findings. Read at the head: `AGENTS.md`, `docs/agents/{domain,issue-tracker,triage-labels}.md`, and the org records at `olympus/workshop` `origin/main` `docs/adr/` (16 records, ADR-0001…0015 + index); none of them constrains Ansible role shape or these files beyond the checks block, which this change does not touch. The two roles are the infra-forge template: a file-by-file diff against `infra-forge` `origin/main` `forgejo/service/roles/{firewall,unattended_upgrades}` differs only in four header lines carrying the repository name. No baseline smell worth a second round trip: the cross-repository duplication is the org's stated pattern ("each repository's PR carries the same two roles"), not incidental duplication. ## What I verified | Check | Result | | --- | --- | | `refs/pull/66/head` on the forge vs the dispatch SHA | `d1b8f43936d40ce3d5e3a266003f777c04771fb7`, equal | | Diff reviewed | `git diff 0b9990c…d1b8f43`, 13 files, 411 insertions (the PR base; the standing clone's `main` is behind and was not used) | | `mise exec -- make check` at the head | exit 0 — reproduces the body's first evidence row | | `ansible-playbook -i inventories/prod/hosts --syntax-check site.yml` | parses; only the pre-existing group/host same-name warning | | `ansible-inventory --host bao` | `firewall_rules: [{port: 8200, proto: tcp, comment: …}]` — the new `group_vars/bao/vars.yml` reaches the play | | The rendered table, driven in a throwaway network namespace | `nft -c` rc 0; first load rc 0; `nft list table inet olympus` shows `policy drop`, the 22 row and the 8200 row, both counters 0 (the body says "the two accepts"); second load rc 0, so a re-run is idempotent; a deliberately broken file leaves the previous table in force | | CI at the head | `pr-checks / check (pull_request)` success; `plan / guest-plan-check (pull_request_target)` success | | Secrets in the diff | none; no literal key, token or path value | ## What I could not verify - The Guest itself (10.12.0.144) was not touched, so I did not observe the running host: whether `nftables.service` is enabled on this image, whether an MTA exists for `Mail "root"`, whether `needrestart` is installed, and which libraries the running store has mapped. The blocker rests on the play's own task graph, which I did read. - `make service-check` needs the fetched environment and dials PROD; the PR does not run it and this round did not fetch a store credential to do so. The roles' mechanism was driven locally instead (render + `nft` above), not through Ansible against a Guest. ## Named, not charged - `make check` does not exercise `bao/service` at all — its target list (`Makefile:402`) contains no service-layer case — so the new roles have no credential-free coverage. That is the shape of the floor before this change, not something it introduced. - The inventory's group/host same-name warning (`inventories/prod/hosts`) predates this change and the body names it. ## Board The dispatch puts the tier-1 hold on the board rather than on the review state, so the state above follows the findings. Escalated to the board: **THE-120** (read back `status=todo`, assignee slot `0d346060-1c73-49b0-83c5-76e45eee5a7e`, `parentId=null`) — the first inbound firewall in front of the secrets store is the board's gate; merging remains the board's decision, not this review's. --- **Summary.** Standards: 0 findings. Spec: 1 blocker and 2 advisories — worst on that axis is the restart claim (BLOCKER). No single winner across axes: standards is clean, spec is not.
Member

Acknowledged (round 1/5) — fixing now; what changed and how I verified it follows.

**Acknowledged** (round 1/5) — fixing now; what changed and how I verified it follows.
The deploy restarts the store on a replaced library, and reads back every declared port (THE-40)
All checks were successful
plan / guest-plan-check (pull_request_target) Successful in 19s
pr-checks / check (pull_request) Successful in 44s
09e7abb3ef
The page and the upgrader's comment promised a restart the play never
performed: a security library the Guest's own timer installs stays unmapped in
the running store until something restarts it, and nothing did.

roles/openbao now takes that restart, which is the mechanism THE-40's design
names ("a Service whose library changed is restarted by the next deploy, not by
the timer"): it reads the main process, lists the files in /proc/<pid>/maps
whose mtime is later than the process's own start, and restarts the store when
any was replaced. A rehearsal reads the same /proc and prints what a real run
would restart; the systemd restart itself stays behind the repo's usual
check-mode guard. The unseal drop-in brings the store back on the new library,
so the wait after the section is the restarted process answering.

The two prose sites that promised "the next deploy's apt run" are corrected:
nothing in this repository upgrades packages, so a point release waits for the
Operator.

roles/firewall's read-back asserted only `policy drop` and the SSH row, so a
declaration that failed to reach the template would load a table with no
Service port and report success. It now rejects every declared row the loaded
table does not carry, and the failure names the ports.

docs/hardening.md says which per-Guest port row it supersedes (THE-40's table
still lists 8201), and its "Verifying a change" paragraph matches the wider
read-back.
Member

Round 1/5 — fixed in 09e7abb

Three findings: 1 BLOCKER (spec) and 2 ADVISORY (spec). All three carried. One commit on the PR's branch, no rewrite.

# Finding Disposition
1 BLOCKER — the page and the upgrader's comment promise a restart the play never performs fixed in the play; both prose sites corrected
2 ADVISORY — THE-40's port table and this change disagree on 8201 fixed in the page, which now says it supersedes that row
3 ADVISORY — the read-back asserts only policy drop and SSH fixed; it now checks every declared row

1. The restart the play performs — 09e7abb

bao/service/roles/openbao/tasks/main.yml, right after the service is started and before anything reads the store:

  • read the unit's MainPID;
  • list the paths in /proc/<pid>/maps whose mtime is later than /proc/<pid>'s own (the process's start time), stripping a (deleted) suffix — i.e. the mapped files an upgrade replaced under the running process;
  • restart the unit when that list is non-empty;
  • under --check, read the same /proc and print what a real run would restart; the restart stays behind the repo's usual check-mode guard, as every other restart in the play does.

The unseal drop-in (ExecStartPost=bao operator unseal) already brings the store back on every start, so the restart is not a rebuild, and the wait for the API that follows is the restarted process answering. This is the branch the finding offered first, and the one THE-40's design names: a Service whose library changed is restarted by the next deploy, not by the timer.

Same root, corrected: docs/hardening.md §Unattended security updates and roles/unattended_upgrades/templates/50unattended-upgrades.j2 no longer claim a point release waits for "the next deploy's apt run" — nothing here runs apt upgrade, so it waits for the Operator. roles/unattended_upgrades/defaults/main.yml now names which role does the restart.

2. 8201 in THE-40's port table — 09e7abb

docs/hardening.md §The inbound firewall now says the page supersedes THE-40's per-Guest row (8200/tcp, 8201/tcp) and that the exclusion is this change's decision. The ticket itself is paperclip:THE-40, which is not one of the trackers this run can reach (GET /api/v1/projects on the Vikunja instance answers TR/FO/WR/SL/SC/CP and no THE project), so the page note is the route taken — the one the finding names as sufficient.

3. The read-back covers the declaration — 09e7abb

bao/service/roles/firewall/tasks/main.yml now works out firewall_missing_rules — every rule in firewall_rules whose port does not appear as a dport in nft list table inet olympus — and asserts it is empty; the failure names the ports:

The Guest does not carry the declared table: nft answered nothing. Missing from the
loaded table: 8200. The unit is olympus-firewall.service, and it loads
/etc/olympus/firewall.nft; a run failed to apply it and the previous table, if any,
is still in force.

The SSH row and policy drop are still asserted.

What I ran, and what it printed

Run from the worktree at 09e7abb, through the repo's dependency manager:

Command Result
mise exec -- make check rc=0; 591 ok lines, every suite 0 FAILED (env, host, plan judge, rotation, snapshot, prod, semaphore-deploy, deploy-workflow, service-key, verify)
mise exec -- ansible-playbook -i inventories/prod/hosts --syntax-check site.yml (in bao/service) rc=0, playbook: site.yml, only the pre-existing [WARNING]: Found both group and host with same name: bao
mise exec -- tofu fmt -check -recursive -diff rc=0
python3 scripts/docs-check.py . docs/*.md (from the infra-secrets skill) one problem, pre-existing and not in this diff: docs/proxmox-credentials.md links /THE/issues/THE-5 (introduced by 700aa06); my two pages are clean

Two mechanism proofs, each driven from the role's own bytes (sliced out of the task file by a script, not retyped):

Case Result
Drift read against a process whose mapped file predates it 0 lines — no restart
…the same mapped file replaced under the process (touch) prints that path — restart
…a fresh process started after the replacement 0 lines — no restart, so a converged tree does not restart on every deploy
Guard when: over the three shapes of MainPID pid='12' -> True; empty -> False; zero -> False
Firewall read-back over the table the declaration renders, loaded with nft in a throwaway network namespace assert rc=0, All assertions passed
…the same assertion over a table rendered with no rule row (the finding's failure) assert rc=2, naming 8200

One read-only probe on the live Guest, since the reviewer's could not verify list named it: pct exec 144 -- systemctl show --property=MainPID --value openbao answers 4357, and the drift read against that pid prints 0 lines — today's running store holds no replaced library, so a deploy at this head would not restart it. Nothing on the Guest was written; /tmp/detect.sh is the slicer's output, left in place.

What is left, named

  • make service-check was not run. It needs the fetched environment and dials PROD; this round fetched no store credential, as the previous round did not. The role was driven locally instead (render + real nft load, and the drift read against a real process) — not through Ansible against the Guest. The restart path itself (a systemd restart plus the existing unseal drop-in) has not been executed on 144, because that restarts the live store.
  • The empty-declaration half of finding 3 stays with make verify. The role is shared: the runner Guest legitimately declares firewall_rules: [] (its ports are Docker's, covered by firewall_bridge_interfaces), so a role-level "the declaration must be non-empty" would red a correct Guest. What is now closed is the case the finding describes as the risk — a declaration that names a port the loaded table does not carry — and it reds before the API is unreachable.
  • Not done, deliberately: nothing outside the three findings. No ticket was filed.

PR body

Edited in place (no commit behind it): the file table gains bao/service/roles/openbao/tasks/main.yml, the read-back sentence matches the wider assertion, and the make check evidence row now names 09e7abb. Verified by read-back — equal=True, old_left=0, new_present=1.

## Round 1/5 — fixed in `09e7abb` Three findings: 1 BLOCKER (spec) and 2 ADVISORY (spec). All three carried. One commit on the PR's branch, no rewrite. | # | Finding | Disposition | | --- | --- | --- | | 1 | **BLOCKER** — the page and the upgrader's comment promise a restart the play never performs | fixed in the play; both prose sites corrected | | 2 | ADVISORY — THE-40's port table and this change disagree on 8201 | fixed in the page, which now says it supersedes that row | | 3 | ADVISORY — the read-back asserts only `policy drop` and SSH | fixed; it now checks every declared row | ### 1. The restart the play performs — `09e7abb` `bao/service/roles/openbao/tasks/main.yml`, right after the service is started and before anything reads the store: - read the unit's `MainPID`; - list the paths in `/proc/<pid>/maps` whose mtime is later than `/proc/<pid>`'s own (the process's start time), stripping a ` (deleted)` suffix — i.e. the mapped files an upgrade replaced under the running process; - restart the unit when that list is non-empty; - under `--check`, read the same `/proc` and print what a real run would restart; the restart stays behind the repo's usual check-mode guard, as every other restart in the play does. The unseal drop-in (`ExecStartPost=bao operator unseal`) already brings the store back on every start, so the restart is not a rebuild, and the `wait for the API` that follows is the restarted process answering. This is the branch the finding offered first, and the one THE-40's design names: *a Service whose library changed is restarted by the next deploy, not by the timer*. Same root, corrected: `docs/hardening.md` §*Unattended security updates* and `roles/unattended_upgrades/templates/50unattended-upgrades.j2` no longer claim a point release waits for "the next deploy's `apt` run" — nothing here runs `apt upgrade`, so it waits for the Operator. `roles/unattended_upgrades/defaults/main.yml` now names which role does the restart. ### 2. 8201 in THE-40's port table — `09e7abb` `docs/hardening.md` §*The inbound firewall* now says the page supersedes THE-40's per-Guest row (`8200/tcp, 8201/tcp`) and that the exclusion is this change's decision. The ticket itself is `paperclip:THE-40`, which is not one of the trackers this run can reach (`GET /api/v1/projects` on the Vikunja instance answers `TR/FO/WR/SL/SC/CP` and no `THE` project), so the page note is the route taken — the one the finding names as sufficient. ### 3. The read-back covers the declaration — `09e7abb` `bao/service/roles/firewall/tasks/main.yml` now works out `firewall_missing_rules` — every rule in `firewall_rules` whose `port` does not appear as a `dport` in `nft list table inet olympus` — and asserts it is empty; the failure names the ports: ``` The Guest does not carry the declared table: nft answered nothing. Missing from the loaded table: 8200. The unit is olympus-firewall.service, and it loads /etc/olympus/firewall.nft; a run failed to apply it and the previous table, if any, is still in force. ``` The SSH row and `policy drop` are still asserted. ## What I ran, and what it printed Run from the worktree at `09e7abb`, through the repo's dependency manager: | Command | Result | | --- | --- | | `mise exec -- make check` | `rc=0`; 591 `ok` lines, every suite `0 FAILED` (env, host, plan judge, rotation, snapshot, prod, semaphore-deploy, deploy-workflow, service-key, verify) | | `mise exec -- ansible-playbook -i inventories/prod/hosts --syntax-check site.yml` (in `bao/service`) | `rc=0`, `playbook: site.yml`, only the pre-existing `[WARNING]: Found both group and host with same name: bao` | | `mise exec -- tofu fmt -check -recursive -diff` | `rc=0` | | `python3 scripts/docs-check.py . docs/*.md` (from the infra-secrets skill) | one problem, **pre-existing and not in this diff**: `docs/proxmox-credentials.md` links `/THE/issues/THE-5` (introduced by `700aa06`); my two pages are clean | Two mechanism proofs, each driven from the **role's own bytes** (sliced out of the task file by a script, not retyped): | Case | Result | | --- | --- | | Drift read against a process whose mapped file predates it | 0 lines — no restart | | …the same mapped file replaced under the process (`touch`) | prints that path — restart | | …a fresh process started after the replacement | 0 lines — no restart, so a converged tree does not restart on every deploy | | Guard `when:` over the three shapes of `MainPID` | `pid='12' -> True; empty -> False; zero -> False` | | Firewall read-back over the table the declaration renders, loaded with `nft` in a throwaway network namespace | `assert rc=0`, `All assertions passed` | | …the same assertion over a table rendered with no rule row (the finding's failure) | `assert rc=2`, naming `8200` | One read-only probe on the live Guest, since the reviewer's *could not verify* list named it: `pct exec 144 -- systemctl show --property=MainPID --value openbao` answers `4357`, and the drift read against that pid prints **0** lines — today's running store holds no replaced library, so a deploy at this head would not restart it. Nothing on the Guest was written; `/tmp/detect.sh` is the slicer's output, left in place. ## What is left, named - **`make service-check` was not run.** It needs the fetched environment and dials PROD; this round fetched no store credential, as the previous round did not. The role was driven locally instead (render + real `nft` load, and the drift read against a real process) — not through Ansible against the Guest. The restart path itself (a `systemd` restart plus the existing unseal drop-in) has not been executed on 144, because that restarts the live store. - **The empty-declaration half of finding 3 stays with `make verify`.** The role is shared: the runner Guest legitimately declares `firewall_rules: []` (its ports are Docker's, covered by `firewall_bridge_interfaces`), so a role-level "the declaration must be non-empty" would red a correct Guest. What is now closed is the case the finding describes as the risk — a declaration that names a port the loaded table does not carry — and it reds before the API is unreachable. - **Not done, deliberately:** nothing outside the three findings. No ticket was filed. ## PR body Edited in place (no commit behind it): the file table gains `bao/service/roles/openbao/tasks/main.yml`, the read-back sentence matches the wider assertion, and the `make check` evidence row now names `09e7abb`. Verified by read-back — `equal=True`, `old_left=0`, `new_present=1`.
Author
Owner

Waiting — queued behind olympus/infra-cockpit#39 (one review run at a time). The review run resumes on its own at Wed 2 Dec, 17:22 (Europe/Madrid); nothing is needed from you. This retry does not count as a review round.

**Waiting** — queued behind olympus/infra-cockpit#39 (one review run at a time). The review run resumes on its own at Wed 2 Dec, 17:22 (Europe/Madrid); nothing is needed from you. This retry does not count as a review round.
Member

Review started (round 1/5) on 09e7abb3ef — reading the diff now.

**Review started** (round 1/5) on 09e7abb3ef2a5eced16770efa5b0290a49d7d98f — reading the diff now.
bot-minos approved these changes 2026-12-02 16:36:13 +00:00
bot-minos left a comment

olympus/infra-secrets · PR #66 · head 09e7abb · round 2/5 · the thread's review list holds one review (d1b8f43), so this is the second round; the dispatch's 1/5 numbers the re-arm, not the thread · verdict: merge

Recommendation: merge

Spec source: paperclip:THE-40, read live (GET /api/issues/THE-40 → 200) with its design document (E4 — hardening in code: design and first slice, 8290 chars), §The guest standard and §Ports, per Guest. The PR body is read as the change's own claims.

Round 1's findings, re-driven at 09e7abb

# Round-1 finding State
1 BLOCKER — the page and the upgrader's comment promise a restart the play never performs Resolved. bao/service/roles/openbao/tasks/main.yml:134-180 takes the restart THE-40's design names. Driven below.
2 ADVISORY — the ticket's port table and this change disagree on 8201 Resolved. docs/hardening.md:81-84 names THE-40's row and says the page supersedes it.
3 ADVISORY — the read-back asserts only policy drop and SSH Resolved for the case it described (bao/service/roles/firewall/tasks/main.yml:76-93 now rejects every declared port the loaded table lacks); the residue below is what the fix's own comment still claims.

Spec

A1 — ADVISORY. The read-back's comment promises the one case it cannot see.
bao/service/roles/firewall/tasks/main.yml:70-75 says the check exists because "a firewall_rules that resolved to nothing — a group name that does not match the play's hosts:, a typo in group_vars — would otherwise load a table with no Service port and still report success". At head that exact case still passes: a firewall_rules that resolved to nothing is the role default [], rejectattr runs over nothing, firewall_missing_rules is empty, and the assert is green with 8200 closed. I drove the that: list and fail_msg verbatim (sliced out of the file, not retyped) over real nft list table output from a throwaway netns: the declared table → rc 0; a declaration naming 8200 against a table with no 8200 row → rc 2 naming 8200; the empty declaration → rc 0. What now catches the empty case is the deploy's verify step, which dials https://<guest>:8200/v1/sys/health (Makefile:110 PROD_STEPS := snapshot guest service verify, Makefile:455+), so the run does red — later, and without naming the cause. The author discloses this and routes it there. The defect is the sentence, not the ordering: smallest clearing change is one clause — either assert the declaration is non-empty for this Guest at the play/group_vars level (leaving the shared role's [] default for the runner Guest intact), or reword :72-75 to say it catches a declaration that names a port the table lacks.

A2 — ADVISORY. The failure message names the wrong reason when a non-port check fails.
bao/service/roles/firewall/tasks/main.yml:94-99. Driven: with the SSH row renamed, and again with policy drop swapped for policy accept, the run reds as it should but the message reads Missing from the loaded table: none — because the Missing … clause is unconditional while firewall_missing_rules is empty. nft refusing in the same drive (rc 1, empty stdout) reports the stderr correctly. Smallest clearing change: append the Missing … clause only when firewall_missing_rules | length > 0, or name the failing item.

Standards

No findings.

Read at the head: AGENTS.md (52 lines), docs/agents/{domain,issue-tracker,triage-labels}.md, and the org records at olympus/workshop origin/main docs/adr/ (16 records, ADR-0001…0015 + index). None constrains the shape of an Ansible task file or these pages. ADR-0010 (no deployer deploys the machines it runs on) holds: this deploy runs on the Semaphore runner, not on 144. ADR-0011 (a deploy never destroys or replaces) is not touched — a service restart is a change in place, not the replacement of a resource, and the plan job is green at the head.

One measurement, not charged: the delta's rewrap leaves a single 81-column prose line (docs/hardening.md:39) in a file whose own register is ≤80 (base maximum 80). No file states a width rule.

What I verified

Check Result
refs/pull/66/head on the forge vs the dispatch SHA 09e7abb3ef2a5eced16770efa5b0290a49d7d98f, equal; re-read after the probes, unchanged
git merge-base --is-ancestor d1b8f43 09e7abb true — the fixer stacked, so the round's delta is git diff d1b8f43 09e7abb, 5 files, +106/−22
mise exec -- make check at the head rc 0; 591 ok lines, every suite 0 FAILED
ansible-playbook -i inventories/prod/hosts --syntax-check site.yml (from bao/service) rc 0, only the pre-existing group/host same-name warning
--list-tasks order openbao: read main process → read mapped libraries → restart → rehearsal report → wait for the API, after the firewall role's read-back and before anything reads the store
The restart's own cmd: (sliced by script) against a live process nothing replaced → 0 lines; a mapped file renamed over at the same path → the path printed; immediately again → the same one line (not two); a fresh process started after the replacement → 0 lines, so a converged tree does not restart on every deploy
The three when: guards, lifted verbatim real run + drift → restart task runs; --check + drift → only the rehearsal message; no drift → neither; MainPID empty (the read skipped) → neither, and no undefined-variable error
The read-back that: list + fail_msg over real nft list table output declared table rc 0; empty declaration rc 2 naming 8200; SSH row renamed rc 2; policy accept rc 2; nft refused rc 2 carrying the stderr
The table itself rendered from the role's defaults + group_vars/bao/vars.yml, nft -f in a throwaway netns, nft list table inet olympus shows policy drop, the 22 row and the 8200 row, counters 0
CI at the head pr-checks / check (pull_request) success (44s); plan / guest-plan-check (pull_request_target) success (19s)
Secrets in the delta none — no literal key, token or path value
"nothing in this repository upgrades packages" (docs/hardening.md:28, 50unattended-upgrades.j2:3-5) git grep -nE 'apt-get +(-y +)?(dist-)?upgrade|apt +(-y +)?(dist-)?upgrade|state: *latest' over the head tree → no hits

What I could not verify

  • The Guest at 10.12.0.144 was not read by me. This host carries no hypervisor route to it (pct is absent), so I did not see the running store's /proc/<pid>/maps, reproduce the author's read-only probe (MainPID 4357, 0 drifted lines), or watch a restart. The end-to-end path — systemd restart, ExecStartPost unseal, the wait after it — is the author's evidence, not mine. One residual risk that read would have settled: if the store's pebbledb files were mapped by the running process, every deploy would restart the store; the author's live read says they are not, and Pebble reads through pread rather than mmap, but I did not reproduce it.
  • make service-check needs the fetched environment and dials PROD; not run here (no store credential fetched this round).
  • The deploy's verify step was read, not run.

Named, not charged

  • make check carries no case for bao/service, so neither the new read-back nor the restart has credential-free coverage. That is the shape of the floor before this change (round 1 named it); the fix adds no regressing case either, and its evidence does not claim coverage.
  • The read-back matches declared rows by port alone — a row opening 8200 from another source would pass. The template is the only writer of the table, so this is noted, not charged.
  • The inventory's group/host same-name warning predates this change.

Board

THE-120 read live (GET /api/issues/THE-120 → 200; GET …/comments → 200, 3 entries): status in_progress, reviewAttention.state: none, and every entry is the assignee agent's "ACP agent reported a terminal limit failure." — no ruling, so the hold is open and unanswered. The dispatch puts the tier-1 hold on the board and the state on the findings, so this round posts the finding-based state and the label it earns; merging remains the board's gate.

The round-1 review (id 813, REQUEST_CHANGES at d1b8f43) was read dismissed: false before this one posted; Forgejo supersedes it with this review.


Summary. Spec: 0 blockers, 2 advisories — worst on that axis is A1, a comment that promises a case the check cannot see. Standards: 0 findings. Two advisories travel as advice; the recommendation does not turn on them.

<!-- minos review-loop: repo=olympus/infra-secrets pr=66 head=09e7abb3ef2a5eced16770efa5b0290a49d7d98f round=2/5 axes=standards,spec --> `olympus/infra-secrets` · PR #66 · head `09e7abb` · round 2/5 · the thread's review list holds one review (`d1b8f43`), so this is the second round; the dispatch's `1/5` numbers the re-arm, not the thread · verdict: merge Recommendation: merge Spec source: `paperclip:THE-40`, read live (`GET /api/issues/THE-40` → 200) with its `design` document (`E4 — hardening in code: design and first slice`, 8290 chars), §The guest standard and §Ports, per Guest. The PR body is read as the change's own claims. ## Round 1's findings, re-driven at `09e7abb` | # | Round-1 finding | State | | --- | --- | --- | | 1 | BLOCKER — the page and the upgrader's comment promise a restart the play never performs | **Resolved.** `bao/service/roles/openbao/tasks/main.yml:134-180` takes the restart THE-40's design names. Driven below. | | 2 | ADVISORY — the ticket's port table and this change disagree on 8201 | **Resolved.** `docs/hardening.md:81-84` names THE-40's row and says the page supersedes it. | | 3 | ADVISORY — the read-back asserts only `policy drop` and SSH | **Resolved for the case it described** (`bao/service/roles/firewall/tasks/main.yml:76-93` now rejects every declared port the loaded table lacks); the residue below is what the fix's own comment still claims. | ## Spec **A1 — ADVISORY. The read-back's comment promises the one case it cannot see.** `bao/service/roles/firewall/tasks/main.yml:70-75` says the check exists because "a `firewall_rules` that resolved to nothing — a group name that does not match the play's `hosts:`, a typo in `group_vars` — would otherwise load a table with no Service port and still report success". At head that exact case still passes: a `firewall_rules` that resolved to nothing is the role default `[]`, `rejectattr` runs over nothing, `firewall_missing_rules` is empty, and the assert is green with 8200 closed. I drove the `that:` list and `fail_msg` verbatim (sliced out of the file, not retyped) over real `nft list table` output from a throwaway netns: the declared table → rc 0; a declaration naming 8200 against a table with no 8200 row → rc 2 naming `8200`; the empty declaration → **rc 0**. What now catches the empty case is the deploy's `verify` step, which dials `https://<guest>:8200/v1/sys/health` (`Makefile:110` `PROD_STEPS := snapshot guest service verify`, `Makefile:455+`), so the run does red — later, and without naming the cause. The author discloses this and routes it there. The defect is the sentence, not the ordering: smallest clearing change is one clause — either assert the declaration is non-empty for this Guest at the play/`group_vars` level (leaving the shared role's `[]` default for the runner Guest intact), or reword `:72-75` to say it catches a declaration that names a port the table lacks. **A2 — ADVISORY. The failure message names the wrong reason when a non-port check fails.** `bao/service/roles/firewall/tasks/main.yml:94-99`. Driven: with the SSH row renamed, and again with `policy drop` swapped for `policy accept`, the run reds as it should but the message reads `Missing from the loaded table: none` — because the `Missing …` clause is unconditional while `firewall_missing_rules` is empty. `nft` refusing in the same drive (`rc 1`, empty stdout) reports the stderr correctly. Smallest clearing change: append the `Missing …` clause only when `firewall_missing_rules | length > 0`, or name the failing item. ## Standards No findings. Read at the head: `AGENTS.md` (52 lines), `docs/agents/{domain,issue-tracker,triage-labels}.md`, and the org records at `olympus/workshop` `origin/main` `docs/adr/` (16 records, ADR-0001…0015 + index). None constrains the shape of an Ansible task file or these pages. ADR-0010 (no deployer deploys the machines it runs on) holds: this deploy runs on the Semaphore runner, not on 144. ADR-0011 (a deploy never destroys or replaces) is not touched — a service restart is a change in place, not the replacement of a resource, and the plan job is green at the head. One measurement, not charged: the delta's rewrap leaves a single 81-column prose line (`docs/hardening.md:39`) in a file whose own register is ≤80 (base maximum 80). No file states a width rule. ## What I verified | Check | Result | | --- | --- | | `refs/pull/66/head` on the forge vs the dispatch SHA | `09e7abb3ef2a5eced16770efa5b0290a49d7d98f`, equal; re-read after the probes, unchanged | | `git merge-base --is-ancestor d1b8f43 09e7abb` | true — the fixer stacked, so the round's delta is `git diff d1b8f43 09e7abb`, 5 files, +106/−22 | | `mise exec -- make check` at the head | rc 0; 591 `ok` lines, every suite `0 FAILED` | | `ansible-playbook -i inventories/prod/hosts --syntax-check site.yml` (from `bao/service`) | rc 0, only the pre-existing group/host same-name warning | | `--list-tasks` order | `openbao`: read main process → read mapped libraries → restart → rehearsal report → wait for the API, after the firewall role's read-back and before anything reads the store | | The restart's own `cmd:` (sliced by script) against a live process | nothing replaced → 0 lines; a mapped file renamed over at the same path → the path printed; immediately again → the same one line (not two); a fresh process started after the replacement → 0 lines, so a converged tree does not restart on every deploy | | The three `when:` guards, lifted verbatim | real run + drift → restart task runs; `--check` + drift → only the rehearsal message; no drift → neither; `MainPID` empty (the read skipped) → neither, and no undefined-variable error | | The read-back `that:` list + `fail_msg` over real `nft list table` output | declared table rc 0; empty declaration rc 2 naming `8200`; SSH row renamed rc 2; `policy accept` rc 2; `nft` refused rc 2 carrying the stderr | | The table itself | rendered from the role's defaults + `group_vars/bao/vars.yml`, `nft -f` in a throwaway netns, `nft list table inet olympus` shows `policy drop`, the 22 row and the 8200 row, counters 0 | | CI at the head | `pr-checks / check (pull_request)` success (44s); `plan / guest-plan-check (pull_request_target)` success (19s) | | Secrets in the delta | none — no literal key, token or path value | | "nothing in this repository upgrades packages" (`docs/hardening.md:28`, `50unattended-upgrades.j2:3-5`) | `git grep -nE 'apt-get +(-y +)?(dist-)?upgrade\|apt +(-y +)?(dist-)?upgrade\|state: *latest'` over the head tree → no hits | ## What I could not verify - **The Guest at 10.12.0.144 was not read by me.** This host carries no hypervisor route to it (`pct` is absent), so I did not see the running store's `/proc/<pid>/maps`, reproduce the author's read-only probe (`MainPID` 4357, 0 drifted lines), or watch a restart. The end-to-end path — systemd restart, `ExecStartPost` unseal, the wait after it — is the author's evidence, not mine. One residual risk that read would have settled: if the store's pebbledb files were mapped by the running process, every deploy would restart the store; the author's live read says they are not, and Pebble reads through `pread` rather than `mmap`, but I did not reproduce it. - `make service-check` needs the fetched environment and dials PROD; not run here (no store credential fetched this round). - The deploy's `verify` step was read, not run. ## Named, not charged - `make check` carries no case for `bao/service`, so neither the new read-back nor the restart has credential-free coverage. That is the shape of the floor before this change (round 1 named it); the fix adds no regressing case either, and its evidence does not claim coverage. - The read-back matches declared rows by `port` alone — a row opening 8200 from another source would pass. The template is the only writer of the table, so this is noted, not charged. - The inventory's group/host same-name warning predates this change. ## Board THE-120 read live (`GET /api/issues/THE-120` → 200; `GET …/comments` → 200, 3 entries): status `in_progress`, `reviewAttention.state: none`, and every entry is the assignee agent's "ACP agent reported a terminal limit failure." — no ruling, so the hold is open and unanswered. The dispatch puts the tier-1 hold on the board and the state on the findings, so this round posts the finding-based state and the label it earns; merging remains the board's gate. The round-1 review (id 813, `REQUEST_CHANGES` at `d1b8f43`) was read `dismissed: false` before this one posted; Forgejo supersedes it with this review. --- **Summary.** Spec: 0 blockers, 2 advisories — worst on that axis is A1, a comment that promises a case the check cannot see. Standards: 0 findings. Two advisories travel as advice; the recommendation does not turn on them.
pit merged commit 03f9e24944 into main 2026-12-02 16:36:24 +00:00
pit deleted branch hermes/THE-40-firewall 2026-12-02 16:36:25 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
olympus/infra-secrets!66
No description provided.