Production Hardening

Slides 144-182

For using Raft/Consul Autopilot, see: Consul Autopilot OR Vault Integrated Storage Autopilot

There are many best practices for a production hardened deployment of Vault.

Practice defense in depth and follow the Vault security model

NOTE: There are specific recommendations for running Vault in Kubernetes that are not included on this page.
See 09 Vault Security Model

General Recommendations

Deployment Model

Limit Access to Vault Nodes

Limit Services Running on Vault Nodes

Permit Only Required Ports on Firewall

Immutable Upgrades

Operating System

Run Vault as an Unprivileged User

Secure Files and Directories

# Set permissions on Vault folder
chmod 740 –R /etc/vault.d

Protect the Storage Backend

Disable Shell History

history
1365  vault login hvs.RTMd9YZ5Np9WGjvTfARaqffQ
1366  vault policy list
1367  vault list sys/policies/acl
1368  vault secrets list
1369  vault list pki/roles

# Disable command history system wide
echo 'set +o history' >> /etc/profile

Configure SELinux/AppArmor

Hardening HashiCorp Vault with SELinux

Turn Off Core Dumps

Protect and Audit the vault.service File

Patch the Operating System Frequently

Disable Swap

Vault-Specific Configurations

Secure Vault with TLS

Secure Consul

Enable Auditing

Say No to Cleartext Credentials

Upgrade Vault Frequently

Stop Using Root Tokens, Seriously

Verify the Integrity of the Vault Binary

Disable the UI – if Not in Use

Encrypt the Gossip Protocol (Consul)

Secure the Unseal/Recovery Keys

Minimize the TTLs for Leases and Tokens

Follow the Principle of Least Privilege

Perform Regular Backups

Integrate with Existing Identity Providers