The secrets deploy speaks https to Semaphore and pins its CA (THE-106) #61
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!61
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "hermes/THE-106-semaphore-https"
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?
Summary
The secrets deploy reaches Semaphore over TLS only, pinned to the CA that
olympus/infra-cockpitcommits for it.SEMAPHORE_API_URLdefaults tohttps://10.12.0.143:3000. There is no-kand 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-secrets's token may reach and where it is kept (secret/ci/secrets/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
designdocument carries the four ADR checks and the pinned 2.19.16 behaviour).Evidence
http://10.12.0.143:3000, the token crossed the LAN in cleartext, and the header said so and cited STD-2.make checkexits 0 on this tree (fresh shallow clone ofmainatf96a05b, thenmise exec -- make check): 591oklines, 0FAILlines, rc 0. Per suite:env-check: the pin and the map agree.;env fetch: every case passed.;mcp-env-check: the map, the unit and the file agree.;mcp-env tests: all cases pass.;plan tests: every case passed.;rotation tests: all passed;snapshot-test: every assertion holds.;prod-test: 8 assertions, 0 FAILED.;semaphore-deploy tests: 94 assertions, 0 FAILED.;deploy-workflow tests: 53 assertions, 0 FAILED.;service-key tests: 33 assertions, 0 FAILED.;verify tests: 9 assertions, 0 FAILED.The two touched suites grow from 63 to 94 and 50 to 53 assertions on pristinemain.scripts/semaphore-deploy.shkills all nine, each linekilled: pin dropped fromCURL_TLS; default address http; https gate accepts http;startdoes not callrequire_tls; protocol pin dropped;curltold to skip verification; onecurllosesCURL_TLS; missing CA no longer refused; scheme check case-folded away.sha256sum scripts/semaphore-ca.crtis5a62c581…fb13a, byte-identical (cmp) tosemaphore/service/files/ca.crtonolympus/infra-cockpit'smain(981c986, merged as !36). Its committed leaf carriesIP:10.12.0.143, IP:127.0.0.1;openssl verify -verify_ipanswers OK for both andIP address mismatchfor another address.SEMAPHORE_API_URLno longer nameshttp://10.12.0.143anywhere, andSTD-2appears in no file of the tree.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#36merged at 16:19:35Z (981c986), and its deploy (run 123) must be green,make verifyincluded, before this merges. Before that this repository's own deploy goes red at its first request ('wrong version number') and applies nothing — the no-fallback property working, not a broken job. Because this deploy is what applies the store's policies and roles to 144, a red deploy would also stop any later store change from reaching it, so merging early freezes the store's policy until #36 lands.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.
Review started (round 0/5) on
048d28cbf1— reading the diff now.olympus/infra-secrets#61 —
olympus/infra-secrets· PR #61 · head048d28cb· round 1/5 · verdict: fix.Round 1 of 5: the dispatch's sign-on line numbered this 0/5, but the thread carries no earlier review, so the first round of record is 1 and its delta is the whole head against
f96a05b(the merge base, andmain's tip).Recommendation: fix
The dispatch puts the change's class outside the decision — the state is the findings' — so that is the narrowing I applied. For the record, the class itself:
pr-checksandplanand their contexts, job names and targets are untouched, anddeploy.ymlmoves in comments only (.forgejo/workflows/deploy.yml:30-33), publishingdeploy / deploy (push)rather than a merge gate. No destroy or replace: the change pins how the job authenticates to Semaphore;make prod's steps are unchanged.Standards
ADVISORY —
scripts/tests/semaphore-deploy.test.sh:289—assert_no_secret_file 'and the token was never written to a file' "$LEAK"cannot fail for the reason its name gives, so the header's "before the token is written anywhere" (scripts/semaphore-deploy.sh:31-32) is unpinned. The only filestartwrites is the 0600 config, andcleanup(scripts/semaphore-deploy.sh:75-79) removes it at exit regardless of order; the assertion therefore reads an empty directory either way. Proved as a mutant:require_tlsandmake_configswapped (scripts/semaphore-deploy.sh:172-173) — suite rc 0, 93 ok, 0 FAIL — whilebash -xof that same mutant showsmktemp,chmod 600and the bearer line written beforerequire_tlsrefuses. Smallest clearing change: in the http case (scripts/tests/semaphore-deploy.test.sh:280-290) point the run'sTMPDIRat a directory it cannot write to, so a reorder turns the refusal intono temporary file for the tokenand the case reds on itsis a http addressassertion.ADVISORY —
scripts/tests/semaphore-deploy.test.sh:348— the textual pin names two of the three options the docs promise;--tlsv1.2is unpinned. Mutant:--tlsv1.2dropped fromCURL_TLS(scripts/semaphore-deploy.sh:114) — suite rc 0, 93 ok, 0 FAIL — whilescripts/semaphore-deploy.sh:33anddocs/deploy.md:32both say every call carries it. Clearing: add--tlsv1.2to that grep.ADVISORY —
scripts/tests/semaphore-deploy.test.sh:268-270(withscripts/tests/semaphore-stub.py:78-80,122) —assert_nothing_reachedis blind to exactly the case it is used for. The stub records inside the handler and wraps the listening socket, so a cleartext dial fails its handshake beforerecord()ever runs. Measured on the stub as the suite starts it: a TLSGETwrote 1 line torequestsand toauth; the identicalGEToverhttp://carryingAuthorization: Bearer stub-tokenleft both at 1 — curl answered(56) Recv failure: Connection reset by peer, so the token was on the wire and the record did not move. The case still stands on its exit and message assertions, which is why this is an advisory and not a block, but "and nothing was sent" currently proves nothing about a cleartext send. Clearing: record the connection before the handshake (overrideget_requestto log the peer, then wrap that connection), so the http case reds when a cleartext request is sent.No documented-standard breach:
AGENTS.md,docs/, and the org records inolympus/workshopdocs/adr/atorigin/main(15 records, 0001–0015, read at the head; the local clone carries the same list, checked withgit ls-tree origin/main docs/adr/) were read and none is contradicted. No smell worth charging:require_tlscentralises the gate rather than repeating it, andCURL_TLSis the one thing both call sites share.Spec
Spec source, in the order read: the PR body (its Summary, Evidence and Merge Danger), then
paperclip:THE-106read live through the control plane (GET /api/issues/THE-106→ 200) and itsdesigndocument (Design: native TLS on Semaphore (143), pinned by every client), thenolympus/infra-cockpitorigin/mainfor the sibling half and the CA it commits.No findings. Every requirement this repository's half of THE-106 states is met at this head:
SEMAPHORE_API_URLhttps in this repo's script and workflow, no cleartext fallbackscripts/semaphore-deploy.sh:57defaults to https;:97-115refuses any other scheme before any call;http://occurs in no code line (suite case at:331-336passes)grep -rn 'STD-2|TR-66'over the tree: 0 matches;http://10.12.0.143occurs in no file — the address's three literals are two https defaults and the comment that explains the userinfo refusal--proto+--cacerton every call, missing CA redscripts/semaphore-deploy.sh:97-115, called at:172beforemake_configat:173scripts/semaphore-deploy.sh:36-41) and matches the design's Decision table and Rollout step 4Prose claims re-driven, not read:
sha256sum scripts/semaphore-ca.crt=5a62c581…fb13a,cmp-identical to cockpit's committed copy5a62c5816adbd382d4bfce8fe1ccb774f7e10173b391abafb90acf2c516fb13a, againstinfra-cockpitorigin/main981c986semaphore/service/files/ca.crtopenssl verify -verify_ipanswers OK for.143and127.0.0.1,IP address mismatchfor10.12.0.99ci-<repo>token with no expiry, tosecret/ci/<repo>/semaphore-apiinfra-cockpitorigin/maindocs/deploy.md:190-195make check590ok, 0FAIL, rc 0; the two suites 63→93 and 50→53f96a05b981c986and its deploy run 123 green before this mergesdeploy / deploy (push)at run 123 issuccess, 5m17s, 16:24:54ZThe suite is not a test that cannot fail: the head's suite run against the base script (
f96a05b:scripts/semaphore-deploy.shin an otherwise head tree) is 34 FAIL / 59 ok, so the new cases do pin the change — the three advisories above are the parts of it they do not pin.Named, not charged
scripts/semaphore-deploy.sh:153echoes${BASE}in the start-failure message, so an https address carrying a userinfo pair would reach the job log there — the same hazardrequire_tlsis careful about on the refusal path. That line is unchanged by this diff (basef96a05b:scripts/semaphore-deploy.sh:118) and the refusal path prints the scheme alone, so it is named, not charged.no-gate30,default-http5,drop-proto1,drop-cacert20,gate-accepts-http4,-k4, cleartext-fallback 8;drop-tls12andconfig-firstsurvive and are the two advisories above).Summary
One blocker-free change, and the recommendation turns on the count — three advisories, a single batched round, not on the weight of any one of them.
Waiting — queued behind olympus/workshop#57 (one fix run at a time). The fix run resumes on its own at Tue 1 Dec, 17:32 (Europe/Madrid); nothing is needed from you. This retry does not count as a review round.
Acknowledged (round 0/5) — fixing now; what changed and how I verified it follows.
Round 1/5 — the dispatch's sign-on line reads round 0 of 5; the review it dispatched is round 1/5 (no earlier review on the thread, so its round 1 is the whole head against
f96a05b). I followed the review's numbering and this is that round's fix. The dispatch's "fix every BLOCKER" is the loop's fixed text: the report carries 0 blockers, 3 advisories on Standards and 0 findings on Spec,Recommendation: fix— the volume rule makes the round these three, batched into one commit.Head:
048d28c→1e7ab3a. Two files touched:scripts/tests/semaphore-deploy.test.shandscripts/tests/semaphore-stub.py.scripts/semaphore-deploy.shis not touched — all three findings are about what the suite can lose, and the script was already right.semaphore-deploy.test.sh:289— the "never written to a file" assertion cannot fail1e7ab3asemaphore-deploy.test.sh:348—--tlsv1.2unpinned1e7ab3asemaphore-deploy.test.sh:268-270/ stub:78-80,122—assert_nothing_reachedblind to a cleartext dial1e7ab3aPATCH, not a commit1 — the ordering the header claims is now what the case reds on
Implemented, with one deviation from the prescribed shape. The stub now records a peer
<host>:<port>in a newconnectionsrecord and the http case asserts the stub was never dialled. But "a file left behind" and "the server was never dialled" cannot be observed in the same run: withTMPDIRpointing at a path that does not exist,make_configfails before any curl call, so the wire is never reached — which is exactly what makes the ordering observable. So the case is now two:an address that is not https—TMPDIRleft as it is, somake_configwould succeed: asserts the scheme is named, nothing else of the address, andassert_nothing_connected.and refused before the token file could be made—DEPLOY_TMPDIR=$TMP/no-tmpdir, a path that does not exist. The job still names the scheme, sorequire_tlsdemonstrably ran first; amake_configmoved in front of it answersno temporary file for the tokenand this assertion reds.I used a nonexistent path rather than an unwritable one because an unwritable directory is unwritable only for a non-root user, and this suite also runs as root on a runner image. The assertion that could not fail is gone rather than kept beside the new one; the 0600 file's removal on exit is already covered by
the poll leaves no token file behind.2 —
--tlsv1.2counted with the other twoThe pin now reads the three options off the assignment that names any of them (the bare
CURL_TLS=()declaration above it is not that line) and reports which one is missing:3 — the stub records the dial it used to hide
QuietServerno longer wraps the listening socket. The plain socket accepts in an overriddenget_request(), the peer is appended toconnections, and only then is the connection wrapped for TLS; a failed handshake closes the connection and re-raises, whichsocketservercatches asOSError.requestsandauthkeep their meaning (requests that completed), and the two records differ by exactly the failed handshakes.Probed directly, as the suite starts the stub — one cleartext
GETcarryingAuthorization: Bearer probe-token:with a verified TLS
GETafter it:connections2 lines,requests1.Left alone deliberately: the wrong-CA case (
:272-278) keepsassert_nothing_reached, notassert_nothing_connected. There a dial does happen and the request does not — the certificate is refused mid-handshake — so "never dialled" would be a false statement about a correct script. The other four refusal cases (http, no scheme, userinfo, missing and empty CA) now assertconnections, which is the stronger claim and true of them.Verification
AGENTS.mdnamesmake checkas the credential-free floor and the PR'spr-checks / checkruns it; there is noCONTRIBUTING.mdand no other check target. Run through the manager the repo declares:The two touched suites are now 94 (was 93) and 53. The net +1 is one new case in this round against one vacuous assertion removed: the count moved because the artefact changed, not because coverage did.
The three findings are killed by mutants that were green at
048d28c, each applied toscripts/semaphore-deploy.shand reverted:048d28c1e7ab3amake_configmoved in front ofrequire_tlsand the red is the scheme, not a token file that could not be made--tlsv1.2dropped fromCURL_TLSCURL_TLS does not carry [--tlsv1.2]--protodropped (a cleartext request reaches the wire)and the server was never dialled, so nothing was sent (the stub was dialled by: 127.0.0.1:56608 )Also green before pushing:
bash -non the suite,python3 -m py_compileon the stub.mise.lock, the Makefile and the workflows are untouched, sodeploy / deployandplan / guest-plan-checkpublish no new context.PR body, not a commit
The body's Evidence carried the numbers this round moved.
PATCH /pulls/61set590 ok→591 ok,semaphore-deploy tests: 93→94, and63 to 93→63 to 94; read back equal on all three. Nothing else in the body changed, and theBefore:sentence and Merge Danger still describe the same change.Not left behind
No finding was disagreed with and none is open.
review/needs-review.Waiting — queued behind olympus/infra-cockpit#37 (one review run at a time). The review run resumes on its own at Tue 1 Dec, 17:49 (Europe/Madrid); nothing is needed from you. This retry does not count as a review round.
Review started (round 0/5) on
1e7ab3a29d— reading the diff now.olympus/infra-secrets#61 —
olympus/infra-secrets· PR #61 · head1e7ab3a· round 2/5 · verdict: merge.Round 2 of 5: the dispatch's sign-on line numbered this 0/5, but the thread carries one review — round 1/5 at
048d28c— so this is the second round of record. Its delta isgit diff 048d28c 1e7ab3a; the fix stacks on the reviewed head (git merge-base --is-ancestorrc 0) and touches two files, both tests.Recommendation: merge
The three prior advisories, re-driven
All three are cleared, each as a red/green pair measured in this round: the same mutant green at
048d28cand red at1e7ab3a.048d28c1e7ab3ascripts/tests/semaphore-deploy.test.sh:289— "the token was never written to a file" could not failmake_configmoved in front ofrequire_tlsinstart()and the red is the scheme, not a token file that could not be made (… mktemp: failed to create file …)scripts/tests/semaphore-deploy.test.sh:348—--tlsv1.2unpinned--tlsv1.2dropped fromCURL_TLSCURL_TLS does not carry [--tlsv1.2]scripts/tests/semaphore-deploy.test.sh:268-270/semaphore-stub.py(round 1 cited:78-80,122) —assert_nothing_reachedblind to a cleartext dial--protore-admits http, so the pin's literals stay intact and only the wire assertion can fireand nothing was sentok — the wire was reached and that case could not see itand the server was never dialled, so nothing was sent (the stub was dialled by: 127.0.0.1:57756 )The shape departs from the one round 1 proposed in a single place, and the departure is the better reading: the ordering claim is pinned by a run whose
TMPDIRcannot exist, so a hoistedmake_configfails loudly, while the wire claim is pinned by a separate case that leavesTMPDIRalone. Both claims the round asked for are now pinned, and each case reds for its own reason rather than two in one.The stub's two records were then driven by hand exactly as the suite starts it — three clients, one stub:
so a failed handshake lands a line in
connectionsand none inrequests, which is the property the stub's docstring claims.Standards
ADVISORY —
scripts/tests/semaphore-stub.py:136— the newconnectionsrecord has no positive control in the suite: nothing asserts that a line is ever written to it, so the fiveassert_nothing_connectedcases (scripts/tests/semaphore-deploy.test.sh:293,315,328,337,342) would pass vacuously again the day that line is dropped. Proved as a mutant:append("connections", …)deleted fromget_request— suite rc 0, 94 ok, 0 FAIL. The instrument does work today (the probe above, and the third mutant's red), but only a review-time mutant says so; the suite itself would not notice its removal. That is the same vacuity round 1 charged, one layer down: the detector was fixed, its liveness was not pinned. Clearing: in the wrong-CA case (scripts/tests/semaphore-deploy.test.sh:278-284) — the one case that dials and completes no request — assertconnectionsholds exactly one line besideassert_nothing_reached. That makes a single case prove the two records differ by exactly the failed handshake, which is the stub's own claim, and it is true at this head (measured above).No documented-standard breach.
AGENTS.mdat the head namesmake checkas the floor and lists the deploy suites it runs;docs/deploy.md:31-33promises--proto '=https',--tlsv1.2and--cacerton every call, and the pin atscripts/tests/semaphore-deploy.test.sh:370-381now covers all three. The org records inolympus/workshopdocs/adr/atorigin/mainare 15 (0001–0015, plusindex.md), unchanged from round 1, and a test-only delta contradicts none of them.Spec
Spec source, in the order read: the PR body as it stands at this head — Summary, Evidence, Merge Danger, whose Evidence numbers the fixer
PATCHed, so the figures below are the body's at this revision — thenpaperclip:THE-106and itsdesigndocument, which round 1 read live; this round re-drives the claims the delta moves instead of re-fetching the ticket.No findings. The delta changes no behaviour, so no design clause can have moved; what moved is the evidence the body carries, and every figure it now states reproduces:
make checkrc 0, 591ok, 0FAIL^ oklines, 0FAIL(mise exec -- make checkat1e7ab3a)semaphore-deploy tests: 94 assertions048d28c, so the count moved with the artefact and not with a deleted casedeploy-workflow tests: 53 assertions048d28c"pr-checks / check (pull_request)success in 43s andplan / guest-plan-check (pull_request_target)success in 20s, both at1e7ab3aNamed, not charged
scripts/semaphore-deploy.shis untouched by this delta. TheBASEecho in the start-failure message round 1 named (scripts/semaphore-deploy.sh:153, a base line) is unchanged and stays named there rather than charged here.main": the 94 and 53 are re-measured above; 63 and 50 atf96a05bwere reproduced in round 1 and are not re-driven, because this delta touches nothing that produces them.Summary
connectionsrecord has no positive control, so the vacuity it was added to remove can return unnoticed.The dispatch's narrowing is applied as written — the change's class is never a reason to withhold an approval — and here it costs nothing: the delta is two test files, no workflow file, no required context, job name or target, no destroy or replace, no ADR, and
deploy / deploy (push)publishes nothing new. One advisory, so the recommendation is merge on the ledger, not on taste.