enroll: community-ca — replace the StubGranter before its first consumer #210

Closed
opened 2026-07-30 23:20:31 +00:00 by ben · 2 comments
Owner

Parent

Device-add spec #13 (the identity grant, ADR 0055). Gap audit 2026-07-30 (post #191–#195 sweep). Not on #183's journey — hardening filed alongside the blocker set, confirmed by Ben.

What's true today

  • The stub granter is the default granter — and it is the one place in the tree where a fake fabricates success rather than failing loud (ADR 0100's sole survivor): every approved device receives a well-formed identity grant whose certificate is 64 random bytes with 90-day validity. No community CA exists anywhere.
  • Nothing consumes the certificates yet, which is why the journey doesn't notice — and exactly why this should not survive to the first consumer, where a fabricated credential would read as a real one.

What to build

A ruling first, then the granter: what the community CA is — a per-community root minted at founding? a key sealed in clan vars? kanidm-adjacent? — and where its key lives and how it survives rescue (the crown-jewel question touches ADR 0104's key posture). Then the real granter implements it and the stub demotes to tests, with the default becoming fail-loud-if-unset.

Acceptance criteria

  • Given the ruling, When a device is approved, Then its grant carries a certificate the community CA really signed — verifiable against the community root
  • Given no CA configured, Then approval fails loud (ADR 0100) — the stub never ships an answer
  • Given the rescue posture, Then the CA key's home is covered by the crown-jewel story

Task manifest

task: enroll:community-ca
implements_seam: "the enroll seam's identity grant (ADR 0055) — a real community CA"
interface: "approved devices hold real credentials"
seam: "the enroll integration test grown to verify the grant against the community root"
acceptance:
  - given: an approved device; when: its grant mints; then: really signed by the community CA, or the approval fails loud
depends_on: []
out_of_scope: [mTLS rollout to consumers (their tickets when they arrive)]
needs_human_decision: ["what the community CA is and where its key lives (founding-minted root vs clan-vars-sealed vs kanidm-adjacent) — touches the crown-jewel key posture (ADR 0104)"]

Blocks

None directly — flagged before its first consumer arrives.

## Parent Device-add spec #13 (the identity grant, ADR 0055). Gap audit 2026-07-30 (post #191–#195 sweep). Not on #183's journey — hardening filed alongside the blocker set, confirmed by Ben. ## What's true today - The stub granter is the **default** granter — and it is the one place in the tree where a fake fabricates success rather than failing loud (ADR 0100's sole survivor): every approved device receives a well-formed identity grant whose certificate is 64 random bytes with 90-day validity. No community CA exists anywhere. - Nothing consumes the certificates yet, which is why the journey doesn't notice — and exactly why this should not survive to the first consumer, where a fabricated credential would read as a real one. ## What to build A ruling first, then the granter: what the community CA **is** — a per-community root minted at founding? a key sealed in clan vars? kanidm-adjacent? — and where its key lives and how it survives rescue (the crown-jewel question touches ADR 0104's key posture). Then the real granter implements it and the stub demotes to tests, with the default becoming fail-loud-if-unset. ## Acceptance criteria - [ ] Given the ruling, When a device is approved, Then its grant carries a certificate the community CA really signed — verifiable against the community root - [ ] Given no CA configured, Then approval fails loud (ADR 0100) — the stub never ships an answer - [ ] Given the rescue posture, Then the CA key's home is covered by the crown-jewel story ## Task manifest ```yaml task: enroll:community-ca implements_seam: "the enroll seam's identity grant (ADR 0055) — a real community CA" interface: "approved devices hold real credentials" seam: "the enroll integration test grown to verify the grant against the community root" acceptance: - given: an approved device; when: its grant mints; then: really signed by the community CA, or the approval fails loud depends_on: [] out_of_scope: [mTLS rollout to consumers (their tickets when they arrive)] needs_human_decision: ["what the community CA is and where its key lives (founding-minted root vs clan-vars-sealed vs kanidm-adjacent) — touches the crown-jewel key posture (ADR 0104)"] ``` ## Blocks None directly — flagged before its first consumer arrives.
Author
Owner

Ruling taken (Ben, 2026-07-30): the community CA is a per-community root, minted at founding. Recorded as ADR 0111 (docs/adr/0111-community-ca-per-community-root-minted-at-founding.md, commit fcb3ccc).

  • The root is created as part of standing up the community itself — owned by the community alone. Rejected: a clan-vars-derived CA with no founding mint, and a kanidm-adjacent CA (members are IdP-only; devices are not — the access-sequences ruling).
  • Key posture: crown jewel. The root key lives sealed with the community's other crown-jewel material and its home is covered by the rescue/rebuild-from-nothing story (ADR 0104's posture).
  • The real granter signs against this root; no CA configured → approval fails loud (ADR 0100). The StubGranter demotes to tests and never ships an answer.

needs_human_decision resolved — re-labelled ready-for-agent.

**Ruling taken (Ben, 2026-07-30): the community CA is a per-community root, minted at founding.** Recorded as **ADR 0111** (`docs/adr/0111-community-ca-per-community-root-minted-at-founding.md`, commit `fcb3ccc`). - The root is created as part of standing up the community itself — owned by the community alone. Rejected: a clan-vars-derived CA with no founding mint, and a kanidm-adjacent CA (members are IdP-only; devices are not — the access-sequences ruling). - **Key posture: crown jewel.** The root key lives sealed with the community's other crown-jewel material and its home is covered by the rescue/rebuild-from-nothing story (ADR 0104's posture). - The real granter signs against this root; **no CA configured → approval fails loud** (ADR 0100). The StubGranter demotes to tests and never ships an answer. `needs_human_decision` resolved — re-labelled `ready-for-agent`.
Author
Owner

