The silo deploy speaks https to Semaphore and pins its CA (THE-106) #40

Merged
pit merged 1 commit from hermes/THE-106-semaphore-https into main 2026-12-01 16:45:52 +00:00
Owner

Summary

The silo's deploy reaches Semaphore over TLS only, pinned to the CA that olympus/infra-cockpit commits for it — the same change olympus/infra-tracker merged as !64.

start
  refuse: SEMAPHORE_API_URL scheme is not https   (before the token file is written)
  refuse: the CA file is missing or empty
  curl: --proto '=https' --tlsv1.2 --cacert scripts/semaphore-ca.crt

SEMAPHORE_API_URL defaults to https://10.12.0.143:3000. There is no -k and no http fallback to switch on: a certificate that does not verify is a red job with no request made. A refusal names the scheme alone — a value whose text before :// is not a scheme, the shape that carries a userinfo pair, is refused without any of it reaching the job log.

The script header stops citing the TR-66 review's STD-2 as why the token crossed the LAN in cleartext. It names what ci-silo's token may reach and where it is kept (secret/ci/silo/semaphore-api), and points the token's lifetime and re-mint at THE-106's design — the cockpit page it cites mints the token with no expiry and says nothing about replacement.

Spec: https://paperclip.thepit.space/THE/issues/THE-106 (its design document carries the four ADR checks and the pinned 2.19.16 behaviour). This repository's own tracker is Vikunja SL-<index>, and this change has no SL task yet: the THE-106 above is the Paperclip ticket the org-wide change is specified on.

Evidence

  • Before: the default was http://10.12.0.143:3000, and the job's token crossed the LAN in cleartext.
  • After: mise exec -- make check exits 0 on this tree, 612 ok lines and 0 FAIL lines: env-check 2, env-test 74, key-audit-test 39, key-mint-test 194, deploy-test 81, semaphore-deploy-test 93 assertions, 0 FAILED, deploy-workflow-test 53 assertions, 0 FAILED, store-wait-test 40, service-key-test 36; fmt-check silent, tofu validate Success! The configuration is valid.
  • The tests bind the claim. Before the change the two suites read 63 and 50 assertions (git archive f4f2d88, pre-change tests: both green); after, 93 and 53 — the 33 added assertions are the TLS ones. Against the pre-change script the new tests are red with 34 FAIL lines, including the red names the scheme, and names nothing else of the address, the script says there is no CA certificate, the default address is not https and 2 of 2 curl calls do not carry CURL_TLS. The stub serves TLS with a throwaway CA the test mints with openssl, so a refused scheme, a wrong CA, a missing CA and an empty CA each leave it with no request at all.
  • Mutants. mutants-deploy-script.sh on this tree: all nine mutants killed (20, 5, 4, 30, 1, 4, 20, 2 and 27 FAIL lines), the script restored byte-identical.
  • The pin is cockpit's committed CA. scripts/semaphore-ca.crt is byte-identical to olympus/infra-cockpit's semaphore/service/files/ca.crt on olympus/infra-cockpit's main (981c986, merged as !36), sha256sum 5a62c5816adbd382d4bfce8fe1ccb774f7e10173b391abafb90acf2c516fb13a; openssl verify of cockpit's committed leaf against it answers OK. The CA reads CA:TRUE, pathlen:0, name-constrained to 10.12.0.143/32 and 127.0.0.1/32, valid to 2036-11-14; the leaf's SANs are the same two addresses, valid to 2029-02-19.
  • The wrong version number red, measured here: against a throwaway plain-http listener on loopback the script's first call ends curl: (35) TLS connect error: … wrong version number, the listener sees one TLS ClientHello and no http request line, and the job is red — the shape this repo will show until cockpit's deploy lands.

Merge Danger

Door: two-way for this repository. A revert pull request restores the previous default, and the job's calls follow the code it runs.

Blast Radius: deploy-only. olympus/infra-cockpit#36 merged at 16:19:35Z (981c986), and its deploy (run 123) must be green, make verify included, before this merges. Before that, this repo's own deploy goes red at its first request and applies nothing — the no-fallback property working, not a broken job. This branch has not been pushed, so no CI run is cited here; the numbers above are from local runs on the commit this bundle carries.

