Skip to navigation

Secret Manager quickstart

In about five minutes you enable Secret Manager in a workspace, save a database password as the secret payments/db, and read it back from your terminal with the bao CLI. At the end you’ll know the three values every client needs: the address, the namespace and a token.

Before you begin

  • A workspace where you can create resources: you’re the Owner, an Admin, or a Technical member with access to it. See Team members & access roles.
  • Your organization’s identity verification is complete, and your wallet passes the billing check.
  • A Vault-compatible CLI on your computer: the OpenBao CLI bao (download) or HashiCorp’s vault. Both use the same commands; this page uses bao.

Steps

1

Open Secret Manager

Open the workspace. In the sidebar, under Tools, click Secret Manager.

2

Enable it

On Enable Secret Manager:

  1. Location: keep the location shown, for example Amaravati (VGA). It can’t be changed later.
  2. Namespace: enter a name such as acme-payments: 3–32 lowercase letters, digits and single hyphens. Wait for Available. The namespace can’t be changed later.
  3. Versions to keep: keep the default (10 per secret) or click Change.
  4. Check the prices under Pricing · pay as you go, excl. GST, then click Enable Secret Manager.

The page shows Setting up Secret Manager, usually for a few seconds, then Secret Manager is ready.

3

Create a secret

Click Create secret. In Name, enter payments/db. Under Key/value pairs, add the key username with the value app, click Add value, then add the key password with a value. Click Create Secret.

The toast Secret created appears. The secret’s first version is v1.

4

Point your terminal at the workspace

Click the Connect tab. Under Point your client at this workspace, copy the two lines and run them:

export VAULT_ADDR=https://secrets.ibee.ai
export VAULT_NAMESPACE=acme-payments

Use the address and namespace your Connect tab shows: they belong to your workspace and location.

5

Get a 60-second CLI session

Under Sign in, click Get a 60-second CLI session. Copy the VAULT_TOKEN line, run it, tick I have copied the token and click Done.

export VAULT_TOKEN=<token from the dialog>

The token acts as you, lasts 60 seconds and can’t be renewed. If it expires, every command answers permission denied; get a new session.

6

Read the secret

bao kv get -mount=secret payments/db

Verify it worked

The command prints the secret’s metadata, then its data:

====== Data ======
Key Value
--- -----
password <your password>
username app

The CLI prints values in plain text, so don’t run it where others can see your screen or where the output is logged.

To read one value in a script, use -field:

bao kv get -mount=secret -field=password payments/db

The same read over plain HTTP:

curl -s "$VAULT_ADDR/v1/secret/data/payments/db" \
-H "X-Vault-Token: $VAULT_TOKEN" \
-H "X-Vault-Namespace: $VAULT_NAMESPACE" | jq '.data.data'

Each read is one billed operation (₹4 per 10,000). See Pricing.

Give your application its own login

The CLI session is for people. For an application, VM, CI job or Kubernetes cluster, create an app credential: it signs in with a Role ID and a Secret ID and gets a token that lasts an hour and renews for up to a day.

export VAULT_TOKEN=$(bao write -field=token auth/approle/login \
role_id="$ROLE_ID" secret_id="$SECRET_ID")
bao kv get -mount=secret payments/db

See App credentials to create one, and Read secrets from your app for Python, Node.js, bao agent and curl.

Troubleshooting

You seeWhat it meansWhat to do
Enable Secret Manager stays greyed outPrices haven’t loaded, or the namespace isn’t available yetWait for Available., or choose another name
”This name is reserved. Choose another one.”Words such as prod, dev, test, api and names starting with ibee, ws- or sm- are reservedUse a name with your company or project, such as acme-payments
Billing needs attentionBilling refused the enableClick Add Credits, then enable again
permission deniedThe 60-second session expiredGet a new session
404 with namespace not foundVAULT_NAMESPACE is wrongCopy it again from Connect
404 with no bodyVAULT_NAMESPACE isn’t set, so the request carries no namespaceRun the export VAULT_NAMESPACE=… line

More errors are in Troubleshooting.