The store's Guest applies security updates and accepts only 8200 and SSH (THE-40) #66
No reviewers
Labels
No labels
ready-for-agent
review
merge-ready
review
needs-fix
review
needs-human
review
needs-review
needs-info
needs-triage
ready-for-agent
ready-for-human
review
merge-ready
review
needs-fix
review
needs-human
review
needs-operator
review
needs-review
review
waiting
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
olympus/infra-secrets!66
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "hermes/THE-40-firewall"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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) androles/firewall(oneolympustable, inputpolicy 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.
bao/service/roles/{unattended_upgrades,firewall}/bao/service/site.ymlopenbaobao/service/group_vars/bao/vars.yml10.12.0.0/24bao/service/roles/openbao/tasks/main.ymldocs/hardening.md,README.mdEvidence
mise exec -- make checkat09e7abbansible-playbook site.yml --syntax-checknft -crc 0; loaded, loaded again and replaced in a throwaway network namespace;nft list table inet olympusshowspolicy dropand the two accepts, counters at 0What the merge does
The deploy's
servicestep applies the roles before the store's own role, and the play's read-back fails the run unless the loaded table carriespolicy drop, the SSH rule and every portfirewall_rulesdeclares. 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'sverifythen 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-checkis 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.Review started (round 1/5) on
d1b8f43936— reading the diff now.olympus/infra-secrets· PR #66 · headd1b8f43· round 1/5 · the dispatch's1/5and this thread's count agree (no earlier review exists) · verdict: fixRecommendation: fix
Spec source:
paperclip:THE-40, fetched live at 17:11 CET together with itsdesigndocument ("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-40design, §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 ofopenbaoare the handlers atbao/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 isstate: started(tasks/main.yml:124). On an unchanged tree no template changes, no handler fires, andsystemctldoes not restart a running unit forstarted. 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-28andbao/service/roles/unattended_upgrades/templates/50unattended-upgrades.j2:3-5say a point release "waits for the next deploy'saptrun". Nothing in the repository runs an apt upgrade: a grep forupgrade:/state: latestoverbao/,scripts/andMakefileanswers nothing, and the roles'apttasks 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-9anddocs/hardening.md:76-77close 8201;THE-40's §Ports, per Guest listsbao144 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-76assertspolicy dropanddport 22only. Iffirewall_rulesfailed to resolve (a group name that does not match the play'shosts:, a typo invars.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 overfirewall_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 atolympus/workshoporigin/maindocs/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 againstinfra-forgeorigin/mainforgejo/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
refs/pull/66/headon the forge vs the dispatch SHAd1b8f43936d40ce3d5e3a266003f777c04771fb7, equalgit diff 0b9990c…d1b8f43, 13 files, 411 insertions (the PR base; the standing clone'smainis behind and was not used)mise exec -- make checkat the headansible-playbook -i inventories/prod/hosts --syntax-check site.ymlansible-inventory --host baofirewall_rules: [{port: 8200, proto: tcp, comment: …}]— the newgroup_vars/bao/vars.ymlreaches the playnft -crc 0; first load rc 0;nft list table inet olympusshowspolicy 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 forcepr-checks / check (pull_request)success;plan / guest-plan-check (pull_request_target)successWhat I could not verify
nftables.serviceis enabled on this image, whether an MTA exists forMail "root", whetherneedrestartis 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-checkneeds 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 +nftabove), not through Ansible against a Guest.Named, not charged
make checkdoes not exercisebao/serviceat 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.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 slot0d346060-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.
Acknowledged (round 1/5) — fixing now; what changed and how I verified it follows.
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.Round 1/5 — fixed in
09e7abbThree findings: 1 BLOCKER (spec) and 2 ADVISORY (spec). All three carried. One commit on the PR's branch, no rewrite.
policy dropand SSH1. The restart the play performs —
09e7abbbao/service/roles/openbao/tasks/main.yml, right after the service is started and before anything reads the store:MainPID;/proc/<pid>/mapswhose 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;--check, read the same/procand 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 thewait for the APIthat 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 androles/unattended_upgrades/templates/50unattended-upgrades.j2no longer claim a point release waits for "the next deploy'saptrun" — nothing here runsapt upgrade, so it waits for the Operator.roles/unattended_upgrades/defaults/main.ymlnow names which role does the restart.2. 8201 in THE-40's port table —
09e7abbdocs/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 ispaperclip:THE-40, which is not one of the trackers this run can reach (GET /api/v1/projectson the Vikunja instance answersTR/FO/WR/SL/SC/CPand noTHEproject), so the page note is the route taken — the one the finding names as sufficient.3. The read-back covers the declaration —
09e7abbbao/service/roles/firewall/tasks/main.ymlnow works outfirewall_missing_rules— every rule infirewall_ruleswhoseportdoes not appear as adportinnft list table inet olympus— and asserts it is empty; the failure names the ports:The SSH row and
policy dropare still asserted.What I ran, and what it printed
Run from the worktree at
09e7abb, through the repo's dependency manager:mise exec -- make checkrc=0; 591oklines, every suite0 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(inbao/service)rc=0,playbook: site.yml, only the pre-existing[WARNING]: Found both group and host with same name: baomise exec -- tofu fmt -check -recursive -diffrc=0python3 scripts/docs-check.py . docs/*.md(from the infra-secrets skill)docs/proxmox-credentials.mdlinks/THE/issues/THE-5(introduced by700aa06); my two pages are cleanTwo mechanism proofs, each driven from the role's own bytes (sliced out of the task file by a script, not retyped):
touch)when:over the three shapes ofMainPIDpid='12' -> True; empty -> False; zero -> Falsenftin a throwaway network namespaceassert rc=0,All assertions passedassert rc=2, naming8200One 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 openbaoanswers4357, 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.shis the slicer's output, left in place.What is left, named
make service-checkwas 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 + realnftload, and the drift read against a real process) — not through Ansible against the Guest. The restart path itself (asystemdrestart plus the existing unseal drop-in) has not been executed on 144, because that restarts the live store.make verify. The role is shared: the runner Guest legitimately declaresfirewall_rules: [](its ports are Docker's, covered byfirewall_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.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 themake checkevidence row now names09e7abb. Verified by read-back —equal=True,old_left=0,new_present=1.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.
Review started (round 1/5) on
09e7abb3ef— reading the diff now.olympus/infra-secrets· PR #66 · head09e7abb· round 2/5 · the thread's review list holds one review (d1b8f43), so this is the second round; the dispatch's1/5numbers the re-arm, not the thread · verdict: mergeRecommendation: merge
Spec source:
paperclip:THE-40, read live (GET /api/issues/THE-40→ 200) with itsdesigndocument (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
09e7abbbao/service/roles/openbao/tasks/main.yml:134-180takes the restart THE-40's design names. Driven below.docs/hardening.md:81-84names THE-40's row and says the page supersedes it.policy dropand SSHbao/service/roles/firewall/tasks/main.yml:76-93now 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-75says the check exists because "afirewall_rulesthat resolved to nothing — a group name that does not match the play'shosts:, a typo ingroup_vars— would otherwise load a table with no Service port and still report success". At head that exact case still passes: afirewall_rulesthat resolved to nothing is the role default[],rejectattrruns over nothing,firewall_missing_rulesis empty, and the assert is green with 8200 closed. I drove thethat:list andfail_msgverbatim (sliced out of the file, not retyped) over realnft list tableoutput from a throwaway netns: the declared table → rc 0; a declaration naming 8200 against a table with no 8200 row → rc 2 naming8200; the empty declaration → rc 0. What now catches the empty case is the deploy'sverifystep, which dialshttps://<guest>:8200/v1/sys/health(Makefile:110PROD_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_varslevel (leaving the shared role's[]default for the runner Guest intact), or reword:72-75to 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 withpolicy dropswapped forpolicy accept, the run reds as it should but the message readsMissing from the loaded table: none— because theMissing …clause is unconditional whilefirewall_missing_rulesis empty.nftrefusing in the same drive (rc 1, empty stdout) reports the stderr correctly. Smallest clearing change: append theMissing …clause only whenfirewall_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 atolympus/workshoporigin/maindocs/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
refs/pull/66/headon the forge vs the dispatch SHA09e7abb3ef2a5eced16770efa5b0290a49d7d98f, equal; re-read after the probes, unchangedgit merge-base --is-ancestor d1b8f43 09e7abbgit diff d1b8f43 09e7abb, 5 files, +106/−22mise exec -- make checkat the headoklines, every suite0 FAILEDansible-playbook -i inventories/prod/hosts --syntax-check site.yml(frombao/service)--list-tasksorderopenbao: 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 storecmd:(sliced by script) against a live processwhen:guards, lifted verbatim--check+ drift → only the rehearsal message; no drift → neither;MainPIDempty (the read skipped) → neither, and no undefined-variable errorthat:list +fail_msgover realnft list tableoutput8200; SSH row renamed rc 2;policy acceptrc 2;nftrefused rc 2 carrying the stderrgroup_vars/bao/vars.yml,nft -fin a throwaway netns,nft list table inet olympusshowspolicy drop, the 22 row and the 8200 row, counters 0pr-checks / check (pull_request)success (44s);plan / guest-plan-check (pull_request_target)success (19s)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 hitsWhat I could not verify
pctis absent), so I did not see the running store's/proc/<pid>/maps, reproduce the author's read-only probe (MainPID4357, 0 drifted lines), or watch a restart. The end-to-end path — systemd restart,ExecStartPostunseal, 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 throughpreadrather thanmmap, but I did not reproduce it.make service-checkneeds the fetched environment and dials PROD; not run here (no store credential fetched this round).verifystep was read, not run.Named, not charged
make checkcarries no case forbao/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.portalone — a row opening 8200 from another source would pass. The template is the only writer of the table, so this is noted, not charged.Board
THE-120 read live (
GET /api/issues/THE-120→ 200;GET …/comments→ 200, 3 entries): statusin_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_CHANGESatd1b8f43) was readdismissed: falsebefore 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.