- Storage backend (Consul, S3, DynamoDB, Integrated Storage)
- Listener settings (API and cluster addresses, ports, TLS)
- Seal mechanism (AWS KMS, Azure KMS, Transit)
- Cluster parameters (cluster name, UI, API address, log level)
- Optional stanzas (telemetry, audit devices, etc.)
Running Vault with a Config File
To start Vault using your configuration file:In production environments, manage Vault with a service manager like systemd or Windows Service Manager to ensure automatic startup and proper log handling.
Key Configuration Components
Configuration Structure
A Vault configuration file comprises multiple named stanzas and top-level parameters. Here’s the skeleton in HCL:- listener: Defines the API port, cluster port, and TLS options.
- storage: Configures where Vault persists its data.
- seal: Sets up the auto-unseal provider (e.g., KMS).
- telemetry: Controls metrics export.
api_addrcluster_addruicluster_namelog_level
Basic Stanza Examples
- listener: Binds Vault to all interfaces on ports 8200 (API) and 8201 (cluster).
- seal: Configures AWS KMS for automatic unseal.
Disabling TLS (
tls_disable = true) is insecure. Always enable TLS (tls_disable = false) in production and provide valid certificates.Production-Ready Configuration Example
Use this HCL template as a starting point for a highly available, production-grade Vault cluster:- storage.consul: Persists Vault data to a local Consul agent.
- tls_disable = false: Enforces TLS; certificates must be valid.
- seal.awskms.endpoint: Uses a VPC endpoint for secure AWS KMS access.
Vault Contents vs. Config File
The Vault configuration file does not manage:- Secrets Engines
- Auth Methods
- Audit Devices (beyond file/device declaration)
- Vault Policies, Entities, and Groups
Summary of Stanzas
*Vault can run without an auto-unseal seal stanza, but manual unseal is required at each startup.