Done — commit 5d69c55 on origin/main (following the ADR 0111 ruling recorded in this thread).

What shipped:

  • New internal/enroll/community_ca.go: MintCommunityCA self-signs an ed25519 per-community root (ADR 0111); CommunityCA.Grant signs a genuine x509 NodeCert certifying the device's own key (threaded as GrantSpec.DevicePub, bound at Redeem), verifiable against the community root via VerifyNodeCert. ClanTrust.CAPubKey is the real root pubkey and the SSH host credential is a real root signature — no random-bytes-as-credential remains; mesh admission stays fresh random secrets.
  • Fail-loud default (ADR 0100): enroll.Config.Granter has no default; Approve returns the new ErrNoCA and leaves the request Pending when no CA is configured. The stub never ships an answer.
  • StubGranter demoted to the new internal/enroll/enrolltesting sub-package (test-only). The enroll package's own internal tests use the real CA (avoiding an internal-test import cycle); external test packages and smoke-stores wire an explicit granter.
  • Seam proof (the acceptance criteria): TestGrant_FullCommunityCA verifies the minted NodeCert against the community root; TestGrant_NoCAFailsLoud proves approval fails loud with ErrNoCA and leaks no grant. Rescue posture (AC3) is the ADR 0111 ruling citing ADR 0104.

Deliberately deferred (follow-up, not filed): the production helper's founding ledger stays granter-less on purpose — founding's S9 approval fails loud (like its other not-yet-wired ports) until the founding-mint step (the ADR 0111 crown-jewel key posture, ADR 0104) is wired. That mint-at-founding wiring is its own slice.

Caveat: Go slice shipped verified by careful review only — the Sandcastle sandbox still has no Go toolchain (#198), so this was not compiled/tested locally.

Done — commit `5d69c55` on `origin/main` (following the ADR 0111 ruling recorded in this thread). **What shipped:** - New `internal/enroll/community_ca.go`: `MintCommunityCA` self-signs an ed25519 per-community root (ADR 0111); `CommunityCA.Grant` signs a genuine x509 `NodeCert` certifying the **device's own key** (threaded as `GrantSpec.DevicePub`, bound at Redeem), verifiable against the community root via `VerifyNodeCert`. `ClanTrust.CAPubKey` is the real root pubkey and the SSH host credential is a real root signature — no random-bytes-as-credential remains; mesh admission stays fresh random secrets. - **Fail-loud default (ADR 0100):** `enroll.Config.Granter` has no default; `Approve` returns the new `ErrNoCA` and leaves the request Pending when no CA is configured. The stub never ships an answer. - **StubGranter demoted** to the new `internal/enroll/enrolltesting` sub-package (test-only). The enroll package's own internal tests use the real CA (avoiding an internal-test import cycle); external test packages and `smoke-stores` wire an explicit granter. - **Seam proof (the acceptance criteria):** `TestGrant_FullCommunityCA` verifies the minted NodeCert against the community root; `TestGrant_NoCAFailsLoud` proves approval fails loud with `ErrNoCA` and leaks no grant. Rescue posture (AC3) is the ADR 0111 ruling citing ADR 0104. **Deliberately deferred (follow-up, not filed):** the production helper's founding ledger stays granter-less on purpose — founding's S9 approval fails loud (like its other not-yet-wired ports) until the founding-mint step (the ADR 0111 crown-jewel key posture, ADR 0104) is wired. That mint-at-founding wiring is its own slice. **Caveat:** Go slice shipped verified by careful review only — the Sandcastle sandbox still has no Go toolchain (#198), so this was not compiled/tested locally.
ben closed this issue 2026-07-31 02:51:42 +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#210
No description provided.