This repository provides a quick setup for HashiCorp Vault. This is essential if you're preparing for the Cisco Certified DevNet Expert exam. With Docker Compose, you can easily launch a Vault instance to secure your applications and manage secrets.
Ensure you have Docker and Docker Compose installed on your machine. Then, follow these steps:
- Execute
docker-compose up -dto start the Vault. - Verify it using
docker ps -a. - Visit
https://localhost:8200.
Before using the Vault CLI, set the following environment variables:
export VAULT_ADDR=https://127.0.0.1:8200
export VAULT_CACERT=<absolute_path_to_repo>/certs/vault.crt
export VAULT_TOKEN="s.wkFzpK95G7g5B6kh9myEBMM6"Note: Adjust the VAULT_CACERT path to match your local repository location. The VAULT_TOKEN should be set to your root token obtained after initializing Vault.
vault statusExample output:
Key Value
--- -----
Seal Type shamir
Initialized true
Sealed false
Total Shares 1
Threshold 1
Version 1.8.0
Build Date n/a
Storage Type file
Cluster Name vault-cluster-ebf0f42f
Cluster ID 732ffdf5-3f6b-a55e-72fd-e81d202a4415
HA Enabled false
If Vault is not initialized, run:
vault operator initThis will output unseal keys and an initial root token. Save these securely!
If Vault is sealed, unseal it using:
vault operator unseal <unseal-key>For a single unseal key setup, you'll need to run this once.
For any issues or questions, feel free to open an issue in this repository.
In my DevNet Expert e-learning HashiCorp Vault is covered extensively. Learn everything from creating secrets to writing custom Python applications using the hvac library.