Key management#
Every key that can sign an identity, a checkpoint or a licence, or decrypt stored data, is customer-held. MAQPNA never holds, escrows or phones home with a key. Keys are referenced either by a file path mounted from a Kubernetes Secret, or by a key URI resolved by pkg/keys.
Key URIs#
| URI | Algorithm | Status |
|---|---|---|
file:///abs/path |
Ed25519 (EdDSA) or ECDSA P-256 (ES256), PKCS#8 PEM | Implemented. The file is refused if it is readable by others or writable by the group (0600 or 0400; 0440 tolerated for Secret volumes with fsGroup) |
kms://aws/<key-id \| ARN \| alias/name> |
ECC_NIST_P256 ES256, ECC_NIST_EDWARDS25519 EdDSA (raw messages up to 4096 bytes), RSA RS256 |
Implemented (KMS Sign / GetPublicKey, SigV4, partition-aware) |
kms://gcp/projects/…/cryptoKeyVersions/V |
EC_SIGN_P256_SHA256 ES256, EC_SIGN_ED25519 EdDSA, RSA_SIGN_PKCS1_*_SHA256 RS256 |
Implemented (Cloud KMS asymmetricSign with CRC32C integrity checks) |
kms://azure/<vault>/<key>[/<version>], azurekv://… |
EC P-256 ES256, RSA RS256 (Key Vault has no Ed25519) | Implemented (Key Vault REST 7.4) |
kms://vault/<mount>/keys/<name>, kms://openbao/… |
Transit ed25519 EdDSA, ecdsa-p256 ES256, rsa-2048 RS256 |
Implemented (Transit sign, key version pinned) |
pkcs11:token=…;object=…?module-path=…&pin-source=file:… (RFC 7512) |
EC P-256 ES256, Ed25519 EdDSA, RSA RS256 | Implemented only in binaries built with -tags pkcs11 (cgo, github.com/miekg/pkcs11); release images are static (CGO_ENABLED=0) and return ErrNotConfigured. An inline pin-value is rejected |
kms://<other>/… (e.g. ovh, stackit) |
— | Planned. Parsed and validated; signing returns ErrNotConfigured unless a custom build registers a backend with keys.RegisterKMS |
KMS backends get their credentials from the pod's workload identity (EKS Pod Identity or IRSA, GKE Workload Identity
Federation, Entra Workload ID, Vault Kubernetes auth); see Cloud identity & keys.
Every KMS signature is verified against the key's public key before it is returned. Azure Key Vault authentication,
first that applies: Entra Workload ID (AZURE_FEDERATED_TOKEN_FILE, or AKS identity bindings), AZURE_CLIENT_SECRET
(or AZURE_CLIENT_SECRET_FILE), managed identity when enabled, then az account get-access-token (CLI only). For a
sovereign cloud, give the vault's full host name.
Signed artifacts (audit checkpoints, evidence packs, usage reports, Txn-Tokens, licences) name their algorithm in the
JWS header, EdDSA or ES256, and JWKS exports carry kty/crv to match (OKP/Ed25519 or EC/P-256), so a
KMS without Ed25519 can hold any of these keys.
Key IDs are RFC 7638 JWK thumbprints everywhere, so a kid in a token, checkpoint or card names exactly one public key.
Sealers encrypt data at rest. keys.ParseSealerURI accepts file:/// (a 32-byte AES-256 key) and, when a custom build registers a backend, pkcs11: or kms:// (no KMS sealing backend is built in). AESGCMSealer uses AES-256-GCM with a random 96-bit nonce and key ID aes256gcm:<16 hex>; a Keyring holds one primary key and any retired keys, so data sealed under an old key still opens after rotation.
Which component holds which key#
flowchart LR
subgraph IDN["maqpna-identity"]
K1["identity signing key<br/>Ed25519, -key file"]
K2["tenant signing keys<br/>Secret maqpna-tenant-keys"]
end
subgraph GWN["maqpna-gateway"]
K3["audit checkpoint key<br/>auditCheckpointKey URI"]
K4["HMAC checkpoint key<br/>MAQPNA_AUDIT_HMAC_KEY"]
K5["token vault key<br/>tokenVault.keyURI sealer"]
K6["capture key<br/>captureArgs key sealer"]
K7["Txn-Token key<br/>txnTokens.signingKey"]
K8["A2A card key<br/>a2a.cardSigningKey"]
end
subgraph ATN["maqpna-attest"]
K9["response signing key<br/>-response-signing-key file"]
end
subgraph CLI["maqpna CLI, offline"]
K10["licence signing key<br/>file or azurekv URI"]
K11["usage report key<br/>file URI"]
end
K1 -- "JWKS /.well-known/jwks.json" --> V1["gateway, broker verify tokens"]
K3 -- "JWKS /v1/audit/jwks" --> V2["auditors verify checkpoints<br/>and erasure certificates"]
K8 -- "JWKS /a2a/jwks.json" --> V3["remote A2A peers"]
K9 -- "public key to the operator" --> V4["attest agents in the VM"]
| Key | Held by | Signs or protects | Published as |
|---|---|---|---|
| Identity signing key | Identity broker (-key, Ed25519 PEM; identity.key.mode generate, helm or existingSecret) |
Session, exchanged and delegated tokens | GET /.well-known/jwks.json |
| Federation key | Identity broker (-federation-key, MAQPNA_IDENTITY_FEDERATION_KEY, ES256 or RS256 key URI) |
Federation JWTs presented to AWS STS, GCP STS and Entra by the aws-sts, gcp-sts and azure-entra exchange providers |
Same JWKS (kty: EC or RSA) |
| Tenant signing keys | Identity broker (Secret maqpna-tenant-keys, <tenant>.pem, generated by the operator or copied from signingKeySecretRef) |
Tokens for a tenant's namespaces, in its trust domain | Same JWKS |
| Audit checkpoint key | Gateway (auditCheckpointKey, key URI) |
EdDSA or ES256 JWS ledger checkpoints and memory erasure certificates | GET /v1/audit/jwks |
| HMAC checkpoint key | Gateway (MAQPNA_AUDIT_HMAC_KEY, from the chart's Secret) |
HMAC checkpoints in <ledger>.checkpoints |
Not published (symmetric) |
| Token vault key | Gateway (tokenVault.keyURI, sealer) |
Users' OAuth tokens, bound to realm, user, provider and field | — |
| Capture key | Gateway (captureArgs, sealer) |
DLP-redacted argument captures for replay | — |
| Txn-Token key | Gateway (txnTokens.signingKey, key URI) |
Transaction tokens to upstreams; give the broker its public key with -txn-token-keys |
— |
| A2A card key | Gateway (a2a.cardSigningKey, key URI) |
Signed agent cards | GET /a2a/jwks.json |
| Attest response key | Attestation service (-response-signing-key, Ed25519 PEM) |
Attest and renew responses, so an on-path host cannot substitute a sealed token | Public key to the operator (--attest-response-pubkey-file) |
| Licence signing key | Vendor or service provider, offline (maqpna license issue) |
Licence JWS (EdDSA or ES256) | Embedded trusted key in the binaries |
| Usage report key | Service provider, offline (maqpna usage report) |
Signed usage reports (EdDSA or ES256 JWS) | Given to the party that verifies |
MAQPNA_BROKER_TOKEN |
Operator, broker, attestation service | Bearer for mint and release calls (not a signing key) | — |
Rotation#
maqpna keys rotate rotates a key without downtime. Every key lives in a Secret mounted as a directory, and the servers also load sibling files next to the active key, so a rotation edits the Secret and restarts the Deployment that reads it:
| Kind | Sibling file | Effect |
|---|---|---|
identity |
previous-<kid>.pem |
Published in the broker JWKS, so tokens signed with the old key verify until they expire |
audit-checkpoint |
retired-<kid>.pub.pem |
Kept in /v1/audit/jwks, so old checkpoints stay verifiable |
vault |
retired-<id> |
Still opens records sealed under it; --drop-old removes it after re-sealing |
attest |
pub.pem with two keys |
Attest agents trust the old and the new response key during the grace period |
maqpna keys rotate identitygenerates a new key and keeps the old one asprevious-<kid>.pem.- It restarts the broker, then waits for gateways to pick up the new JWKS (
--jwks-wait, default 5m30s) or restarts them (--restart-gateway). - After the grace period (
--grace, default 1 hour, longer than the maximum token TTL),--finishremoves the old key. - Progress is recorded in the Secret annotation
maqpna.com/key-rotation(kind,phaseprepared/swapped/done,oldKid,newKid), so an interrupted rotation can be resumed.
What you see#
$ maqpna keys rotate identity -n maqpna-system --dry-run
prints the plan without changing anything. The usage lines (from cmd/maqpna/keys.go):
maqpna keys rotate identity [-n NS] [--grace 1h] [--jwks-wait 5m30s | --restart-gateway] [--no-finish | --finish [--force]]
maqpna keys rotate audit-checkpoint [-n NS] [--secret NAME]
maqpna keys rotate vault [-n NS] [--secret NAME] [--drop-old]
maqpna keys rotate attest [-n NS] --secret NAME [--grace 24h] [--no-finish | --finish [--force]]
See maqpna keys rotate, maqpna keygen and maqpna license issue.
Related#
Last updated