Auto Unseal decrypts Vault's master key with an external KMS at startup, removing the need for manual Shamir unsealing. Combined with a cloud KMS, restart and failover operations become simpler and safer.
This article covers AWS KMS, Azure Key Vault, and GCP Cloud KMS, walking through setup steps, required permissions, and operational pitfalls with mitigations. It calls out points commonly tested on Ops exams in a form that maps directly to real-world practice.
Auto Unseal wraps Vault's master key with an external KMS and uses that KMS to decrypt it automatically at startup. This eliminates the operational burden of collecting multiple unseal keys and waiting on manual unseals across remote sites.
When Auto Unseal is enabled, initialization produces Recovery Keys instead of Shamir Unseal Keys. Recovery Keys are used only for recovery scenarios and certain operations, never for startup unsealing. Operationally, the KMS is called primarily at startup and during master key rekey/rotation, and is not involved in normal secret operations.
In availability design, reachability to the KMS determines whether startup succeeds. A running node keeps operating even if the KMS becomes temporarily unreachable, but restarts and scale-outs require KMS reachability. When the KMS is region-specific, align the Vault cluster topology with the KMS placement and redundancy policy.
| Provider | Required Permissions (representative) | Key Benefits | Caveats |
|---|---|---|---|
| AWS KMS | kms:Decrypt, kms:Encrypt, kms:DescribeKey | Integrates cleanly with IAM. Works well with multi-account designs. | Region-dependent. Monitor API limits and reachability. Consider multi-region keys. |
| Azure Key Vault | get, wrapKey, unwrapKey (on the target key) | Clearly controllable via Key Vault RBAC and key-level permissions. | Mind network controls (Private Endpoint) and soft-delete settings. |
| GCP Cloud KMS | roles/cloudkms.cryptoKeyEncrypterDecrypter | Permission design at the project level is straightforward. | Mind service-account key handling and KMS location alignment. |
| On-prem HSM (PKCS#11) | Key-use permissions on the HSM | Easier to meet regulatory requirements (FIPS, etc.). Low latency. | Higher operational cost and heavier initial setup. HA design is essential. |
Auto Unseal (Raft + Cloud KMS) conceptual diagram
Basic seal stanza (example: AWS KMS)
seal "awskms" {
region = "ap-northeast-1"
kms_key_id = "arn:aws:kms:ap-northeast-1:123456789012:key/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
# 認証情報はインスタンスロール/タスクロール推奨(静的キーは避ける)
}
storage "raft" {
path = "/opt/vault/data"
node_id = "vault-1"
}
listener "tcp" {
address = "0.0.0.0:8200"
tls_disable = "0"
}
default_lease_ttl = "768h"
max_lease_ttl = "768h"When using AWS KMS, grant KMS key-use permissions to the IAM role attached to the Vault runtime (EC2, ECS, EKS, etc.). Provision a symmetric customer master key (CMK) and place it in the same region as Vault nodes, or with equivalent redundancy.
At minimum, grant kms:Decrypt and kms:Encrypt, plus kms:DescribeKey for key-state checks. Also allow the IAM role as a Principal in the key policy to avoid common issues. Auto Unseal traffic is centered on startup, so KMS cost and rate-limit impact is limited, but frequent rolling restarts are still worth reviewing.
If KMS is used across regions, consider multi-region keys. If your cluster spans multiple regions, either replicate the same key (multi-region key) or ensure per-region keys and their configuration management stay consistent.
vault.hcl (AWS KMS) minimal example
seal "awskms" {
region = "ap-northeast-1"
kms_key_id = "arn:aws:kms:ap-northeast-1:123456789012:key/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
# 認証は IAM ロール(EC2/EKS のメタデータ経由)を推奨
# 必要に応じて endpoint を明示(VPC エンドポイント等)
# endpoint = "https://kms.ap-northeast-1.vpce.amazonaws.com"On Azure, you need wrapKey and unwrapKey (and get) permissions on the Key Vault key. In production, using Managed Identity simplifies secret management. When enabling network controls (Private Endpoint, Firewall), ensure connectivity from Vault.
Enabling soft-delete and purge protection on Key Vault hardens the design against accidental key deletion. When switching key versions, prepare a Vault-side rekey and configuration-update plan.
vault.hcl (Azure Key Vault) minimal example
seal "azurekeyvault" {
tenant_id = "00000000-0000-0000-0000-000000000000"
vault_name = "my-key-vault"
key_name = "vault-unseal"
# Managed Identity を使う場合:
# use_msi = true
# システム割当またはユーザー割当 MI に鍵権限を付与
# クライアントシークレットで行う場合(非推奨):
# client_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
# client_secret = "..."
}On GCP, grant roles/cloudkms.cryptoKeyEncrypterDecrypter on the target CryptoKey to Vault's runtime service account. You must specify the project, location, key ring, and crypto key.
Prefer service-account metadata authentication (GCE/GKE) and minimize JSON key-file distribution. Co-locate the KMS and Vault nodes in the same or nearby regions to keep startup latency low and availability high.
vault.hcl (GCP Cloud KMS) minimal example
seal "gcpckms" {
project = "my-gcp-project"
region = "asia-northeast1" # KMS ロケーション
key_ring = "vault-ring"
crypto_key = "vault-unseal"
# 認証はデフォルト認証情報を推奨(GCE/GKE の SA)
# credentials = "/path/to/service-account.json" # 可能なら未使用
}A running Vault keeps operating even when the KMS is unreachable. The risk is at restart time. If KMS is unreachable during a restart or scale-out, unsealing fails. During planned maintenance or rolling upgrades, monitor KMS reachability and rate limits, and restart in stages.
Use the /v1/sys/health status for health checks. The status code differs across sealed, uninitialized, recovery mode, and other states, so tune your readiness/liveness conditions to match your orchestrator's needs.
Logs record the seal type and unseal success/failure. KMS reachability and authorization errors are valuable for first-response triage. Also, disabling, deleting, or changing permissions on KMS keys can trigger major incidents, so build change management and audit monitoring (CloudTrail / Activity Log / Cloud Audit Logs) into your process.
Health check example
curl -s -o /dev/null -w "%{http_code}\n" \
http://127.0.0.1:8200/v1/sys/health
# 200: unsealed/active, 429: standby, 503: sealed など
# sealed 時は systemd/オーケストレータで自動再起動を抑止する設計が有効From an Ops perspective, common topics include when Auto Unseal runs (startup and rekey), the role of Recovery Keys, the impact of KMS reachability on cluster operations, and least-privilege design. Typical questions cover what to do when the KMS is unreachable, the impact of key rotation, and designs across multiple nodes and regions.
In practice, use roles or managed identities for credentials and avoid embedding static secrets in vault.hcl. Wire KMS audit logs into security operations, and explicitly manage KMS network reachability (Private Endpoints, VPC endpoints, firewalls, etc.) through IaC.
Configuration change deployment example (rolling)
# 例: 3 ノードを 1 台ずつローリング
for h in vault-1 vault-2 vault-3; do
echo "Restarting $h"
ssh $h 'sudo systemctl restart vault && sleep 10 && curl -sf http://127.0.0.1:8200/v1/sys/health >/dev/null'
# KMS 到達性/ステータスを確認して次へ
doneOps
問題 1
You have configured Vault Auto Unseal with AWS KMS. KMS becomes temporarily unreachable in one region. Already-running nodes continue to operate, but restarting them may fail to unseal. Which operational response is most appropriate?
正解: A
Auto Unseal uses the KMS to decrypt the master key at startup. Running nodes are unaffected, but restarts require KMS reachability. Therefore, avoid restarting and roll restarts only after the KMS recovers. Recovery Keys are for recovery operations and are not a substitute for unsealing.
After enabling Auto Unseal, do the Shamir Unseal Keys go away?
Yes. When you initialize Vault with Auto Unseal enabled, you receive Recovery Keys instead. Recovery Keys are used for disaster recovery and certain administrative operations, but they are not used to unseal Vault at startup.
Does rotating the KMS key cause Vault downtime?
AWS KMS automatic rotation and key material updates under the same key ID generally cause no downtime. Switching to a different key (e.g. a different ARN) requires updating vault.hcl and performing a rekey, so a planned maintenance window is recommended.
Can a cluster mix different KMS providers (e.g. some nodes on AWS, others on Azure)?
No. All nodes must share the same seal configuration (provider and key). To migrate seals, plan a switch to the new KMS and roll the change across all nodes.
Practice with certification-focused question sets
無料で問題を解いてみるNicheeLab Editorial Team
NicheeLab editorial team focused on data engineering and cloud certification learning. Content is structured around practical study needs and official exam domains.
Vault Core Concepts: Sealed/Unsealed, Auth, Secrets (2026)
Vault fundamentals — sealed/unsealed state, auth methods, se...
Vault Operations Professional (VOP-003): Complete Guide (2026)
Pass the Vault Operations Professional exam — enterprise pat...
Vault Path-Based Routing: API URL Structure (2026)
How Vault's path-based routing works — mount points, sub-pat...
Vault Tokens: Auth Token Mechanics (2026)
Token fundamentals — service vs. batch tokens, accessor, ren...
Vault Token Types: Service, Batch, Periodic (2026)
Service vs. batch tokens compared — performance, ACL behavio...