How to Auto-Unseal a Control Tower with a Key Store
Overview
When every node of a Control Tower restarts at the same time, the seal key that decrypts the Strongbox state is lost, and you must unseal the Control Tower manually with the seal key (see Manual unseal).
To unseal without operator interaction, you can let the Control Tower keep its unseal shares on disk, wrapped by a key in an external key store. At boot each node asks the key store to unwrap its share, and the Control Tower unseals itself once a majority of the nodes is up. The following key stores are supported:
- AWS KMS, with a symmetric key
- HashiCorp Vault, with a transit key
The seal key itself is never sent to the key store, and the key store key never leaves the key store.
Consider the trade-off
With auto-unseal, whoever can use the key store key from a Control Tower node can unseal the Control Tower. The protection boundary moves from the seal key to the access policy of the key store key:
- For AWS KMS, the IAM policy that grants
kms:Encryptandkms:Decrypton the key. Every call appears in CloudTrail. - For Vault, the policy that grants encrypt and decrypt on the transit key. Every call appears in the Vault audit log.
Grant those permissions only to the Control Tower nodes.
A key store failure is an error. The Control Tower never falls back to TPM protection or to plaintext shares; it stays sealed until the key store answers or until you unseal it manually.
Prerequisites
- The Control Tower is installed and unsealed, and you have saved the
seal key and the recovery shares from
reveal-sealkey. - The key exists in the key store before you configure it. The Control Tower does not create it.
- For AWS KMS: a symmetric key (key spec
SYMMETRIC_DEFAULT), and credentials on every Control Tower node, see AWS credentials. - For Vault: a transit key, and a Vault identity with permission to encrypt and decrypt with it.
Configure AWS KMS
The configuration goes in the site settings of the Control Tower's own
site. Local unseal must be enabled, as the shares that are wrapped are
the local unseal shares. Replace control-tower with the name of your
Control Tower site:
supctl merge system sites control-tower <<EOF
allow-local-unseal: true
seal-key-store:
aws-kms:
region: eu-north-1
key-id: arn:aws:kms:eu-north-1:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
credentials: instance-role
EOF
The settings are:
region: the AWS region of the key.key-id: the key id or ARN.credentials: where the Control Tower gets AWS credentials,instance-role(default) orenvironment.endpoint: optional, overrides the KMS endpoint host, for example a VPC endpoint.
AWS credentials
instance-role: the credentials of the EC2 instance profile, read from the instance metadata service (IMDSv2). If the Control Tower runs in a container on the instance, the metadata service must be reachable from the container. With IMDSv2 this requires a hop limit of at least 2.environment: theAWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEYand optionalAWS_SESSION_TOKENenvironment variables of the supd process.
IAM Roles for Service Accounts (IRSA) and EKS Pod Identity are not supported.
Configure HashiCorp Vault
supctl merge system sites control-tower <<EOF
allow-local-unseal: true
seal-key-store:
hashicorp-vault:
address: https://vault.example.com:8200
key-name: avassa-unseal
authentication:
kubernetes:
role: avassa-control-tower
EOF
The settings are:
address: the base URL of Vault. Onlyhttpsis accepted.key-name: the name of the transit key.transit-mount: where the transit secrets engine is mounted, defaulttransit.namespace: the Vault Enterprise namespace, if any.ca-cert: the CA that signs the Vault server certificate, when it is not publicly trusted.authentication: eitherkubernetes, which logs in with the pod's service account token (role, and optionallymountandtoken-file), ortoken-file, a file that holds a Vault token.
Verify
The Control Tower wraps its shares as soon as the configuration is
applied. Restart all Control Tower nodes at the same time, and check
that the Control Tower unseals without manual interaction. The health
endpoint reports running once it is unsealed, and sealed before:
curl https://api.example.com/healthz
If the Control Tower stays sealed, the supd log on each node shows why the key store refused or could not be reached.
Recover without the key store
Keep the seal key and the recovery shares from reveal-sealkey stored
offline. If the key store key is deleted, disabled or unreachable, they
are the only way to unseal the Control Tower:
supctl do strongbox system unseal --sealkey <seal key>
Deleting the KMS key, or the Vault transit key, permanently removes the auto-unseal path. Use the key deletion protection of the key store.
Turn auto-unseal off
Remove the seal-key-store setting. The shares are then protected as
set by protect-with-tpm again:
supctl delete system sites control-tower seal-key-store