operator-session: the private-path gate cannot complete the OIDC token exchange — kanidm's own cert is signed by a CA outside the guest's trust store (sig b5659a2277df) #1240
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Reference
Matou/idss#1240
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
The failure
Archive drive run 6 (
test-results/private-path/20260905T195921Z, commit490a6262) —founding-prefixGREEN (682 s),operator-sessionRED after 63 s (artifacts/legs.json). The door marker recordshttps://admin.e2e-drive.idss.internal:38595/→ 302, so #1238's apex mapping and #1236's front-door address both still hold: the drive reaches the gate.The leg dies at the OIDC callback, on the page's own words:
This is the follow-on
490a6262's commit message named and deliberately kept separate ("the guest kanidm'sorigin = https://localhost:<port>steers the discovery doc … file a NEW ticket if it reds"). #1239's fix WORKED and is not in question — see the evidence below.Evidence
#1239 is proven good.
logs/guest-kanidm.log, 20:14:41–20:14:42:GET /oauth2/openid/gate-oidc/.well-known/openid-configuration→ 200 (was the #1239 404).GET /ui/oauth2?client_id=gate-oidc&code_challenge=…&redirect_uri=https%3A%2F%2Fe2e-drive.idss.internal%2Fauthz%2Fcallback→ the operator's passkey login succeeds (Issuing Cookie session (privilege_capable) … for operator@localhost),GET /ui/oauth2/resume→ 303. No consent screen —vmGuestGateConsentBlockworked too.So the front-channel is complete: kanidm handed the gate a real authorization code. The back-channel is what fails.
The defect.
logs/guest-control-plane.log:144:kanidm's own mirror of the same handshake,
logs/guest-kanidm.log(last line, 20:14:42):The gate connected, was offered a certificate, and sent
bad_certificate. The error surfaces assignin_exchangeatinternal/controlapi/signin.go:191-192, wrapped atinternal/controlapi/oidcprovider.go:205.The chain, cited
The origin steers the discovery doc.
internal/clan/vmguest.go:674renders the private-path guest's kanidm withorigin = "https://localhost:%d"(g.KanidmPort— the laptop-side hostfwd port, the browser's WebAuthn origin). Rendered asorigin = "https://localhost:39677"in this run:state/clan-config/machines/gateway/gateway-guest.nix:123. kanidm derivestoken_endpoint/userinfo_endpointfrom that origin, so the gate is handedhttps://localhost:39677/oauth2/token.That port reaches kanidm raw.
idpLoopbackBridge(internal/clan/vmguest.go:1570-1581, rendered atgateway-guest.nix:352,listenStreams = [ "127.0.0.1:39677" ]) forwards it to kanidm's0.0.0.0:8443. Connectivity is fine — that is exactly the fault this bridge closed for Nextcloud's user_oidc (drive20260810T134228Z). What it does NOT do is change which certificate answers.Kanidm's own cert is signed by a CA the guest does not trust.
gateway-guest.nix:125servestls_chainfrom thekanidm-tlsgenerator (internal/clan/vmguest.go:676). The guest's trust store carries only thefront-door-tlsCA —internal/clan/frontdoor.go:637-648embeds that one repo value intosecurity.pki.certificates. Nothing anywhere adds thekanidm-tlsCA. (The kanidm provisioning tool sidesteps this withacceptInvalidCerts = true,gateway-guest.nix:131-133/vmguest.go:683— a tell that this cert has always been untrusted on this path.)This is also why discovery succeeded but the exchange did not: discovery goes to
https://id.<apex>/…through Caddy, whose cert IS front-door-CA-signed; the exchange goes tohttps://localhost:39677and gets kanidm's leaf.The gate's HTTP client is the bare default.
control-plane/cmd/control-plane/main.go:1208builds the gate provider ascontrolapi.NewKanidmOIDC(hostnames.IDP(apex), GateOIDCClientID, gateSecret, nil)— a nil httpClient, whichinternal/controlapi/oidcprovider.go:116-119turns into&http.Client{Timeout: 15s}over the system trust store.A stale doc comment that will mislead the fixer
internal/controlapi/oidcprovider.go:81-83claims:That is not true.
gatewaySelfTrustUnit(internal/clan/vmguest.go:712-745) only mints an SSH keypair, self-authorizes it and pins the guest's own host key. It touches no CA and no trust store. Whatever the fix, that comment needs correcting in the same commit.Why this needs a ruling (refusal rule 3 — product-behaviour surface)
I refused to heal this. Every candidate fix changes what a deploy renders or what the gate trusts, and they are mutually exclusive design choices:
kanidm-tlscaintosecurity.pki.certificatesfor the private guest (vmguest.go), the wayfrontdoor.go:637-648already does for the front-door CA. Notekanidm-tls'sfiles.cais currently a secret var, whereasfront-door-tls's issecret = falseprecisely sosecurity.pkican read it while nss-cacert BUILDS (frontdoor.go:637-642, drive20260810T004041Z) — so this shape needs the generator's file set changed, which GOTCHAS #5 /TestGeneratorFileSetsArePinnedguard.main.go:304-317already builds one fromIDSS_KANIDM_CA_FILE, which the control-plane unit already exports (vmguest.go:927). This is a trap as a one-liner:internal/kanidm/kanidm.go:125-135builds a pool containing ONLY the supplied CA, with no system roots. Handing that client toNewKanidmOIDCwould fix the private path and BREAK the public one, whereid.<apex>carries the front door's public cert. It needs a merged pool (system roots + the kanidm CA) — a new trust-posture decision, not a rewire.founding-prefix, and the reason the origin is the forwarded localhost port in the first place (vmguest.go:645-651).A fix also has to state where the PUBLIC path stands: there kanidm sits behind Caddy on a publicly-trusted cert, so whichever shape is chosen must leave it untouched, and the render pins should say so.
Not in question
The leg's check is honest and unchanged.
app/tests/e2e/fixtures/provision.ts:903-916reported the product's own error JSON verbatim after the 4-step landing race found neither dashboard, login form, nor consent prompt; the dashboard-chrome expectation atprovision.ts:921-924was never reached. No selector drift, no wait ceiling, no fixture defect — the drive did its job.Absent evidence, for the record
This run directory carries no
droplet-journal.txtand no top-levelerror-context.md(the Playwright one is atartifacts/provision-archive.live-pro-5f401-rchive-healthy-→-Omeka-door/error-context.md).logs/guest-files-oidc.logis an SSH failure, not data (journalctl … Failed to add filter for units: No data available— thenextcloud*/kanidm-provision*units do not exist under those names on this guest);logs/state-logs.logrecordsno state logs directory.artifacts/host.jsonshowsqemu: ENOENTbecause the guest was already torn down at harvest. None of these bear on the diagnosis — the control-plane and kanidm journals both name the fault directly.drive
20260905T195921Zred atoperator-session:the admin-door sign-in reached neither the dashboard, a login form, nor a consent prompt at https://e2e-drive.idss.internal/authz/callback?code=eyJhbGciOiJBMTI4S1ciLCJlbmMiOiJBMTI4R0NNIiwia2lkIjoiNjE4evidence:
/home/swarm/swarm/Matou/idss/test-results/private-path/20260905T195921Zon matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was capturedRULED (agent, two-way under ADR 0174 — Ben vetoes async): shape B, done right — the gate's OIDC client trusts the community IdP's own CA IN ADDITION to the system roots. A (re-plumb
kanidm-tls.cafrom secret to public sosecurity.pkican embed it) touches the pinned generator file set (GOTCHAS #5,TestGeneratorFileSetsArePinned) and widens the whole guest's trust store for one consumer; C (re-shape the private-path kanidm origin) is the private path's WebAuthn-origin design (ADR 0129), not this ticket. B is the narrow, consumer-scoped fix — and the guest ALREADY exportsIDSS_KANIDM_CA_FILEto the control-plane unit (vmguest.go:927), whichmain.go:304-317already reads for the kanidm admin client.What to build
control-plane/cmd/control-plane/main.go:1208/1210: whenIDSS_KANIDM_CA_FILEis set, handNewKanidmOIDC/NewBridgeOIDCan*http.ClientwhoseTLSClientConfig.RootCAsisx509.SystemCertPool()PLUS the PEM from that file (15 s timeout as today). Unset ⇒nilas today, so the public path is byte-identical. Do NOT reuseinternal/kanidm.Client's pool builder as-is:kanidm.go:125-135builds a pool of ONLY the supplied CA with no system roots — the trap the healer named; either add a merged-pool constructor there and use it from both call sites, or build it locally in one small function.internal/controlapi/oidcprovider.go:81-83("the control-plane self-trust unit adds the guest CA on the private path" — it does not;gatewaySelfTrustUnitmints an SSH keypair only).httptest.NewTLSServer-style token endpoint under a private CA — the gate provider built with that CA file completes the exchange; built withnilit failsx509: certificate signed by unknown authority; AND the merged client still verifies a system-trusted chain (assert the pool is seeded fromSystemCertPool, not CA-only).go test ./control-plane/... ./internal/controlapi/green.Close = #1235's next run passes
operator-session(callback → dashboard chrome). If it reds one step LATER (S2b browse etc.), that is a NEW ticket.close-report for #1240 — status
success✅ close-report gates passed — every claim verified against main; issue closed.
envelope