Skip to content

ADR-104 Part B: first-run claim protocol (console-token-gated, self-locking) #513

Description

@aaronsb

Implements Part B of ADR-104: a console-token-gated, self-locking first-run claim protocol so the platform boots UNCLAIMED and identity bootstrap moves out of the install scripts into the API.

Threat model: closes the WordPress install.php takeover window (token originates off-network, console/installer-only); pfSense-style console-sourced secret.

  • API: UNCLAIMED/CLAIMED state; "admin exists" ⇒ CLAIMED (existing installs unaffected).
  • API: GET /setup/status, POST /setup/claim (single-use token, creates admin + stores provider key, burns token, → CLAIMED; /setup/* → 410 after).
  • init paths mint the token instead of pre-creating an admin; surface on console (kg-console.sh), install.sh stdout, root file.
  • Web /setup page gated on unclaimed state.
  • cloud-init provision.env boots pre-CLAIMED (declarative path).
  • Recovery: configure.py reset-claim (re-open setup).
  • Remove admin/provider bootstrap from install.sh / headless-init.sh / kg-firstboot.sh.

Security-sensitive; relates ADR-400/074/054. Refs ADR-104.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestsecuritySecurity-related changes

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions