
HashiCorp Vault Has a Free API: Here's How to Use It for Secrets Management
HashiCorp Vault provides a complete HTTP API for managing secrets, encryption keys, database credentials, and access policies. The open-source version is free and gives you enterprise-grade secrets management. Why Use the Vault API? Centralize all secrets in one secure location Rotate database credentials automatically Encrypt sensitive data without managing keys Audit every secret access with detailed logs Getting Started # Start Vault in dev mode vault server -dev export VAULT_ADDR = 'http://127.0.0.1:8200' export VAULT_TOKEN = 'your-root-token' # Store a secret curl -s -H "X-Vault-Token: $VAULT_TOKEN " \ -X POST " $VAULT_ADDR /v1/secret/data/myapp/config" \ -d '{"data": {"db_password": "supersecret", "api_key": "abc123"}}' | jq . # Read a secret curl -s -H "X-Vault-Token: $VAULT_TOKEN " \ " $VAULT_ADDR /v1/secret/data/myapp/config" | jq '.data.data' Python Client import requests class VaultClient : def __init__ ( self , addr = ' http://127.0.0.1:8200 ' , token = None ): self . addr
Continue reading on Dev.to
Opens in a new tab