## Summary The silo's deploy reaches Semaphore over TLS only, pinned to the CA that `olympus/infra-cockpit` commits for it — the same change `olympus/infra-tracker` merged as !64. ```text start refuse: SEMAPHORE_API_URL scheme is not https (before the token file is written) refuse: the CA file is missing or empty curl: --proto '=https' --tlsv1.2 --cacert scripts/semaphore-ca.crt ``` `SEMAPHORE_API_URL` defaults to `https://10.12.0.143:3000`. There is no `-k` and no http fallback to switch on: a certificate that does not verify is a red job with no request made. A refusal names the scheme alone — a value whose text before `://` is not a scheme, the shape that carries a userinfo pair, is refused without any of it reaching the job log. The script header stops citing the TR-66 review's STD-2 as why the token crossed the LAN in cleartext. It names what `ci-silo`'s token may reach and where it is kept (`secret/ci/silo/semaphore-api`), and points the token's lifetime and re-mint at THE-106's design — the cockpit page it cites mints the token with no expiry and says nothing about replacement. Spec: https://paperclip.thepit.space/THE/issues/THE-106 (its `design` document carries the four ADR checks and the pinned 2.19.16 behaviour). This repository's own tracker is Vikunja `SL-<index>`, and this change has no `SL` task yet: the `THE-106` above is the Paperclip ticket the org-wide change is specified on. ## Evidence - **Before:** the default was `http://10.12.0.143:3000`, and the job's token crossed the LAN in cleartext. - **After:** `mise exec -- make check` exits 0 on this tree, 612 `ok` lines and 0 `FAIL` lines: `env-check` 2, `env-test` 74, `key-audit-test` 39, `key-mint-test` 194, `deploy-test` 81, `semaphore-deploy-test` **93 assertions, 0 FAILED**, `deploy-workflow-test` **53 assertions, 0 FAILED**, `store-wait-test` 40, `service-key-test` 36; `fmt-check` silent, `tofu validate` `Success! The configuration is valid.` - **The tests bind the claim.** Before the change the two suites read 63 and 50 assertions (`git archive f4f2d88`, pre-change tests: both green); after, 93 and 53 — the 33 added assertions are the TLS ones. Against the pre-change script the new tests are red with 34 FAIL lines, including `the red names the scheme`, `and names nothing else of the address`, `the script says there is no CA certificate`, `the default address is not https` and `2 of 2 curl calls do not carry CURL_TLS`. The stub serves TLS with a throwaway CA the test mints with `openssl`, so a refused scheme, a wrong CA, a missing CA and an empty CA each leave it with no request at all. - **Mutants.** `mutants-deploy-script.sh` on this tree: all nine mutants `killed` (20, 5, 4, 30, 1, 4, 20, 2 and 27 FAIL lines), the script restored byte-identical. - **The pin is cockpit's committed CA.** `scripts/semaphore-ca.crt` is byte-identical to `olympus/infra-cockpit`'s `semaphore/service/files/ca.crt` on `olympus/infra-cockpit`'s `main` (`981c986`, merged as !36), `sha256sum` `5a62c5816adbd382d4bfce8fe1ccb774f7e10173b391abafb90acf2c516fb13a`; `openssl verify` of cockpit's committed leaf against it answers `OK`. The CA reads `CA:TRUE, pathlen:0`, name-constrained to `10.12.0.143/32` and `127.0.0.1/32`, valid to 2036-11-14; the leaf's SANs are the same two addresses, valid to 2029-02-19. - **The `wrong version number` red, measured here:** against a throwaway plain-http listener on loopback the script's first call ends `curl: (35) TLS connect error: … wrong version number`, the listener sees one TLS ClientHello and no http request line, and the job is red — the shape this repo will show until cockpit's deploy lands. ## Merge Danger **Door:** two-way for this repository. A revert pull request restores the previous default, and the job's calls follow the code it runs. **Blast Radius:** deploy-only. `olympus/infra-cockpit#36` merged at 16:19:35Z (`981c986`), and its deploy (run 123) must be green, `make verify` included, before this merges. Before that, this repo's own deploy goes red at its first request and applies nothing — the no-fallback property working, not a broken job. This branch has not been pushed, so no CI run is cited here; the numbers above are from local runs on the commit this bundle carries.
The silo deploy speaks https to Semaphore and pins its CA (THE-106)
All checks were successful
plan / stack-plan-check (pull_request_target) Successful in 18s
pr-checks / check (pull_request) Successful in 45s
af86311ea1
SEMAPHORE_API_URL now defaults to https://10.12.0.143:3000, the CA that signed
Semaphore's certificate is committed beside the script (scripts/semaphore-ca.crt,
byte-identical to infra-cockpit's semaphore/service/files/ca.crt), and start
refuses any other scheme or a missing CA file before the token is written.
Every curl call carries --proto '=https' --tlsv1.2 --cacert: no -k and no http
fallback. The header no longer cites the TR-66 review's STD-2; the token's
lifetime and re-mint are THE-106's design. The tests drive the script against a
TLS stub with a throwaway CA, and the workflow names no cleartext address.
Author
Owner

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

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

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

