oidc-admin: files-oidc-secret is rendered root-owned, so idss-idp can't read it #1029
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
1 participant
Notifications
Due date
No due date set.
Blocks
Reference
Matou/idss#1029
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?
What failed
Leg 19
oidc-admin, the last leg the drive ran.verdict.json: 20 legs, 19 green, 1 red, 0 skips. Notepairis green (99 ms) andlegs.jsoncarries no skip reasons at all — this is not the known own-VPS pairing frontier. It is a new, specific defect.The failure, in the drive's own records
artifacts/verdict.json/artifacts/legs.json:The live box names the real fault.
journalctl -u idss-idp(two attempts, both inside the oidc-admin window — the drive ended 10:38:46):Why the bridge has no secret: file ownership
Live box,
/run/secrets/vars/— the bridge's three secrets side by side:The unit is
User=idss-idp/Group=idss-idp;id idss-idp→uid=999(idss-idp) gid=999 groups=999(idss-idp)(nokeys). Probed directly:The unit does export the right path (
Environment="IDSS_IDP_FILES_SECRET_FILE=/run/secrets/vars/files-oidc-secret/secret") and the file does exist, 32 bytes, written 10:37 — before the bridge's 10:37:50 restart. Only the read bit is wrong.Nextcloud's half got the secret fine, because its oneshot runs as root and root bypasses DAC —
logs/droplet-journal.txt:1890:32 characters — exactly the file's size. So Nextcloud presents a correct secret and the bridge holds none; hence
has no secret provisioned yetrather thaninvalid client secret. That asymmetry is the whole bug.The defect in source
internal/clan/files.go:963, inrenderFilesOIDCSecretGenerator:No
owner/group/mode. clan's default is root:root 0400 — a default this repo already documents atinternal/clan/netbird.go:311("files.key default owner is root 0400"). Every other secret the bridge reads sets it explicitly, e.g.internal/clan/idssidp.go:311and:330:And the failure is swallowed rather than raised:
internal/idp/config.go:155reads it viareadFileTrimmed, which (config.go:289-300) "returns "" for an empty path or a read error". So EACCES is indistinguishable from "files not placed yet", and the bridge booted loggingclients=3with a secretless confidential client instead of refusing.Downstream, confirmed
Browser network log from
trace.zip(1-trace.network) — the OIDC hop up to the token exchange all works, then dies:No user was ever provisioned. Live box:
Suspected layer
Infra / product render — the Nix render of the shared
files-oidc-secretclan var. Not the harness and not the KERI or bridge logic: the gate-oidc hop, the twelve-word challenge, and the silent SSO all worked (the trace showsauthorize?client_id=nextcloud→login?authRequestID=...302ing straight through with no re-prompt, so #1027's fix holds; the client is found by name, so #1026/1024's fixes hold).Two harness bugs this red exposed (secondary — fix after the render)
oidcSignInViaBridge(app/tests/e2e/fixtures/idip.ts:314) gates on#headerand returned clean off user_oidc's 403 "Access forbidden" page. The trace shows that page pullingcore/css/guest.cssandapps/theming/...— Nextcloud's guest layout, which does carry#header. The comment atapp/tests/e2e/fixtures/provision.ts:773asserts#headeris "absent from both the login page and the error page"; that is false on Nextcloud 32. The red should have landed at sign-in, naming the token exchange.assertOperatorIsAdmin's message misattributes. I verified on the box that an unauthenticated/settings/adminreally is401(curl -H 'Host: files.rehearsal-b.idss.nz' http://127.0.0.1:8084/settings/admin→HTTP 401). But the drive never saw it: the trace shows303 /settings/admin→302 /login?redirect_url=/settings/admin→303 /apps/user_oidc/login/1?redirectUrl=...→ bridge →403 /apps/user_oidc/code. Playwright'sresp.status()is the code endpoint's 403 at the end of the redirect chain, so the assert blamed "not an admin session" for a failed token exchange. It should readpage.url()and say so when it did not end at/settings/admin.What plugging it needs
renderFilesOIDCSecretGenerator(internal/clan/files.go:955-968), emit the owner explicitly, matching theidssidp.go:311/330precedent:files.secret = { owner = "idss-idp"; group = "idss-idp"; mode = "0400"; };Root still reads it, so Nextcloud's root-run
occoneshot is unaffected. One caveat that may need a human ruling: this generator isshare = trueacross the gateway and a member files device (ADR 0210 ruling 3,files.go:947-954), andidss-idpdoes not exist as a user on a files-only device, where a literal owner would fail to chown. Either scope the owner per-machine or give the file a group both consumers hold. On the one-droplet rehearsal topology the flat fix is correct and sufficient — a swarm agent can land it and green this drive without waiting on the split-topology question.internal/idp/config.go:155, distinguish "path unset" (files not placed — legitimately fine, as the comment intends) from "path set but unreadable" (a render bug) and refuse to boot on the latter. That turns this into a red at 10:37:50 with the real reason, instead of a Nextcloud 403 seven minutes later.owner = "idss-idp".internal/clan/files_idp_gateway_test.go:57-59already checks the generator name and its.pathconsumer, but nothing checks ownership — which is why this shipped.What is absent from this run directory
nextcloud.log.occ config:system:get logfileis unset and nothing matches under/var/lib/nextcloud/data, so there is no Nextcloud-side record of the code-exchange failure. The bridge journal and the Playwright trace carry it instead.logs/guest-*.logare stubs — "no SSH hostfwd in ~/.config/systemd/user/idss-guest.service — the guest was never created, so there is nothing to ask", andartifacts/host.jsonrecords"qemu": "exit ENOENT: spawn qemu-system-x86_64 ENOENT". Expected: this was a droplet drive, not a VM-guest one.artifacts/legs/oidc-admin.pngis not evidence for this leg — it shows the Electron founding window, because the leg opens its ownbrowser.newContext()and the leg-screenshot hook captured the app page.artifacts/nextcloud/holds onlylogin.png, nosigned-in.png. The trace is the only visual record of the failing context.The live box was reachable throughout;
systemctl --failed --no-legendreturned empty (the earlieridss-idphealth-wait timeout at 10:33:32–10:34:30 self-healed on restart at 10:34:36 and is unrelated to this red).drive
20260830T102650Zred atoidc-admin:GET /settings/admin returned HTTP 403 — not an admin session (an unauthenticated session gets a 401 here)evidence:
/home/dev/swarm/Matou/idss/test-results/drive-idip/20260830T102650Zon matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was capturedswarm-claim host=matou-dev-server-01 run=14480
(automated multi-host claim — lowest live claim id works this ticket)
close-report for #1029 — status
success⛔ close-report gates REFUSED this close — the following claims did not verify:
envelope
close-report for #1029 — status
success✅ close-report gates passed — every claim verified against main; issue closed.
envelope