Skip to main content

HashiCorp Vault Setup

Overview

HashiCorp Vault is used for:

  • Secrets management
  • Encryption key storage
  • Secure credentials handling
  • Private key management

Deployment Options

HashiCorp Cloud Platform Setup

  1. Create Vault Cluster

    • Sign up for HashiCorp Cloud
    • Choose Development tier (sufficient for most setups)
    • Select "Start from Scratch" template
    • Pick your preferred region
  2. Configure Secret Engines

    • Create KV secret engines:
      vault secrets enable -path=ethereum kv-v2
      vault secrets enable -path=ipfs kv-v2
      vault secrets enable -path=fabric kv-v2
  3. Set Up Authentication

    • Enable AppRole auth method:
      vault auth enable approle
    • Create platform policy:
      vault policy write btp - <<EOF
      path "ethereum/*" {
      capabilities = ["create", "read", "update", "delete", "list"]
      }
      path "fabric/*" {
      capabilities = ["create", "read", "update", "delete", "list"]
      }
      path "ipfs/*" {
      capabilities = ["create", "read", "update", "delete", "list"]
      }
      EOF
  4. Create Platform Role

    vault write auth/approle/role/platform-role \
    token_ttl=1h \
    token_max_ttl=4h \
    secret_id_ttl=6h \
    policies="btp"
  5. Generate Credentials

    # Get Role ID
    vault read auth/approle/role/platform-role/role-id

    # Generate Secret ID
    vault write -force auth/approle/role/platform-role/secret-id
tip

HCP Vault provides:

  • Managed infrastructure
  • Automatic updates
  • Built-in high availability
  • Professional support

Information Collection

Validation

Test your Vault configuration:

# Set environment variables
export VAULT_ADDR="your-vault-address"
export VAULT_NAMESPACE="admin" # For HCP Vault
export VAULT_ROLE_ID="your-role-id"
export VAULT_SECRET_ID="your-secret-id"

# Verify access
vault write auth/approle/login \
role_id=$VAULT_ROLE_ID \
secret_id=$VAULT_SECRET_ID

Troubleshooting

Common issues and solutions:

  1. Authentication Failures

    • Verify role ID and secret ID
    • Check policy attachments
    • Confirm namespace setting
    • Validate token TTLs
  2. Connection Issues

    • Verify Vault address
    • Check network access
    • Confirm TLS settings
    • Validate namespace (HCP)

Next Steps

  1. ✅ Set up Vault instance
  2. ✅ Configure authentication
  3. ➡️ Proceed to Metrics and Logs Setup
Need Help?

Contact [email protected] if you encounter any issues.