safekeys/control-plane-api [built]
The Control Plane API is the authority service: it allocates object ids, issues and revokes capability tokens, evaluates policy, and exposes the audit log. Sidecars and CLIs authenticate to it with an API key in the MVP and mTLS later. It never accepts or stores plaintext.
Status: built
Why this exists
Tokens need an issuing authority, policy needs a central place to live and change, and audit needs an append-only home. Centralising those makes the sidecar simple and stateless about authority, and keeps the only network-exposed component entirely outside the decryption path.
Design decisions
go-and-postgres [accepted]
Decision: Implement the control plane as a Go service on Postgres.
Rationale: A single static binary and a battle-tested transactional store, sharing a toolchain with the sidecar and CLI. Policy and audit both need transactions, which rules out a simpler embedded store for the MVP.
no-create-with-value-endpoint [accepted]
Decision: Deliberately omit any endpoint that accepts a secret value.
Rationale: The API's shape is part of the security design — if values cannot be posted, integrators cannot accidentally route plaintext through the control plane. Value creation belongs on the local sidecar channel.
api-key-then-mtls [accepted]
Decision: Start with API keys and add mTLS for sidecars alongside hardware binding.
Rationale: API keys are enough for an MVP where the sidecar is operator-installed, and mTLS earns its complexity only once device identity needs to be attested.
How it works
Allocate an object id and wrapping policy (allocate-object)
The sidecar asks the control plane to register a new secret object.
- Receive — Sidecar requests an object id with an intended wrapping policy and owning principal.
- Validate — Authenticate the sidecar and authorise object creation for that principal.
- Generate — Allocate and persist an object id and its policy record.
- Receive — Sidecar receives the object id; no secret material is involved.
Issue a capability token (issue-token)
The control plane mints a signed token for an object, scope, and audience.
- Receive — Receive a mint request with object id, scope, audience, and TTL.
- Validate — Evaluate policy for the requester, scope, object, and audience.
- Generate — Build claims and sign the token with the active kid.
- Record — Record the jti and the issuance event.
- Send — Return the token URI.
Revoke a token (revoke-token)
The control plane adds a jti to the denylist.
- Receive — Receive a revoke request for a jti or object.
- Record — Add to the denylist and write an audit record.
- Observe — Subsequent resolves with that jti are denied.