own-VPS full-install: the public gateway's kanidm has NO provision block — no operator person, no groups, no admin password (GOTCHAS #12, 7th port) #452

Closed
opened 2026-08-11 22:47:48 +00:00 by ben · 1 comment
Owner

Divergence class: GOTCHAS #12 (VM-vs-full-install) — pre-filed by the #450 audit

Root cause. The gateway's kanidm provision block — the operator person
account, the structural groups operators/members/kaitiaki/nextcloud_admins,
and (via idmAdminPasswordFile/adminPasswordFile) the admin + idm_admin
passwords — is declared only in renderGatewayGuest's inline
kanidmServer (internal/clan/vmguest.go:234-274), which rides the VM path
only
. On the own-VPS full-install public gateway:

  • kanidm is front-door.nix's (renderKanidmLoopback, frontdoor.go:223-240) —
    it sets enableServer + serverSettings and declares no provision block.
  • renderControlPlaneSurface (vmguest.go:400-412) deliberately omits
    services.kanidm (front-door owns it) — so it adds no provision either.
  • Nothing seeds the operator person at runtime: there is no seedOperator /
    founding person-create anywhere in internal/founding or internal/fleetwire
    (grep confirms). The only runtime kanidm structure-create is the files-service
    OIDC oneshot, which get-or-creates nextcloud_admins and the OAuth2 client
    as idm_admin (internal/clan/files.go:496-499).

