IDIP steward routes authenticate but do not authorize — any signed-in MEMBER can act as a steward #1098

Closed
opened 2026-09-01 03:47:12 +00:00 by ben · 1 comment
Owner

Problem

operatorAuthed (internal/controlapi/logstream.go:146) asks only whether an identity is present, never whose:

if _, authenticated := resolver.Resolve(r); !authenticated { ... 401 }
return true

Every IDIP steward route is gated on it — credentials (create / issue / revoke / delete), steward rotations (start / co-sign / cancel), standing (suspend / re-admit / decline) and removal. So once #1094's fix lands, any member holding a valid community SSO session — not just an operator — can call them: issue themselves a credential, revoke someone else's, suspend a member, start a steward rotation.

This is the residual half of #1094. That ticket closed the two outer holes (the honest operator being refused, and an anonymous caller forging X-Idss-Identity on the ungated portal route). This is the inner one: authentication is now real, but there is no authorization.

Why it did not bite before

On the kanidm path the panel lives at admin.<apex>, where the auth gate answers the admin pseudo-service with a genuine operator check (member.Orchestrator.GateDecision → isOperator, internal/member/komiti.go:583). The routes could lean on the route in front of them. The apex portal route is ungated by design (#512), and the IDIP dashboard is served there, so nothing in front of these routes performs that check.

What plugging it needs

The roster already knows: role: operator is what the rotation adapter promotes and demotes (Registry.Promote / Demote), and Registry.Operators() sizes the rotation majority. So the check is available — the open question is the identity mapping: the session identity comes from the bridge's OIDC subject, and this needs confirming to be the member's AID as the registry keys it, before any gate keys on it. Getting that wrong locks the founder out of their own community, so it wants a deliberate look rather than an assumed equality.

Suggested shape: an operatorAuthed variant for the IDIP families that resolves the session identity and then asks the registry whether that AID holds role: operator, refusing 403 (not 401) when it does not — with a seam test driving all three cases (no session → 401, member session → 403, operator session → 200).

Evidence

Found while fixing #1094 (drive 20260901T021405Z). See docs/GOTCHAS.md #148, closing note.

## Problem `operatorAuthed` (`internal/controlapi/logstream.go:146`) asks only whether an identity is **present**, never whose: ```go if _, authenticated := resolver.Resolve(r); !authenticated { ... 401 } return true ``` Every IDIP steward route is gated on it — credentials (create / issue / revoke / delete), steward rotations (start / co-sign / cancel), standing (suspend / re-admit / decline) and removal. So once #1094's fix lands, **any member holding a valid community SSO session** — not just an operator — can call them: issue themselves a credential, revoke someone else's, suspend a member, start a steward rotation. This is the residual half of #1094. That ticket closed the two outer holes (the honest operator being refused, and an anonymous caller forging `X-Idss-Identity` on the ungated portal route). This is the inner one: authentication is now real, but there is no **authorization**. ## Why it did not bite before On the kanidm path the panel lives at `admin.<apex>`, where the auth gate answers the `admin` pseudo-service with a genuine operator check (`member.Orchestrator.GateDecision` → `isOperator`, `internal/member/komiti.go:583`). The routes could lean on the route in front of them. The apex **portal** route is ungated by design (#512), and the IDIP dashboard is served there, so nothing in front of these routes performs that check. ## What plugging it needs The roster already knows: `role: operator` is what the rotation adapter promotes and demotes (`Registry.Promote` / `Demote`), and `Registry.Operators()` sizes the rotation majority. So the check is available — the open question is the identity mapping: the session identity comes from the bridge's OIDC subject, and this needs confirming to be the member's AID as the registry keys it, before any gate keys on it. Getting that wrong locks the founder out of their own community, so it wants a deliberate look rather than an assumed equality. Suggested shape: an `operatorAuthed` variant for the IDIP families that resolves the session identity and then asks the registry whether that AID holds `role: operator`, refusing 403 (not 401) when it does not — with a seam test driving all three cases (no session → 401, member session → 403, operator session → 200). ## Evidence Found while fixing #1094 (drive `20260901T021405Z`). See `docs/GOTCHAS.md` #148, closing note.
Author
Owner

Fixed — 8277dc0a.

Authorization now rides on the resolver as an optional Authorize half — the same shape FirstLoginObserver already takes beside GateDecider — so all 22 operatorAuthed call sites and every existing test are untouched. controlapi.StewardResolver{Session, Operators} wraps the gate's cookie resolver; operatorAuthed and stewardIdentity refuse a non-steward 403, never 401 (a signed-in member cannot fix this by signing in again, and telling them to would be a lie).

The steward test is two facts, deliberately (keria.RegistryOperators): the roster's operator role and live, receipt-confirmed membership. That second half is the point — suspend and remove both revoke Membership (DDR 0217 ruling 6), so steward power ends the moment the revocation receipts, with no role field needing to remember to change. Archived is checked explicitly too, so a removal whose revocation has not yet receipted also ends it immediately.

On the questions this raised rather than answered:

  • Does the ACDC need checking against the org AID? Not on this path: the registry holds only what this community issued from its own group AID, and the caller presents nothing, so there is no artifact to forge an issuer on. It is exactly the opposite for a credential the holder presents (#1063) — there the verifier must walk issuer AID → KEL → signing threshold → schema SAID before believing any of it, per the Mātou identity review's verification model ("ACDC includes multi-sig community AID as issuer… verifiers confirm the threshold via KEL").
  • Honest limit: this trusts the control plane's receipt-gated mirror of the TEL, not a live KEL walk — the same trust level the roster itself carries.
  • The ACDC's own role is not recorded server-side. Promote/Demote write the roster row; the membership ACDC re-issue is the steward's own signing act in the renderer. So role comes from the row and liveness from the credential. If a rotation ever lands the row without its re-issue, that drift now shows up here rather than hiding.
  • Unknown is not "allowed": a roster read that fails answers 503, never a pass, and never a 403 that would wrongly read as demotion (ADR 0100). A nil operator check fails closed.

Verified rather than assumed: no lockout. The risk I named when filing this was gating on an identifier that turns out not to match. internal/fleetwire/founderroster.go:126 registers the founder with Role: credschema.RoleOperator and a receipt-confirmed membership ("the founder is always their community's operator"), and the bridge sets sub = AID (internal/idp/storage.go:524), which is the roster's own key — so the founder passes their own gate.

Pins: TestIdipStewardAuthz_MemberIsForbiddenOperatorIsNot (403 / 200 / 401), TestIdipStewardAuthz_UnknownRefusesRatherThanGuesses (503), TestStewardResolver_NilOperatorsFailsClosed, TestStewardSessionResolver_CarriesAuthorization — that last one pins that the wiring can never silently revert to authentication-only, which is precisely how #1094 happened one layer down — and four TestRegistryOperators_* including suspension ending steward power mid-standing. docs/GOTCHAS.md #148 extended.

Checks: go build ./...; go test ./internal/... ./control-plane/... all green; gofmt clean.

**Fixed — `8277dc0a`.** Authorization now rides on the resolver as an **optional `Authorize` half** — the same shape `FirstLoginObserver` already takes beside `GateDecider` — so all 22 `operatorAuthed` call sites and every existing test are untouched. `controlapi.StewardResolver{Session, Operators}` wraps the gate's cookie resolver; `operatorAuthed` and `stewardIdentity` refuse a non-steward **403**, never 401 (a signed-in member cannot fix this by signing in again, and telling them to would be a lie). **The steward test is two facts, deliberately** (`keria.RegistryOperators`): the roster's operator role **and** live, receipt-confirmed membership. That second half is the point — suspend and remove both revoke Membership (DDR 0217 ruling 6), so steward power ends the moment the revocation receipts, with no role field needing to remember to change. `Archived` is checked explicitly too, so a removal whose revocation has not yet receipted also ends it immediately. On the questions this raised rather than answered: - **Does the ACDC need checking against the org AID?** Not on this path: the registry holds only what this community issued from its own group AID, and the caller presents nothing, so there is no artifact to forge an issuer on. It is exactly the opposite for a credential the **holder presents** (#1063) — there the verifier must walk issuer AID → KEL → signing threshold → schema SAID before believing any of it, per the Mātou identity review's verification model ("ACDC includes multi-sig community AID as issuer… verifiers confirm the threshold via KEL"). - **Honest limit:** this trusts the control plane's receipt-gated mirror of the TEL, not a live KEL walk — the same trust level the roster itself carries. - **The ACDC's own role is not recorded server-side.** `Promote`/`Demote` write the roster row; the membership ACDC re-issue is the steward's own signing act in the renderer. So role comes from the row and liveness from the credential. If a rotation ever lands the row without its re-issue, that drift now shows up here rather than hiding. - **Unknown is not "allowed":** a roster read that fails answers **503**, never a pass, and never a 403 that would wrongly read as demotion (ADR 0100). A nil operator check fails closed. **Verified rather than assumed: no lockout.** The risk I named when filing this was gating on an identifier that turns out not to match. `internal/fleetwire/founderroster.go:126` registers the founder with `Role: credschema.RoleOperator` and a receipt-confirmed membership ("the founder is always their community's operator"), and the bridge sets `sub = AID` (`internal/idp/storage.go:524`), which is the roster's own key — so the founder passes their own gate. Pins: `TestIdipStewardAuthz_MemberIsForbiddenOperatorIsNot` (403 / 200 / 401), `TestIdipStewardAuthz_UnknownRefusesRatherThanGuesses` (503), `TestStewardResolver_NilOperatorsFailsClosed`, `TestStewardSessionResolver_CarriesAuthorization` — that last one pins that the wiring can never silently revert to authentication-only, which is precisely how #1094 happened one layer down — and four `TestRegistryOperators_*` including suspension ending steward power mid-standing. `docs/GOTCHAS.md` #148 extended. Checks: `go build ./...`; `go test ./internal/... ./control-plane/...` all green; gofmt clean.
ben closed this issue 2026-09-01 04:30:32 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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
Matou/idss#1098
No description provided.