Getting started with HashiCorp Vault

Getting started with HashiCorp Vault

30.478 Lượt nghe
Getting started with HashiCorp Vault
In this video I will give you an introduction to HashiCorp Vault and how you can run it locally in a Docker container (in Development mode). I will walk you through the process of getting the docker image and setting everything up to successfully connect to the vault server and write and read secrets. COMMANDS Get docker image: docker pull vault Running image: docker run -d --rm --name vault-server --cap-add=IPC_LOCK -e 'VAULT_DEV_ROOT_TOKEN_ID=tdc-token' -e 'VAULT_DEV_LISTEN_ADDRESS=0.0.0.0:8200' vault Get IP Address: docker inspect vault-server | grep IPAddress Set environment variable: export VAULT_ADDR='http://172.17.0.2:8200' Authenticate to server from CLI: vault login Write secret (CLI): vault kv put secret/tdc tdcpassword=test1234 Read secret (CLI): vault kv get secret/tdc INFO vault info: https://vaultproject.io vault CLI download: https://vaultproject.io/downloads docker image at: https://hub.docker.com/_/vault hvac info at: https://hvac.readthedocs.io/en/stable/overview.html#getting-started ========================== Python script (run pip install hvac first!): import hvac client = hvac.Client(url='http://172.17.0.2:8200',token="tdc-token") print(client.is_authenticated()) read_response = client.secrets.kv.read_secret_version(path='tdc') print(read_response['data']['data']['tdcpassword'])