**Review started** (round 0/5) on af86311ea19106f9e471663f5c8ac063ba079571 — reading the diff now.
bot-minos approved these changes 2026-12-01 16:41:26 +00:00
bot-minos left a comment

olympus/infra-silo#40 · head af86311 · round 1/5 · axes: standards, spec
The dispatch numbered this round 0; no review is on the thread yet, so the ledger's
rule (reviews posted + 1) makes this round 1. Spec: paperclip THE-106 and its
design document, read live. Standards: AGENTS.md at the head (no
CONTRIBUTING.md in this repo) and olympus/workshop docs/adr/ at
6cc25e62 (no record governs this change).

Recommendation: merge

Standards

A1 · ADVISORY · scripts/semaphore-deploy.sh:159, against the new gate at :103-121
The gate refuses a scheme it does not know, but an https URL whose authority
carries userinfo is accepted, and the start-failure line then prints ${BASE}
verbatim — so a password reaches the job log. Reproduced by hand against a TLS
stub (probe at cache/scratch/the106/leakprobe.sh, wrong pin forced):

SEMAPHORE_API_URL=https://runner:hunter2@127.0.0.1:33443   (CA not the stub's)
→ curl: (60) SSL certificate problem: unable to get local issuer certificate
→ semaphore-deploy: the deploy task could not be started at https://runner:hunter2@127.0.0.1:33443: no answer

The new header (:95-101) says an address can carry a credential and is "refused
without any of it printed", and the suite pins exactly that for the no-scheme
shape (scripts/tests/semaphore-deploy.test.sh:304). The https+userinfo shape is
the same class and is neither refused nor redacted. Line 159 is not in this diff,
so this is an advisory, not a blocker. One line clears it: refuse a $BASE whose
authority carries @, beside the scheme test in require_tls.

Spec

S1 · ADVISORY · PR body, "Evidence"
"The branch has not been pushed, so no CI run is cited here" is false at this head:
the forge carries two green runs on af86311 (#837 pr-checks 45 s, #838 plan
18 s), and the combined status reads success for both required contexts. Every
number the body reports reproduces locally, so the claim about behaviour is
unaffected — only that sentence about CI.

