Usage
After configuring and deploying VAULT, use this page to get started. The following engines and authentication methods are enabled by default:
| Path | Type | Purpose |
|---|---|---|
secret/ | KV v2 secrets engine | Versioned static secrets such as passwords, API keys, and certificates |
transit/ | Transit secrets engine | Encryption as a service; applications send data for encryption/decryption while keys remain in VAULT |
auth/approle/ | AppRole authentication | Machine credentials for applications and automation |
auth/token/ | Token authentication | Built-in; maximum lease adjusted to ten years |
OpenBao’s API is largely compatible with HashiCorp Vault, so common Vault client libraries and tools generally work directly. See the OpenBao documentation for full usage.
Endpoint
All clients should use the service domain over HTTPS and validate the server certificate with Pigsty CA:
| Item | Value |
|---|---|
| Address | https://vault.pigsty:8200 |
| CA certificate | /etc/pki/ca.crt on managed nodes; files/pki/ca/ca.crt on the admin node |
| TLS version | TLS 1.3 minimum |
In a three-member cluster, vault.pigsty points to the VIP and HAProxy forwards to the active member. Direct standby access also works; the standby forwards requests to the active member.
bao is installed with openbao on VAULT members. Other nodes can use curl with the HTTP API, or install openbao to obtain bao.
Administrator Login
Run these examples as root on a VAULT member with the root token. See Administrator Credentials:
Use the root token only for administration. Issue credentials with minimal privileges to applications.
KV Secrets
secret/ uses KV v2, which saves a new version on every write:
KV v2 policies and HTTP APIs use secret/data/<path> for secret reads/writes and secret/metadata/<path> for metadata.
Transit Encryption
transit/ provides encryption as a service. Applications send data for encryption or decryption without handling keys, suitable for encrypting sensitive database fields in the application layer.
Base64-encode plaintext first. After rotation, new data uses the new key version, while older ciphertext remains decryptable. Use transit/rewrap/app to rewrap old ciphertext with the new version.
Issue Application Credentials
Create a policy with only the permissions each application needs, then issue machine credentials through AppRole:
role_id acts as a username and secret_id as a password. Applications exchange them for a short-lived token, then use that token to access secrets:
Deliver secret_id through a secure channel. Restrict credentials further with secret_id_ttl, secret_id_num_uses, and token_bound_cidrs as needed.
Through the VIP, HAProxy forwards in TCP mode, so OpenBao sees the VAULT member’s address rather than the original client. Audit logs record that member address, and token_bound_cidrs set to client networks will reject these requests.
HTTP API
Clients without bao can call the HTTP API directly. For example, log in with AppRole and read a secret:
Unauthenticated endpoints support health checks and monitoring:
Reserved Paths
These paths and names are used by Pigsty or reserved for future features; do not use them for applications:
| Path / Name | Purpose |
|---|---|
tde/<pg_cluster> | Reserved for PGSQL pg_tde keys, KV v2, one per PG cluster |
kes/<minio_cluster> | Reserved for MINIO KES keys, KV v2, one per object-storage cluster |
tde-*, kes-* policies | Reserved for those consumers |
vault-backup policy | Backup token; read-only access to sys/storage/raft/snapshot |
Before whole-cluster removal, vault-rm.yml lists existing tde/* and kes/* mounts to identify consumers that will permanently lose keys.