Vault Installation
Vault Installation
Physical Servers
A Laptop
Installing Vault
1 Install Vault
3 Initialize Vault
4 Unseal Vault
Installing Vault
• So where do I download Vault?
• vaultproject.io
• releases.hashicorp.com/vault
• You can also download/install Vault using your preferred package manager as well (apt, yum, even
homebrew (community supported) )
Terminal
$ sudo apt update && sudo apt install gpg
Proof of Concepts
• For Linux, you also need a systemd file to manage the service for Vault
(and Consul if you're running Consul)
Running Vault Server in Production
• Systemd for a Consul client (that would run on the Vault node):
• https://github.com/btkrausen/hashicorp/blob/master/vault/config_files/consul-client.json
Running Vault Server in ProducKon
Single Node
Configuration
TLS
File
Storage
Backend
Running Vault Server in Production
MulQ-Node Vault Cluster (with Integrated Storage)
Integrated Storage
Replication
(network)
Running Vault Server in Production
Multi-Node Vault Cluster (with external storage backend)
Storage
Backend (HA)
Running Vault Server in Production
Step-by-Step Manual Install
VPC
storage "consul" {
address = "127.0.0.1:8500"
path = "vault/"
token = "1a2b3c4d-1234-abdc-1234-1a2b3c4d5e6a"
}
listener "tcp" {
address = "0.0.0.0:8200"
cluster_address = "0.0.0.0:8201"
tls_disable = 0
tls_cert_file = "/etc/vault.d/client.pem"
tls_key_file = "/etc/vault.d/cert.key"
tls_disable_client_certs = "true"
}
seal "awskms" {
region = "us-east-1"
kms_key_id = "12345678-abcd-1234-abcd-123456789101",
endpoint = "example.kms.us-east-1.vpce.amazonaws.com"
}
api_addr = "https://vault-us-east-1.example.com:8200"
cluster_addr = " https://node-a-us-east-1.example.com:8201"
cluster_name = "vault-prod-us-east-1"
ui = true
log_level = "INFO"
https://github.com/btkrausen/hashicorp/blob/master/vault/config_files/vault.hcl
Deploying the Consul Storage Backend
Example Consul Server Configuration File
{
"log_level": "INFO",
"server": true,
"key_file": "/etc/consul.d/cert.key",
"cert_file": "/etc/consul.d/client.pem",
"ca_file": "/etc/consul.d/chain.pem",
"verify_incoming": true,
"verify_outgoing": true,
"verify_server_hostname": true,
"ui": true,
"encrypt": "xxxxxxxxxxxxxx",
"leave_on_terminate": true,
"data_dir": "/opt/consul/data",
"datacenter": "us-east-1",
"client_addr": "0.0.0.0",
"bind_addr": "10.11.11.11",
"advertise_addr": "10.11.11.11",
"bootstrap_expect": 5,
"retry_join": ["provider=aws tag_key=Environment-Name tag_value=consul-cluster region=us-east-1"],
"enable_syslog": true,
"acl": {
"enabled": true,
"default_policy": "deny",
"down_policy": "extend-cache",
"tokens": {
"agent": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
},
"performance": {
"raft_multiplier": 1
}
} https://github.com/btkrausen/hashicorp/blob/master/consul/config.hcl
Looking for More on Consul?
All Vault nodes have copy of Vault's Data Built-in Snapshots For Data Retention
• Integrated Storage (aka Raft) allows Vault nodes to provide its own
replicated storage across the Vault nodes within a cluster
• Define a local path to store replicated data
• All data is replicated among all nodes in the cluster
• Eliminates the need to also run a Consul cluster and manage it
Deploying the Integrated Storage Backend
Vault Node A Vault Node B Vault Node C
tcp/8201
storage "raft" {
path = "/opt/vault/data"
node_id = "node-a-us-east-1.example.com"
retry_join {
auto_join = "provider=aws region=us-east-1 tag_key=vault tag_value=us-east-1"
}
}
listener "tcp" {
address = "0.0.0.0:8200"
cluster_address = "0.0.0.0:8201"
tls_disable = 0
tls_cert_file = "/etc/vault.d/client.pem"
tls_key_file = "/etc/vault.d/cert.key"
tls_disable_client_certs = "true"
}
seal "awskms" {
region = "us-east-1"
kms_key_id = "12345678-abcd-1234-abcd-123456789101",
endpoint = "example.kms.us-east-1.vpce.amazonaws.com"
}
api_addr = "https://vault-us-east-1.example.com:8200"
cluster_addr = " https://node-a-us-east-1.example.com:8201"
cluster_name = "vault-prod-us-east-1"
ui = true
log_level = "INFO"
https://github.com/btkrausen/hashicorp/blob/master/vault/config_files/vault_int_storage.hcl
Deploying the Integrated Storage Backend
Vault Node A Vault Node B Vault Node C Vault Node D Vault Node E
HA
Cluster
Leader Follower Follower Follower Follower
Replicated Data
Deploying the Integrated Storage Backend