Nothing in THE-106 is missing or partial here. Its done-when ("no deploy workflow
sends a Semaphore token over http", "the script headers no longer cite TR-66
STD-2") holds: grep -rn 'TR-66\|STD-2' over the head answers nothing, the
workflow carries no address of its own, and :63 makes https the default with a
refusal for anything else.

Verified

Probe Result
mise exec -- make check in a worktree at af86311 exit 0: semaphore-deploy 93 assertions 0 FAILED, deploy-workflow 53, store-wait 40, service-key 36, key-mint 194, env-test 74, key-audit 39; tofu validate Success!
mutants of the new code (my wave, head restored, git status clean) drop --cacert → 20 FAIL · drop --proto → 1 · accept http:// → 4 · drop the CA check → 2 · default back to http → 5 · break the default CA path → 3 · deploy.yml naming an http address → 1
the pre-change script against the head tests 34 FAIL lines, as the body says
the pin is cockpit's committed CA sha256sum both 5a62c5816adbd382d4bfce8fe1ccb774f7e10173b391abafb90acf2c516fb13a; openssl verify of cockpit's server.crt against it → OK; CA:TRUE, pathlen:0, name-constrained to 10.12.0.143/32 and 127.0.0.1/32, notAfter 2036-11-14
the CA path production actually uses (no SEMAPHORE_CA_FILE anywhere in deploy.yml) driven by hand: curl reached verification with the committed file; the suite's three "refusal names the variable" cases drive the same default (mutating it reds 3)
the token is written only after the gate require_tls at :178 precedes make_config at :179; the http case's assert_no_secret_file pins it
required contexts at this head pr-checks / check (pull_request) success · plan / stack-plan-check (pull_request_target) success (branch protection read)
cockpit's cutover run 123 on 981c986 green in 5m17s, so the server this pin points at is live

Could not verify

  • No request was made to 10.12.0.143 from this host. The TLS behaviour above is
    driven against loopback stubs; the "wrong version number" red the body measured
    against a plain-http listener was not re-driven here, only read.
  • Whether the live server on 143 presents the committed leaf: read from cockpit's
    main, not from the running guest.

Named, not charged

  • mutants-deploy-script.sh is not in this tree. The kills above are my own wave;
    the body's nine-mutant table stays the author's own tooling and is credited as such.
  • THE-106's third want (an expiry and a rotation path for the ci-* tokens) is
    deferred to the design's rollout step 4 and recorded in the header (:36-41).
    Nothing in this diff mints a token, so there is nothing here to charge.
  • AGENTS.md §Code comments asks for a docs/ page instead of a long comment.
    The change does both — the header block grows and docs/deploy.md:31-37 carries
    the same explanation — but THE-106 requires the header to stop citing STD-2, so
    the header's presence is the ticket's, and its length is the file's existing shape.
  • .forgejo/workflows/deploy.yml moved by four comment lines (:32-35). The four
    that compose a gate did not move: the workflow file (comments only), the required
    contexts (pr-checks / check (pull_request), plan / stack-plan-check (pull_request_target) — unchanged, green), the job name (deploy), and the target
    (scripts/semaphore-deploy.sh start). The deploy workflow publishes
    deploy / deploy (push), which is not a required context. I read this as a content
    change rather than a gate change; the four are named here so a human can overrule
    that reading rather than inherit it.

Summary. Standards: 1 finding (1 advisory, 0 blocker). Spec: 1 finding (1
advisory, 0 blocker). Worst in Standards: the userinfo leak on the failure path
(A1). Worst in Spec: the false "not pushed / no CI" sentence (S1). Two advisories
and no blockers — under three, so the recommendation is merge; both travel as
advice, and neither earns a round trip on its own.

<!-- minos review-loop: repo=olympus/infra-silo pr=40 head=af86311ea19106f9e471663f5c8ac063ba079571 round=1/5 axes=standards,spec --> **olympus/infra-silo#40** · head `af86311` · round **1/5** · axes: standards, spec The dispatch numbered this round 0; no review is on the thread yet, so the ledger's rule (reviews posted + 1) makes this round 1. Spec: paperclip `THE-106` and its `design` document, read live. Standards: `AGENTS.md` at the head (no `CONTRIBUTING.md` in this repo) and `olympus/workshop` `docs/adr/` at `6cc25e62` (no record governs this change). Recommendation: merge ## Standards **A1 · ADVISORY · `scripts/semaphore-deploy.sh:159`, against the new gate at `:103-121`** The gate refuses a *scheme* it does not know, but an https URL whose authority carries userinfo is accepted, and the start-failure line then prints `${BASE}` verbatim — so a password reaches the job log. Reproduced by hand against a TLS stub (probe at `cache/scratch/the106/leakprobe.sh`, wrong pin forced): ```text SEMAPHORE_API_URL=https://runner:hunter2@127.0.0.1:33443 (CA not the stub's) → curl: (60) SSL certificate problem: unable to get local issuer certificate → semaphore-deploy: the deploy task could not be started at https://runner:hunter2@127.0.0.1:33443: no answer ``` The new header (`:95-101`) says an address can carry a credential and is "refused without any of it printed", and the suite pins exactly that for the no-scheme shape (`scripts/tests/semaphore-deploy.test.sh:304`). The https+userinfo shape is the same class and is neither refused nor redacted. Line 159 is not in this diff, so this is an advisory, not a blocker. One line clears it: refuse a `$BASE` whose authority carries `@`, beside the scheme test in `require_tls`. ## Spec **S1 · ADVISORY · PR body, "Evidence"** "The branch has not been pushed, so no CI run is cited here" is false at this head: the forge carries two green runs on `af86311` (#837 `pr-checks` 45 s, #838 `plan` 18 s), and the combined status reads `success` for both required contexts. Every number the body reports reproduces locally, so the claim about behaviour is unaffected — only that sentence about CI. Nothing in THE-106 is missing or partial here. Its done-when ("no deploy workflow sends a Semaphore token over http", "the script headers no longer cite TR-66 STD-2") holds: `grep -rn 'TR-66\|STD-2'` over the head answers nothing, the workflow carries no address of its own, and `:63` makes https the default with a refusal for anything else. ## Verified | Probe | Result | | --- | --- | | `mise exec -- make check` in a worktree at `af86311` | exit 0: `semaphore-deploy` 93 assertions 0 FAILED, `deploy-workflow` 53, `store-wait` 40, `service-key` 36, `key-mint` 194, `env-test` 74, `key-audit` 39; `tofu validate` `Success!` | | mutants of the new code (my wave, head restored, `git status` clean) | drop `--cacert` → 20 FAIL · drop `--proto` → 1 · accept `http://` → 4 · drop the CA check → 2 · default back to http → 5 · break the default CA path → 3 · `deploy.yml` naming an http address → 1 | | the pre-change script against the head tests | 34 FAIL lines, as the body says | | the pin is cockpit's committed CA | `sha256sum` both `5a62c5816adbd382d4bfce8fe1ccb774f7e10173b391abafb90acf2c516fb13a`; `openssl verify` of cockpit's `server.crt` against it → `OK`; `CA:TRUE, pathlen:0`, name-constrained to `10.12.0.143/32` and `127.0.0.1/32`, notAfter 2036-11-14 | | the CA path production actually uses (no `SEMAPHORE_CA_FILE` anywhere in `deploy.yml`) | driven by hand: curl reached verification with the committed file; the suite's three "refusal names the variable" cases drive the same default (mutating it reds 3) | | the token is written only after the gate | `require_tls` at `:178` precedes `make_config` at `:179`; the http case's `assert_no_secret_file` pins it | | required contexts at this head | `pr-checks / check (pull_request)` success · `plan / stack-plan-check (pull_request_target)` success (branch protection read) | | cockpit's cutover | run 123 on `981c986` green in 5m17s, so the server this pin points at is live | ## Could not verify - No request was made to `10.12.0.143` from this host. The TLS behaviour above is driven against loopback stubs; the "wrong version number" red the body measured against a plain-http listener was not re-driven here, only read. - Whether the live server on 143 presents the committed leaf: read from cockpit's `main`, not from the running guest. ## Named, not charged - `mutants-deploy-script.sh` is not in this tree. The kills above are my own wave; the body's nine-mutant table stays the author's own tooling and is credited as such. - THE-106's third want (an expiry and a rotation path for the `ci-*` tokens) is deferred to the design's rollout step 4 and recorded in the header (`:36-41`). Nothing in this diff mints a token, so there is nothing here to charge. - `AGENTS.md` §Code comments asks for a `docs/` page instead of a long comment. The change does both — the header block grows and `docs/deploy.md:31-37` carries the same explanation — but THE-106 requires the header to stop citing STD-2, so the header's presence is the ticket's, and its length is the file's existing shape. - `.forgejo/workflows/deploy.yml` moved by four comment lines (`:32-35`). The four that compose a gate did not move: the workflow file (comments only), the required contexts (`pr-checks / check (pull_request)`, `plan / stack-plan-check (pull_request_target)` — unchanged, green), the job name (`deploy`), and the target (`scripts/semaphore-deploy.sh start`). The deploy workflow publishes `deploy / deploy (push)`, which is not a required context. I read this as a content change rather than a gate change; the four are named here so a human can overrule that reading rather than inherit it. --- **Summary.** Standards: 1 finding (1 advisory, 0 blocker). Spec: 1 finding (1 advisory, 0 blocker). Worst in Standards: the userinfo leak on the failure path (A1). Worst in Spec: the false "not pushed / no CI" sentence (S1). Two advisories and no blockers — under three, so the recommendation is **merge**; both travel as advice, and neither earns a round trip on its own.
pit merged commit c5e942e323 into main 2026-12-01 16:45:52 +00:00
pit deleted branch hermes/THE-106-semaphore-https 2026-12-01 16:45:52 +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-silo!40
No description provided.