Skip to content

Instantly share code, notes, and snippets.

@dghadge
Created May 22, 2017 20:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dghadge/a1d9038aa54e33bf5d041b5ef6513292 to your computer and use it in GitHub Desktop.
Save dghadge/a1d9038aa54e33bf5d041b5ef6513292 to your computer and use it in GitHub Desktop.
Obfuscating MySQL passwords with Hashicorp Vault - Setup
1. Start Consul server. It is used by Vault for persisting secrets.
$ consul agent -server -bootstrap-expect 1 -data-dir /tmp/consul -bind 127.0.0.1
2. Start Vault
$ vault server -config=vault.conf
$ cat vault.conf
--------Start : vault.conf --------------------
backend "consul" {
address = "127.0.0.1:8500"
path = "vault"
}
listener "tcp" {
address = "127.0.0.1:8200"
tls_cert_file = "prod.cert.pem"
tls_key_file = "prod.key.pem"
}
--------End : vault.conf --------------------
3. Initialize Vault
$ vault init -key-shares=3 -key-threshold=5
4. Unseal Vault
$ vault unseal key1 [ key2, key3 ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment