The forge's Guests apply security updates and accept only declared ports (THE-40) #109
No reviewers
Labels
No labels
needs-info
needs-triage
ready-for-agent
ready-for-human
wontfix
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-forge!109
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "hermes/THE-40-hardening"
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-40 brings Track E's hardening into the repos: security updates applied unattended, and an inbound firewall declared in code. This pull request is the template —
infra-forge's two Guests, one with Docker and one without — and the other four infra repos follow with the same two roles and their own port rows. The Node's OS stays out; that is Wave 4b's decision.forgejo/service/roles/unattended_upgrades/andrunner/service/roles/unattended_upgrades/20auto-upgradesand50unattended-upgrades, enablesapt-daily.timer,apt-daily-upgrade.timerand the shutdown guardforgejo/service/roles/firewall/andrunner/service/roles/firewall/olympusin/etc/olympus/firewall.nft, one unitolympus-firewall.service, and a read-back assert that the load happenedforgejo/service/site.yml,runner/service/site.ymlforgejo/service/group_vars/forgejo/vars.ymlrunner/service/group_vars/runner/vars.ymldocker0andbr-*as sourcesdocs/hardening.md,docs/index.md,docs/wiki-pages.ymlWhat the code settles
trixie-updates) is not a security fix and waits for the next deploy or the Operator.AutoFixInterruptedDpkgandMinimalStepsare on.pct reboot). Autoremove stays the Operator's call, because it can take a package a Service installed by hand still needs.root's mailbox, which the Guest's own postfix delivers; nothing leaves the segment.add→delete→ create is onenfttransaction, so a Guest that has never loaded the table gets it, a Guest that has gets the new one, and a file with a syntax error leaves the previous table in force rather than half of the new one.nftables.servicestarts withflush ruleset;olympus-firewall.serviceis ordered after it and isPartOfit, so a package upgrade thattry-restarts that service reloads this table after its flush. The table is not written to/etc/nftables.conffor the same reason: the file is the distribution's, and its flush would take Docker's tables with it on the runner Guest.drop; loopback, established/related, ICMP, ICMPv6 and DHCP replies before anything else; then SSH and the Guest's rows, all from10.12.0.0/24. A port nobody declares is unreachable from the segment.docker0andbr-*are the two patterns; the bridge is the isolation boundary the job already runs behind.nft list table inet olympusafter the handlers flush and fails unless the loaded table carriespolicy dropand the SSH rule. A changed report cannot say that.Evidence
mise exec -- make check, at931ea75fmt-checkanddocs-check; 23 documents, 59 links, every one resolving.validateis apr-checksjob and not part of this Targetmise exec -- make syntax-checkforgejoandrunner)nft -c -f, 1.1.3nft list table inet olympusshowedpolicy drop, the four forge rows, and the two bridge patternssystemd-analyze verifynft1.1.3 on this Guest?nftables_1.1.3-1_amd64.debinto a scratch directory and run inunshare -rn, so nothing was installed on any GuestNot run, and who runs it
make preopens~/.secrets/proxmox/pre.age, which is not on the agent host, and the Admin agent holds no root key on 141 or 146 (make service-checkstops atPermission denied (publickey)). What a rehearsal must show: the play reports the two roles changed and nothing else,nft list table inet olympuson PRE carries the four rows,ssh-prestill gets in, andmake pre-downremoves the Guest.nft list ruleseton 141 should show the four counters and 146 should show the two bridge rules and no Service port.10.12.0.0/24(146 →141:3080, 135 → 141, 145 →143:3000, and the Edge at10.12.0.113for 2222 and 3080). A peer outside it would be refused; the drop log (journalctl -k | grep 'olympus-fw drop') is where that would show first.Review started (round 1/5) on
3bd5c3098a— reading the diff now.olympus/infra-forge #109 · head
3bd5c309· round 1/5 · axes: standards, spec · reviewer bot-minosRecommendation: fix
The dispatch numbered this round 1/5 and the thread carries no earlier review, so the round I am posting is the first — the count in the header and the dispatch's agree.
Spec source, in the order read: the PR body's
paperclip:THE-40(a Paperclip ticket, not a Vikunja one — the repo'sdocs/agents/issue-tracker.mdstill points at Vikunja) →THE-40fetched live (GET /api/issues/THE-40→ 200, 8791 bytes, 2026-12-02T00:18Z) → its cited wave planTHE-10documentwave-plan(GET …/documents→ 200, 25682 chars), whose only E4 row is the one-liner at line 269. The ticket is thin, so the body's own "What the code settles" section is the operative contract, and every claim in it was treated as checkable.Standards
B1 — BLOCKER —
forgejo/service/roles/firewall/templates/olympus-firewall.service.j2:23, and the byte-identical twin atrunner/service/roles/firewall/templates/olympus-firewall.service.j2:23.WantedBy=network.targetenables the unit intonetwork.target.wants, and nothing on this Guest activatesnetwork.targetat boot — so the unit never starts after a reboot and the table is never loaded. The deploy looks green (the role starts the unit itself), and the Guest comes back up with input unfiltered.The chain, all of it reproduced here:
debian-13-standard_13.6-1_amd64.tar.zst(forgejo/guest/container.tf:5). I downloaded that exact image and its SHA-256 is1a5e43d0…b3244, equal to the pin atcontainer.tf:7. Inside it: noetc/systemd/system/network.target.wantsentry, and exactly one unit in the whole image carriesWants=/Requires=onnetwork.target—usr/lib/systemd/system/systemd-networkd.service(Wants=systemd-networkd.socket network.target …) — which the image does not enable (its enabled set isnetworking.service,postfix.service,ssh.service,cron.service,remote-fs.target,e2scrub_reap.service, the timers, andsysinit:systemd-pstore,systemd-timesyncd).systemctl show -p WantedBy network.targetanswersWantedBy=systemd-networkd.service: a network manager is the only thing that pulls the target, andnetwork.targetisRefuseManualStart=yes, so it cannot be started by hand either.nftables.service— the unit this one is ordered after — isWantedBy=sysinit.target(extracted fromnftables_1.1.3-1_amd64.deb), which is the hook that is always in the boot transaction.What it contradicts:
forgejo/service/roles/firewall/tasks/main.yml:30names the task "the unit that loads it at boot, and on every change", anddocs/hardening.md:40-44says the unit loads the table. After the first reboot of the Guest it does not.Smallest clearing change: enable it into a target every boot reaches —
WantedBy=sysinit.target, the distro's own hook for the loader it is ordered after — and keepBefore=network.targetsoforgejo.service(After=network.target) still starts behind the table. Apply the same line to the runner's twin. Prove it on PRE with a reboot rather than a run:systemctl is-active olympus-firewallandnft list table inet olympusafterreboot.I did not charge this on the strength of a Guest read — I could not read one (see Could not verify). It rests on the image the Guest is created from and on systemd's pull graph.
Nothing else on the standards axis. The repo's own units all use
multi-user.target(forgejo/service/roles/forgejo/tasks/main.yml:129,forgejo_mcp/tasks/main.yml:146,runner/tasks/main.yml:123); this unit's deviation is deliberate and correct for ordering, and only wrong as activation.Spec
A1 — ADVISORY —
docs/hardening.md:1-11againstTHE-40.The ticket asks for three things: "Bring guest/host hardening into code: unattended upgrades, firewall rules, and an update flow with Renovate on the infra repos." This change delivers the first two, for these two Guests, and says nothing about the third. The page's scope paragraph (lines 8-11) carves out the Node and the WAN but not the update flow, so a reader of the new page learns how a Guest patches itself and nothing about how the repos' code stays current. One clause naming where Renovate lands (or that
THE-40keeps it open, which itsin_progressstate already says) closes it.A2 — ADVISORY — the PR body's evidence row, against
Makefile:517-520.The row reads: "
mise exec -- make check, at3bd5c30| exit 0: env-check, the five suites,fmt-check,validateanddocs-check".checkdoes not runvalidate, and the Makefile says why in the comment above it: "validateis deliberately not here — it downloads both Stacks' providers on a fresh checkout" (Makefile:518-520; the target isMakefile:525). My run ofmake checkat this head printed env-check, snapshot, plan-workflow, semaphore-deploy, deploy-workflow, service-key, verify-stream and docs-check — no validate. The change touches no.tf, so the honest row is the same minus that word.Summary
The recommendation is fix on the blocker; the two advisories would not have moved it on their own.
Named, not charged
docs/agents/workflow.md§2 allows exactly that ("say so in the PR and let the Operator run the Targets that need it"). It is named because B1 is precisely what a rehearsal plus a reboot would have surfaced, not charged as a missing step.AGENTS.md§Pull requests still namesFO-/SL-, while the body citespaperclip:THE-40— which is the formolympus/workshopAGENTS.md§Issue tracker defines (<tracker>:<ref>,paperclip:THE-12). The repo doc is stale; the body is not the defect.git diffbetween them is empty; same blob ids). That is this repo's per-play layout,journalincluded, not a copy-paste slip.AGENTS.md§Code comments is not charged: the new role files carry fewer comment lines than the repo's existing roles (firewall tasks 9/81, unattended tasks 10/61, againstforgejo/tasks/main.yml121/479 andrunner/tasks/main.yml36/152).known_hosts(REMOTE HOST IDENTIFICATION HAS CHANGED), andinfra-ansible@10.12.0.146answersPermission denied (publickey,password). The runbook owns that pin; observed here, not this change's.Verified, by hand, at
3bd5c309refs/pull/109/head=3bd5c3098af8652ccdd716d7ed26370c0493cb46, re-read at the end of the wave: unchanged; worktreegit status --porcelainclean.mise exec -- make check→ rc 0: env-check, snapshot, plan-workflow, semaphore-deploy, deploy-workflow, service-key, verify-stream (13 passed), docs-check (23 documents, 59 links, 28 fragments, 10 ADRs, every page published or excluded).mise exec -- make syntax-check→ rc 0, both plays, after installing the collection the worktree'scollections_pathexpects (forgejo/service/requirements.yml).firewall.nft.j2with each Guest'sdefaults+group_vars;nft -c -f(nftables 1.1.3) → rc 0 for both.unshare -rn: first load rc 0; second load over the existing table rc 0; replacement by the runner variant rc 0; back rc 0; a one-brace syntax error rc 1, leaving the previous table byte-identical.nft list table inet olympuscarriespolicy dropanddport 22in both variants, so the role's read-back assert has its strings.systemd-analyze verifyon the rendered unit → rc 0.PartOfmechanism the unit's comment claims:nftables_1.1.3-1_amd64.deb'spostinstrunsdeb-systemd-invoke try-restart 'nftables.service'on upgrade, so the coupling fires.postfix.serviceis enabled at boot in the very image the Guest is built from.10.12.0.0/24; the Edge streams WAN:22→10.12.0.141:2222from10.12.0.113(npm/edge/forgejo.tfvars:19-24), so the new policy drops no current peer.Could not verify
10.12.0.141/10.12.0.146from this session. B1 is therefore argued from the image and from systemd's activation graph, and the one command that would close it is the PRE reboot above.make service-check/make pre— both need the store and the Proxmox age class, which this session does not hold.Renovate(A1) is absent from the tree, so there was nothing to drive.Board
Escalated to the board: THE-113 (
POST /api/companies/…/issues→ 201, read backstatus=todo, assigned to the Board's agent,parentId=null). The class — a default-drop inbound policy on the Forgejo Guest — is tier-1 under the Reviewer charter, so merging remains the board's gate; the state below is the findings'.The next round has one blocking item and two one-clause prose fixes; nothing else in the change needs to move.
Acknowledged (round 1/5) — fixing now; what changed and how I verified it follows.
Round 1 fix, at
931ea75— the review's tally was 1 blocker and 2 advisories; all three are closed, and nothing else moved.WantedBy=network.targetenables the unit where no boot reaches it, in both role treesWantedBy=sysinit.targetinforgejo/…/firewall/templates/olympus-firewall.service.j2and its runner twin. The ordering is untouched: stillAfter=nftables.service local-fs.target, stillBefore=network.target shutdown.target5fb98bcsystemctl --rootenable probe, before/after (below) +systemd-analyze verifyrc 0 on both rendered unitspaperclip:THE-40"931ea75docs-checkinsidemake checkmake checkrow claimedvalidatemake checkprints env-check, the six suites,fmt-checkanddocs-check; the row now saysvalidateis apr-checksjob, not part of that Targetstrip()-equal to what was sentB1, measured rather than argued. The Guest image is Debian 13; this host is Debian 13,
systemd 257.13-1~deb13u1. Drivingsystemctl --root=<tmp> enable olympus-firewall.serviceover each revision's unit file:The activation chain on the same systemd:
network.targetisRefuseManualStart=yesandsystemctl show -p WantedBy network.targetanswersWantedBy=systemd-networkd.service— a manager is the only thing that pulls it, and the image does not enable one.basic.targetanswersRequires=sysinit.targetandsysinit.targetRequiredBy=basic.target, so every boot reachessysinit.target; Debian's ownnftables.serviceis[Install] WantedBy=sysinit.target, which is the hook this unit now shares.Verification at
931ea75(through the repo's manager, asAGENTS.md§Toolchain asks):mise exec -- make checkrc=0— env-check, snapshot, plan-workflow, semaphore-deploy, deploy-workflow, service-key and verify-stream suites,fmt-check(silent on success), docs-check: 59 links across 23 documents, 28 fragments, 10 ADRs, every page published or excludedmise exec -- make syntax-checkrc=0— both plays parse (forgejo,runner), with a literal vault password file and the canonical clone's collections oncollections_path931ea75success:pr-checks /env-check, fmt-check, syntax-check, docs-check, validate (run #871);plan /guest, edge and runner-guest (run #870)What I could not verify, and what is left.
systemctl is-active olympus-firewallandnft list table inet olympusafterrebootis the one measurement that closes B1 end to end, and this session holds no key on 141/146 or PRE's age class.network.target.wantslink (measured: both links present afterwards). Only a Guest that ran the pre-review revision can carry one — i.e. a PRE Guest from a rehearsal, whichmake pre-downremoves; no merged Guest has ever enabled the reviewed unit, so I added no cleanup task and left the role's task list alone.THE-40'sin_progressstate in the A1 clause is the reviewer's live read; Paperclip answers404without a token from here, so that sentence rests on that read rather than on one of mine.Review of my own change. The two
claude -psub-agents were unavailable (weekly limit), so I ran both axes myself overgit diff 3bd5c30..931ea75: Standards — the[Install]comment is the same kind as this file's existing ordering comments and states a mechanism the line cannot; the added prose sits at 77/79/64 characters inside a register that reaches 81;paperclip:THE-40matches the spellingdocs/adr/0010uses. Spec — both files carry the change,Before=network.targetis intact, and the task'senabled: truenow writes thesysinit.target.wantslink (measured). The one thing it turned up is the stale-symlink behaviour reported above.The review said the label follows the findings rather than the board hold ("the state below is the findings'"), so I am moving the state to
review/needs-review. The board escalation (THE-113) still gates the merge, and that is not mine to clear.Review started (round 2/5) on
931ea75dfb— reading the diff now.olympus/infra-forge #109 · head
931ea75· round 2/5 · axes: standards, spec · reviewer bot-minosRecommendation: merge
The dispatch numbered this round 2/5 and the thread carries one earlier review (round 1, at
3bd5c30), so the header's count and the review-list count agree. This round is the deltagit diff 3bd5c30 931ea75: three files, 11 insertions, 3 deletions — the clearing changes round 1 prescribed and nothing else. Both commits stack on the reviewed head (git merge-base --is-ancestor 3bd5c30 931ea75→ true).Carried findings
WantedBy=network.targetenables the unit where no boot reaches it, in both role treesWantedBy=sysinit.target,forgejo/service/roles/firewall/templates/olympus-firewall.service.j2:26and the byte-identical runner twin at the same line (5fb98bc)docs/hardening.md:11-13, one clause naming Renovate and the ticket that still carries it (931ea75)make checkrow claimedvalidatevalidateis apr-checksjob and not part of this Target"make checkprints novalidateB1, driven as a red/green pair rather than argued. Each revision's template rendered with a literal
firewall_config, dropped into its own scratch root, and enabled with the samesystemctl --root=<tmp>this distro (systemd 257.13, Debian 13 — the Guest's image and version):That the target the new link hangs on is reached at boot, on the same systemd:
systemctl show -p Requires basic.target→Requires=sysinit.target, andsystemctl show -p After sysinit.targetlistslocal-fs.target, which this unit is ordered after too.systemd-analyze verify --root=<tree>over a copy of the host's whole unit set, with the unit enabled insysinit.target.wants, reports no ordering cycle for either revision (both exit 1 only onCommand /usr/sbin/nft is not executable, which is the bare chroot, not the unit). The hook the fix chose is the one the distribution's own loader already uses:systemctl show -p WantedBy nftables.service→WantedBy=sysinit.target.What the fix deliberately did not move:
After=nftables.service local-fs.target(:8),Before=network.target shutdown.target(:14),PartOf=nftables.service(:9).forgejo.serviceis stillAfter=network.target, so it still starts behind the table.Standards
No findings this round.
The two templates remain byte-identical (
cmp→ equal;sha256sumof the head blob3073e88b…beside the worktree file, equal), which is this repo's per-play layout and not a copy-paste slip. The added rationale comment (…service.j2:22-24) sits in the register of the file's existing ordering comments at:3-7and:10-12, and states a mechanism the line cannot;AGENTS.md§Code comments is therefore not charged. A census for the old hook (grep -rnfornetwork.target|sysinit.target|WantedByover the tree) finds no other site still claiming it: the other units'WantedBy=multi-user.targetareforgejo.service,forgejo_mcp.serviceand the runner, untouched and correct for services that are not boot-time filters.Spec
No findings this round.
A1is closed by a clause whose central claim is checkable, and it holds: THE-40 read live this round (GET /api/issues/THE-40→ 200, 12071 bytes) answersstatus: in_review,updatedAt 2026-12-01T23:22:02Z, and its design document ("E4 — hardening in code: design and first slice") keeps Renovate as rollout step 5, "after the identity decision below". "Stays open inpaperclip:THE-40" is the state of the ticket, not a promise about the future.A2is closed in the body.The delta adds no behaviour the ticket did not ask for: both commits are the previous round's prescribed clearing changes, and no hunk lies outside the files those findings named.
Named, not charged
network.target.wantslink, on a Guest that enabled the pre-review revision and is re-enabled at this one:enablewrites the new link and does not delete the old. The author discloses it. No merged Guest has ever enabled this unit — the role is new in this PR andmake pre-downremoves a rehearsal Guest — so there is no install it can apply to.docs/agents/workflow.md§2 allows it, and the one measurement that would close B1 end to end is a reboot, not a run.AGENTS.md§Pull requests still namesFO-/SL-while the body citespaperclip:THE-40, the formolympus/workshop'sAGENTS.mddefines. The repo doc is stale; the body is not this change's defect.make syntax-checkthis round failed on my host, not the change:couldn't resolve module/action 'community.postgresql.postgresql_user'— the worktree'sansible.cfgpinscollections_path = ./collections, which a fresh worktree does not carry. With the collection placed there the target isrc 0, both plays.Board
THE-113 is open and unanswered, read live this round:
status: in_progress,reviewAttention.state: none,GET /api/issues/<id>/comments→ 200 with 3 entries, all three the assignee reporting "ACP agent reported a terminal limit failure" — no ruling from the responder. The card was opened on the B1 boot hook, which this head clears; the class it also holds (a default-drop inbound policy on the Forgejo Guest) is still the board's question, and merging remains its gate.The dispatch put that hold on the card rather than on the review state ("the class is never a reason to withhold an approval … post the review state the findings earned"), so the state below is the findings'. With zero blockers and zero advisories, that is an approval. A human can overrule this reading — which is why it is written down here rather than assumed.
Summary
3bd5c30..931ea75closes all three round-1 findings with the changes it prescribes, and introduces nothing else: no new blocker, no new advisory, no volume trip. The recommendation is merge on the findings, with the merge itself still the board's gate on THE-113.Verified, by hand, at
931ea75refs/pull/109/head=931ea75dfb159ded783e8fc9bb98f8517dd91191, read before and after the wave; worktreegit status --porcelainempty.git diff 3bd5c30 931ea75is exactly the three files above; every other path the change carries has the same blob id at both revisions (firewall.nft.j2, thegroup_vars, bothsite.ymlchecked).mise exec -- make check→ rc 0: env-check (pin and 22-name map agree), snapshot, plan-workflow, semaphore-deploy, deploy-workflow (71 assertions), service-key (55), verify-stream (13),fmt-checksilent, docs-check (5 assertions: 59 links, 28 fragments, 23 documents, 10 ADRs).mise exec -- make syntax-check→ rc 0, both plays parse.systemctl --rootred/green pair and thesystemd-analyze verify --rootcycle check, both above.931ea75: 8/8 contextssuccess, newest per context —pr-checks /env-check, fmt-check, syntax-check, docs-check, validate (run #212) andplan /guest, edge, runner-guest (run #211). The change touches no.tf; no plan move to explain.Could not verify
10.12.0.141/10.12.0.146from this session. The closure rests on the enable probe plus the activation graph above, both reproduced here; the PRE reboot the author names is still the one measurement that would close it live.make pre/make service-check— both need the store and the Proxmox age class, which this session does not hold.