What faults. Every kanidm-authenticated leg on the own-VPS gateway:

  1. The founding passkey ceremony: Enrolment.MintToken → MintResetToken(clan.OperatorAccount)
    (internal/fleetwire/enrolment.go:156-168, internal/kanidm/kanidm.go:265-273)
    returns HTTP 404 no such person "operator".
  2. The files OIDC oneshot and the control-plane's ADR-0105 kanidm ops authenticate
    as idm_admin using the kanidm-admins generator password — but the public
    kanidm's idm_admin password was never set to that value (no
    idmAdminPasswordFile), so auth fails 401.
  3. The kanidm-brand-push (see #453) logs in as admin with the same
    never-set password.

Why it's next. #442/#443 just made the finish leg reach green; the very
next thing the control-plane does at seed/finish is compose against kanidm
(/api/v1/fleet composition "whole", internal/fleetwire/fleet.go:266-270),
which needs a provisioned kanidm. This is the 7th port of GOTCHAS #12 — pre-filed
so it does not cost a paid red.

Proposed fix

Give the public/full-install gateway a kanidm provision block equivalent to the
VM path's: the operator person (from OperatorDisplay/OperatorMail), the
structural groups, and adminPasswordFile/idmAdminPasswordFile from the
kanidm-admins generator control-plane.nix already declares. It can ride
control-plane.nix (services.kanidm.provision merges with front-door's
services.kanidm.enableServer) or front-door's renderKanidmLoopback — decide
which module owns provision so nothing double-declares (ADR 0105's ownership
split: founding's declarative layer owns the seed operator + structural groups).

Acceptance

  • The composed own-VPS full-install assembly declares services.kanidm.provision
    with the operator person and the four structural groups, admin/idm_admin from
    the kanidm-admins generator.
  • TestOwnVPSGateway_EvalSmoke (and/or the configure-stage seam) asserts the
    provision block is present on the full-install assembly.
  • No duplicate services.kanidm attrpath (front-door's enableServer + this
    provision merge cleanly under eval).

Audit: docs/vm-full-install-divergence.md (DIV-1). Ruling
context: requested by Ben 2026-08-11 (each pre-filed defect saves a ~1h drive).

## Divergence class: GOTCHAS #12 (VM-vs-full-install) — pre-filed by the #450 audit **Root cause.** The gateway's kanidm `provision` block — the operator **person** account, the structural groups `operators`/`members`/`kaitiaki`/`nextcloud_admins`, and (via `idmAdminPasswordFile`/`adminPasswordFile`) the admin + idm_admin **passwords** — is declared **only** in `renderGatewayGuest`'s inline `kanidmServer` (`internal/clan/vmguest.go:234-274`), which rides the **VM path only**. On the own-VPS **full-install** public gateway: - kanidm is `front-door.nix`'s (`renderKanidmLoopback`, `frontdoor.go:223-240`) — it sets `enableServer` + `serverSettings` and **declares no `provision` block**. - `renderControlPlaneSurface` (`vmguest.go:400-412`) **deliberately omits** `services.kanidm` (front-door owns it) — so it adds no provision either. - Nothing seeds the operator person at runtime: there is **no** `seedOperator` / founding person-create anywhere in `internal/founding` or `internal/fleetwire` (grep confirms). The only runtime kanidm structure-create is the files-service OIDC oneshot, which get-or-creates **`nextcloud_admins`** and the OAuth2 client as `idm_admin` (`internal/clan/files.go:496-499`). **What faults.** Every kanidm-authenticated leg on the own-VPS gateway: 1. The founding passkey ceremony: `Enrolment.MintToken` → `MintResetToken(clan.OperatorAccount)` (`internal/fleetwire/enrolment.go:156-168`, `internal/kanidm/kanidm.go:265-273`) returns HTTP 404 **`no such person "operator"`**. 2. The files OIDC oneshot and the control-plane's ADR-0105 kanidm ops authenticate as `idm_admin` using the `kanidm-admins` generator password — but the public kanidm's idm_admin password was **never set** to that value (no `idmAdminPasswordFile`), so auth fails 401. 3. The `kanidm-brand-push` (see #453) logs in as `admin` with the same never-set password. **Why it's next.** #442/#443 just made the **finish** leg reach green; the very next thing the control-plane does at seed/finish is compose against kanidm (`/api/v1/fleet` composition `"whole"`, `internal/fleetwire/fleet.go:266-270`), which needs a provisioned kanidm. This is the 7th port of GOTCHAS #12 — pre-filed so it does not cost a paid red. ## Proposed fix Give the public/full-install gateway a kanidm `provision` block equivalent to the VM path's: the operator person (from `OperatorDisplay`/`OperatorMail`), the structural groups, and `adminPasswordFile`/`idmAdminPasswordFile` from the `kanidm-admins` generator `control-plane.nix` already declares. It can ride `control-plane.nix` (`services.kanidm.provision` merges with front-door's `services.kanidm.enableServer`) or front-door's `renderKanidmLoopback` — decide which module owns provision so nothing double-declares (ADR 0105's ownership split: founding's declarative layer owns the seed operator + structural groups). ## Acceptance - The composed own-VPS full-install assembly declares `services.kanidm.provision` with the operator person and the four structural groups, admin/idm_admin from the `kanidm-admins` generator. - `TestOwnVPSGateway_EvalSmoke` (and/or the configure-stage seam) asserts the provision block is present on the full-install assembly. - No duplicate `services.kanidm` attrpath (front-door's `enableServer` + this `provision` merge cleanly under eval). Audit: `docs/vm-full-install-divergence.md` (DIV-1). Ruling context: requested by Ben 2026-08-11 (each pre-filed defect saves a ~1h drive). <!-- rehearsal-sig: 8d0cd71d20a2 -->
Author
Owner

Landed in 7e40cee on main.

DIV-1 (GOTCHAS #12, 7th port) fixed. renderControlPlaneSurface now emits gatewayKanidmProvision (internal/clan/vmguest.go): a services.kanidm.provision block on the full-install/public gateway — the operator person (from OperatorDisplay/OperatorMail), the four structural groups (operators/members/kaitiaki/nextcloud_admins, all overwriteMembers = false), and adminPasswordFile/idmAdminPasswordFile from the kanidm-admins generator control-plane.nix already declares.

It rides its OWN attrpath (services.kanidm.provision), so the NixOS module system MERGES it with front-door.nix's services.kanidm.enableServer rather than double-declaring (ADR 0105's split: founding's declarative layer owns the seed operator + groups; front-door owns the server). instanceUrl targets front-door's 127.0.0.1:8443 loopback bind; acceptInvalidCerts for the self-signed localhost kanidm-tls CA (as the VM path).

Acceptance:

  • Composed own-VPS full-install assembly declares services.kanidm.provision with the operator person + 4 structural groups + admin/idm_admin from the generator. ✔
  • New TestAttachGateway_ControlPlaneProvisionsKanidmOnOwnVPS asserts the provision block on the full-install assembly; provision tokens also folded into TestOwnVPSGateway_FullInstallClosureAudit. ✔
  • No duplicate services.kanidm attrpath — the test asserts control-plane.nix carries no services.kanidm = (front-door owns the server); the real-eval merge is covered by the gated TestOwnVPSGateway_EvalSmoke. ✔

Audit doc docs/vm-full-install-divergence.md DIV-1 marked CLOSED (same-commit law, ADR 0042); STATUS.md header + milestone log updated. Full go test ./internal/clan/ ./internal/founding/ green, and the pre-push go-ci gate passed.

Landed in 7e40cee on `main`. **DIV-1 (GOTCHAS #12, 7th port) fixed.** `renderControlPlaneSurface` now emits `gatewayKanidmProvision` (`internal/clan/vmguest.go`): a `services.kanidm.provision` block on the full-install/public gateway — the operator **person** (from `OperatorDisplay`/`OperatorMail`), the four structural groups (`operators`/`members`/`kaitiaki`/`nextcloud_admins`, all `overwriteMembers = false`), and `adminPasswordFile`/`idmAdminPasswordFile` from the `kanidm-admins` generator control-plane.nix already declares. It rides its OWN attrpath (`services.kanidm.provision`), so the NixOS module system MERGES it with front-door.nix's `services.kanidm.enableServer` rather than double-declaring (ADR 0105's split: founding's declarative layer owns the seed operator + groups; front-door owns the server). `instanceUrl` targets front-door's `127.0.0.1:8443` loopback bind; `acceptInvalidCerts` for the self-signed localhost `kanidm-tls` CA (as the VM path). **Acceptance:** - Composed own-VPS full-install assembly declares `services.kanidm.provision` with the operator person + 4 structural groups + admin/idm_admin from the generator. ✔ - New `TestAttachGateway_ControlPlaneProvisionsKanidmOnOwnVPS` asserts the provision block on the full-install assembly; provision tokens also folded into `TestOwnVPSGateway_FullInstallClosureAudit`. ✔ - No duplicate `services.kanidm` attrpath — the test asserts control-plane.nix carries no `services.kanidm =` (front-door owns the server); the real-eval merge is covered by the gated `TestOwnVPSGateway_EvalSmoke`. ✔ Audit doc `docs/vm-full-install-divergence.md` DIV-1 marked CLOSED (same-commit law, ADR 0042); STATUS.md header + milestone log updated. Full `go test ./internal/clan/ ./internal/founding/` green, and the pre-push go-ci gate passed.
ben closed this issue 2026-08-11 23:08:16 +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#452
No description provided.