Both cockpit Guests apply security updates, and the server accepts only 3000 and SSH (THE-40) #39

Merged
pit merged 1 commit from hermes/THE-40-hardening into main 2026-12-02 16:28:36 +00:00
Owner

paperclip:THE-40

Summary

The two Guest roles land in this repository's service layer, in front of both Services: roles/unattended_upgrades and roles/firewall, added to each of the site's two plays — the server, then the runner — right after journal.

Guest Declares
semaphore (143) 3000, the instance's https address: the UI, the API, the runner and the watchdog
semaphore-runner (145) nothing beyond SSH — the runner dials the server and the Guests it deploys, never the other way round

The watchdog keeps working. It calls the instance's own address from 143, and a packet to the machine's own address never leaves lo; the table's first rule accepts it.

File What
semaphore/service/roles/{unattended_upgrades,firewall}/ the two roles, the forge template's, titled for this repository
semaphore/service/site.yml both plays run them before their Service
semaphore/service/group_vars/semaphore/vars.yml the 3000 row, from 10.12.0.0/24
semaphore/service/group_vars/runner/vars.yml the empty declaration: no Service port
docs/hardening.md, AGENTS.md the page, and its name in the Docs list

Evidence

Check Result
mise exec -- make check at 36f3640 exit 0
ansible-playbook site.yml --syntax-check the play parses (the repository's existing group/host same-name warning, unrelated)
The server's table — SSH plus 3000 nft -c rc 0; loaded, loaded again and replaced in a throwaway network namespace; policy drop and the two accepts read back
The runner's table — SSH only same run, policy drop and the one accept

What the merge does

The deploy's service step applies the roles before each Service and reads the loaded table back; a table that does not carry policy drop and the SSH rule reds the deploy. Neither Guest carries a table today, so this merge is the first live load on both. The play's own SSH sessions survive the load: the server is reached from the segment, and the runner's play reaches it over the loopback.

This change adds no restart of its own: the firewall role's handler restarts only olympus-firewall, and neither Service's config changes. The cockpit deploy's own handling of a Semaphore restart is unchanged.

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 both Services: `roles/unattended_upgrades` and `roles/firewall`, added to each of the site's two plays — the server, then the runner — right after `journal`. | Guest | Declares | | --- | --- | | `semaphore` (143) | 3000, the instance's https address: the UI, the API, the runner and the watchdog | | `semaphore-runner` (145) | nothing beyond SSH — the runner dials the server and the Guests it deploys, never the other way round | **The watchdog keeps working.** It calls the instance's own address from 143, and a packet to the machine's own address never leaves `lo`; the table's first rule accepts it. | File | What | | --- | --- | | `semaphore/service/roles/{unattended_upgrades,firewall}/` | the two roles, the forge template's, titled for this repository | | `semaphore/service/site.yml` | both plays run them before their Service | | `semaphore/service/group_vars/semaphore/vars.yml` | the 3000 row, from `10.12.0.0/24` | | `semaphore/service/group_vars/runner/vars.yml` | the empty declaration: no Service port | | `docs/hardening.md`, `AGENTS.md` | the page, and its name in the Docs list | ## Evidence | Check | Result | | --- | --- | | `mise exec -- make check` at `36f3640` | exit 0 | | `ansible-playbook site.yml --syntax-check` | the play parses (the repository's existing group/host same-name warning, unrelated) | | The server's table — SSH plus 3000 | `nft -c` rc 0; loaded, loaded again and replaced in a throwaway network namespace; `policy drop` and the two accepts read back | | The runner's table — SSH only | same run, `policy drop` and the one accept | ## What the merge does The deploy's `service` step applies the roles before each Service and reads the loaded table back; a table that does not carry `policy drop` and the SSH rule reds the deploy. Neither Guest carries a table today, so this merge is the first live load on both. The play's own SSH sessions survive the load: the server is reached from the segment, and the runner's play reaches it over the loopback. This change adds no restart of its own: the firewall role's handler restarts only `olympus-firewall`, and neither Service's config changes. The cockpit deploy's own handling of a Semaphore restart is unchanged. `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.
Both cockpit Guests apply security updates, and the server accepts only 3000 and SSH (THE-40)
All checks were successful
plan / runner-guest-plan-check (pull_request_target) Successful in 18s
plan / guest-plan-check (pull_request_target) Successful in 18s
plan / projects-plan-check (pull_request_target) Successful in 20s
pr-checks / check (pull_request) Successful in 47s
36f3640e60
The forge template's two roles land in the service layer, in front of both
Services: the server declares its https address (3000), and the runner declares
nothing but SSH — it dials the server and the Guests it deploys, never the other
way round. The watchdog keeps working because its call to the instance's own
address stays on the loopback.

docs/hardening.md is the page; AGENTS.md's Docs list names it.

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

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

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

Review started (round 0/5) on 36f3640e60 — reading the diff now.

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

olympus/infra-cockpit · PR #39 · head 36f3640 · round 1/5 — the dispatch numbered it 0/5; the review list carried no earlier review, so this is the thread's first.

Recommendation: merge

Spec source. paperclip:THE-40 and its design document ("E4 — hardening in code: design and first slice"), fetched live at 17:21Z on 2026-12-02. The PR body is this repository's share of that design, so it is judged against the design's "guest standard" and port table, not against its own wording.

Spec

The change matches the design clause for clause, and I drove each one rather than reading it:

Design clause Where Result
two roles in the service layer, on both plays, before the Service semaphore/service/site.yml:18-19,26-27 present, in that order
port rows in the Guest's group_vars group_vars/semaphore/vars.yml:50-51 (3000), group_vars/runner/vars.yml:6 (none) matches the design's table for 143 and 145
one table, add → delete → create, one transaction roles/firewall/templates/firewall.nft.j2:9-10 loads twice; a broken file leaves the previous table in force
policy drop, loopback, ct, ICMP, DHCP, then the declared ports + SSH from 10.12.0.0/24 roles/firewall/templates/firewall.nft.j2:14-29 behaviour driven in a namespace pair, below
read the loaded table back and fail the run roles/firewall/tasks/main.yml:57,70-76 asserts exactly policy drop and dport 22 , which is what nft list table prints
security suite only, no reboot, no autoremove, mail + journal roles/unattended_upgrades/templates/50unattended-upgrades.j2 renders and parses to exactly those values

Two advisories, both about wording rather than behaviour:

  • ADVISORY — docs/hardening.md:29 and :33. The page promises the deploy closes both gaps the roles deliberately leave, and it does not. Nothing in the tree runs an upgrade — apt is called only with name: <one package>, in the two new roles and everywhere else — so a pending trixie-updates package waits for the Operator, full stop; and every restart in roles/semaphore/tasks/main.yml:133,230,240,257,303 and roles/semaphore_runner/tasks/main.yml:119,216,225,264,282 is a notify: on a changed file, so a deploy that changes nothing restarts nothing. Both sentences are true if they say the next changed deploy, and the point-release one should drop the deploy entirely. docs/deploy.md:75 already carries the same overstatement about the restart, so this is a two-line correction to wording the repo inherits, not a defect the roles introduce.
  • ADVISORY — PR body, "What the merge does". "the runner's play reaches it over the loopback" is not the mechanism. Both Guests are addressed directly at their LAN addresses (inventories/prod/hosts:4,10) from a deploy host on the segment, so no hop touches lo. The conclusion survives — the SSH source is inside 10.12.0.0/24, which the table accepts — but the sentence names a route that is not there.

Standards

The repo's written rules are AGENTS.md §Secrets, §Toolchain, §Docs, and the org records in olympus/workshop@main:docs/adr/. None of them governs the wording of a docs page, so the finding above is general good practice (a page should describe the artifact it describes), and I say that plainly rather than cite a rule that does not exist.

Nothing else deviates. No literal secret in the diff or the body; mise exec -- make check is the route the toolchain rule names; no workflow file moved, so the pr-checks gate is not touched; and the records that bind this change — 0009 (merge is the deploy), 0010 (no deployer deploys the machines it runs on — the forge runner deploys 143 and 145, not itself), 0011 (never destroy or replace) — all hold, with all three plan checks green at this head.

Standards findings: 0.

What I verified

  • Head pinned by git ls-remote origin refs/pull/39/head, at the first fetch and again immediately before the POST: 36f3640….
  • Both roles are the live template, verbatim. diff against infra-forge@origin/main forgejo/service/roles/{firewall,unattended_upgrades}: identical in every file but the "Managed by infra-…" attribution line. The design records that table loaded and green on 141 and 146, so the mechanism is not on its first outing here.
  • Rendered and loaded for real. Both Guests' tables, rendered from the real templates with the real group_vars, pass nft -c, load, load a second time (the add→delete path with the table already present), and read back carrying policy drop and dport 22 — the two strings the role's own assert searches for.
  • A broken table is refused whole. With a table loaded, a one-character corruption of the 3000 line makes nft -f reject the transaction and the loaded table still carries both accepts — the page's safety argument, driven.
  • Behaviour, not the declaration. In a throwaway namespace pair with real listeners on 22, 3000 and 8080: from 10.12.0.0/24 → 22 and 3000 connect, 8080 times out; from 192.168.9.3 → 22 and 3000 both time out; and the Guest dialling its own address on the undeclared 8080 connects through lo. That last one is the watchdog's path that docs/hardening.md:78 claims, reproduced — and its script does call semaphore_web_root, i.e. https://10.12.0.143:3000, from 143 itself (roles/semaphore/templates/semaphore-watchdog.sh.j2:19).
  • The apt configuration is real config. Both rendered files parse under apt-config and dump exactly the values the page lists: security origins only, Automatic-Reboot "false", Remove-Unused-Dependencies "false", Mail "root", SyslogEnable "true". A deliberately malformed control file does error, so the parse is not vacuous.
  • The floor and the gates. mise exec -- make check exit 0 at this head; all four contexts green at 36f3640 (pr-checks / check, plan / guest-plan-check, plan / runner-guest-plan-check, plan / projects-plan-check).

What I could not verify

  • The declared ports against the Guests themselves. ss -ltnp on 143/145 needs the deploy key; this host is refused (Permission denied (publickey,password)), and the agent class here may not fetch .env. The rows rest on the design document's live reads, not on my own.
  • The mail half. No role in any olympus repository installs an MTA, and I could not read either Guest, so "each Guest's postfix delivers" (docs/hardening.md:40) is unproven from here. The journal half does not depend on it.
  • The first live load. It happens at the merge, and the charter forbids performing the host act I am judging.

Named, not charged

  • AGENTS.md's tracker paragraph still says Vikunja and CP-<n>, while this body — like the last several merged bodies — cites paperclip:THE-40. Pre-existing drift on a section this diff does not touch.
  • README.md does not list docs/hardening.md. It does not list docs/drift.md either, so the omission follows the page's own precedent; AGENTS.md §Docs, which is the list this repo keeps, does name it.
  • make check parses no Ansible and runs no test for either new role. That was already true of roles/semaphore, so it is not this change's to answer for.

Findings: spec 2 (0 blockers, 2 advisories), standards 0. Worst in Spec: the page's two "the next deploy does it" clauses (docs/hardening.md:29, :33), which name a mechanism the deploy does not have. Worst in Standards: none.

The recommendation is merge; both findings are advice and neither moves the state.

<!-- minos review-loop: repo=olympus/infra-cockpit pr=39 head=36f3640e603d995da7fe6463f21a9af541ec2f2b round=1/5 axes=standards,spec --> `olympus/infra-cockpit` · PR #39 · head `36f3640` · round **1/5** — the dispatch numbered it 0/5; the review list carried no earlier review, so this is the thread's first. Recommendation: merge **Spec source.** `paperclip:THE-40` and its `design` document ("E4 — hardening in code: design and first slice"), fetched live at 17:21Z on 2026-12-02. The PR body is this repository's share of that design, so it is judged against the design's "guest standard" and port table, not against its own wording. ## Spec The change matches the design clause for clause, and I drove each one rather than reading it: | Design clause | Where | Result | | --- | --- | --- | | two roles in the service layer, on both plays, before the Service | `semaphore/service/site.yml:18-19,26-27` | present, in that order | | port rows in the Guest's `group_vars` | `group_vars/semaphore/vars.yml:50-51` (3000), `group_vars/runner/vars.yml:6` (none) | matches the design's table for 143 and 145 | | one table, `add` → `delete` → create, one transaction | `roles/firewall/templates/firewall.nft.j2:9-10` | loads twice; a broken file leaves the previous table in force | | policy drop, loopback, ct, ICMP, DHCP, then the declared ports + SSH from `10.12.0.0/24` | `roles/firewall/templates/firewall.nft.j2:14-29` | behaviour driven in a namespace pair, below | | read the loaded table back and fail the run | `roles/firewall/tasks/main.yml:57,70-76` | asserts exactly `policy drop` and `dport 22 `, which is what `nft list table` prints | | security suite only, no reboot, no autoremove, mail + journal | `roles/unattended_upgrades/templates/50unattended-upgrades.j2` | renders and parses to exactly those values | Two advisories, both about wording rather than behaviour: - **ADVISORY — `docs/hardening.md:29` and `:33`.** The page promises the deploy closes both gaps the roles deliberately leave, and it does not. Nothing in the tree runs an upgrade — `apt` is called only with `name: <one package>`, in the two new roles and everywhere else — so a pending `trixie-updates` package waits for the Operator, full stop; and every restart in `roles/semaphore/tasks/main.yml:133,230,240,257,303` and `roles/semaphore_runner/tasks/main.yml:119,216,225,264,282` is a `notify:` on a changed file, so a deploy that changes nothing restarts nothing. Both sentences are true if they say *the next changed deploy*, and the point-release one should drop the deploy entirely. `docs/deploy.md:75` already carries the same overstatement about the restart, so this is a two-line correction to wording the repo inherits, not a defect the roles introduce. - **ADVISORY — PR body, "What the merge does".** "the runner's play reaches it over the loopback" is not the mechanism. Both Guests are addressed directly at their LAN addresses (`inventories/prod/hosts:4,10`) from a deploy host on the segment, so no hop touches `lo`. The conclusion survives — the SSH source is inside `10.12.0.0/24`, which the table accepts — but the sentence names a route that is not there. ## Standards The repo's written rules are `AGENTS.md` §Secrets, §Toolchain, §Docs, and the org records in `olympus/workshop@main:docs/adr/`. None of them governs the wording of a docs page, so the finding above is general good practice (a page should describe the artifact it describes), and I say that plainly rather than cite a rule that does not exist. Nothing else deviates. No literal secret in the diff or the body; `mise exec -- make check` is the route the toolchain rule names; no workflow file moved, so the `pr-checks` gate is not touched; and the records that bind this change — 0009 (merge is the deploy), 0010 (no deployer deploys the machines it runs on — the forge runner deploys 143 and 145, not itself), 0011 (never destroy or replace) — all hold, with all three plan checks green at this head. **Standards findings: 0.** ## What I verified - **Head pinned** by `git ls-remote origin refs/pull/39/head`, at the first fetch and again immediately before the POST: `36f3640…`. - **Both roles are the live template, verbatim.** `diff` against `infra-forge@origin/main` `forgejo/service/roles/{firewall,unattended_upgrades}`: identical in every file but the "Managed by infra-…" attribution line. The design records that table loaded and green on 141 and 146, so the mechanism is not on its first outing here. - **Rendered and loaded for real.** Both Guests' tables, rendered from the real templates with the real `group_vars`, pass `nft -c`, load, load a second time (the `add`→`delete` path with the table already present), and read back carrying `policy drop` and `dport 22 ` — the two strings the role's own assert searches for. - **A broken table is refused whole.** With a table loaded, a one-character corruption of the 3000 line makes `nft -f` reject the transaction and the loaded table still carries both accepts — the page's safety argument, driven. - **Behaviour, not the declaration.** In a throwaway namespace pair with real listeners on 22, 3000 and 8080: from `10.12.0.0/24` → 22 and 3000 connect, 8080 times out; from `192.168.9.3` → 22 and 3000 both time out; and the Guest dialling *its own* address on the undeclared 8080 connects through `lo`. That last one is the watchdog's path that `docs/hardening.md:78` claims, reproduced — and its script does call `semaphore_web_root`, i.e. `https://10.12.0.143:3000`, from 143 itself (`roles/semaphore/templates/semaphore-watchdog.sh.j2:19`). - **The apt configuration is real config.** Both rendered files parse under `apt-config` and dump exactly the values the page lists: security origins only, `Automatic-Reboot "false"`, `Remove-Unused-Dependencies "false"`, `Mail "root"`, `SyslogEnable "true"`. A deliberately malformed control file does error, so the parse is not vacuous. - **The floor and the gates.** `mise exec -- make check` exit 0 at this head; all four contexts green at `36f3640` (`pr-checks / check`, `plan / guest-plan-check`, `plan / runner-guest-plan-check`, `plan / projects-plan-check`). ## What I could not verify - **The declared ports against the Guests themselves.** `ss -ltnp` on 143/145 needs the deploy key; this host is refused (`Permission denied (publickey,password)`), and the agent class here may not fetch `.env`. The rows rest on the design document's live reads, not on my own. - **The mail half.** No role in any olympus repository installs an MTA, and I could not read either Guest, so "each Guest's postfix delivers" (`docs/hardening.md:40`) is unproven from here. The journal half does not depend on it. - **The first live load.** It happens at the merge, and the charter forbids performing the host act I am judging. ## Named, not charged - `AGENTS.md`'s tracker paragraph still says Vikunja and `CP-<n>`, while this body — like the last several merged bodies — cites `paperclip:THE-40`. Pre-existing drift on a section this diff does not touch. - `README.md` does not list `docs/hardening.md`. It does not list `docs/drift.md` either, so the omission follows the page's own precedent; `AGENTS.md` §Docs, which is the list this repo keeps, does name it. - `make check` parses no Ansible and runs no test for either new role. That was already true of `roles/semaphore`, so it is not this change's to answer for. --- **Findings: spec 2 (0 blockers, 2 advisories), standards 0.** Worst in Spec: the page's two "the next deploy does it" clauses (`docs/hardening.md:29`, `:33`), which name a mechanism the deploy does not have. Worst in Standards: none. The recommendation is **merge**; both findings are advice and neither moves the state.
pit merged commit 865c8cf3b0 into main 2026-12-02 16:28:36 +00:00
pit deleted branch hermes/THE-40-hardening 2026-12-02 16:28:36 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 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-cockpit!39
No description provided.