Skip to navigation

App credentials

An app credential is a login for software, not a person. It has a Role ID (like a username, not secret) and a Secret ID (like a password, shown once). Your application exchanges them for a token at auth/approle/login and reads secrets with that token. Each credential is read only or read & write, for every secret in the workspace or one folder. Give every application its own credential, with the least access it needs.

How it works

  1. A workspace admin creates the credential and copies the Role ID and Secret ID.
  2. You give both to the application: environment variables, files, or a Kubernetes Secret.
  3. The application signs in and gets a token that lasts 1 hour and can be renewed for up to 24 hours. After that it signs in again.
  4. To change the Secret ID, you issue a new one; the old one stops working at once. To cut the application off entirely, you revoke the credential.
export VAULT_ADDR=https://secrets.ibee.ai
export VAULT_NAMESPACE=acme-payments
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

Before you begin

Choose the access

AccessFolderThe application can
Read only (recommended)None: “Every secret in the workspace, and read access to IBEE-managed secrets.”Read and list every secret in secret/ and ibee-managed/
Read onlyFor example payments: “Only secrets under payments/. IBEE-managed secrets are not included.”Read and list secret/payments/… only
Read & writeNone or a folderAlso create secrets, save new versions, and delete or undelete versions, in that scope

A read & write credential can’t destroy versions, delete a whole secret, or change a secret’s settings (metadata). People do those in the portal.

Create an app credential

1

Open app credentials

Open your organization. In the sidebar, under Organization, click API Tokens, then the Secret Manager tab. You can also start from the workspace: Secret Manager → Connect, under Sign in.

2

Start a credential

Click Create App Credential. The dialog says “A login your app uses to read secrets from one workspace and location.”

3

Fill in the details

  • Name: for example payments-api. Letters, numbers, dots, dashes or underscores, up to 64 characters, unique in the workspace.
  • Workspace and Location: where the secrets are.
  • Access: Read only (“Recommended for apps that only use secrets”) or Read & write (“Also create, update and delete secrets”).
  • Folder (optional): for example payments, to limit the credential to secrets under payments/.

Click Create credential. Setup takes a few seconds; the portal then issues the first Secret ID.

4

Copy the Secret ID

A dialog titled with the credential’s name, for example payments-api is ready, says “Copy the secret ID now. It is shown only once.” It shows the Role ID, the Secret ID, the address and the namespace. Click Copy all as environment variables to copy:

export VAULT_ADDR=https://secrets.ibee.ai
export VAULT_NAMESPACE=acme-payments
export ROLE_ID=<role id>
export SECRET_ID=<secret id>

Store them where the application reads its configuration (see below), then click I saved the secret ID.

Verify it worked

The credential appears in the list with the status Active and Issued and the date under Secret ID. From a terminal with the four variables set:

export VAULT_TOKEN=$(bao write -field=token auth/approle/login role_id="$ROLE_ID" secret_id="$SECRET_ID")
bao token lookup # shows the token's policies and remaining time

Give the credential to your application

Where it runsHow to hand it over
A server, VM or containerEnvironment variables ROLE_ID and SECRET_ID, or files readable only by the app’s user
A long-running processbao agent with role_id and secret_id files; the agent signs in and renews for you
KubernetesA Kubernetes Secret holding the Secret ID, referenced by External Secrets Operator. See Kubernetes.
CI (GitHub Actions, GitLab CI)Two masked CI secrets, ROLE_ID and SECRET_ID; sign in at the start of the job

Never put the Secret ID in source code, a container image, or logs.

Issue a new Secret ID (rotate)

In the credential’s row, click New secret ID, then Issue new secret ID in Issue a new secret ID.

  • The new Secret ID is shown once. Copy it and update the application.
  • The previous Secret ID stops working at once: the application can’t sign in with it again.
  • Applications already signed in keep their token until it expires, within a day.

Issue a new Secret ID when someone who had it leaves, if it may have leaked, or on a regular schedule. Update the application before its current token runs out.

Revoke an app credential

In the credential’s row, click Revoke, then Revoke credential. Apps using the credential “lose access within seconds, including ones already signed in.” The toast reads App credential revoked. Revoking can’t be undone; create a new credential if you need one again.

The credentials list

ColumnShows
NameThe credential’s name (“AppRole”)
Access”All secrets” or {folder}/, with the workspace and location
PermissionsRead only or Read & write
CreatedWhen it was created
Secret IDIssued with the date, or Not issued
StatusActive, Setting up or Revoking

Manage app credentials with the API

The IBEE API has the same actions: list, create, issue a Secret ID and revoke. The token needs secret-manager.read to list credentials and secret-manager.write to change them.

Limits

Value
App credentials per workspace50 (revoked ones don’t count)
Name1–64 characters: letters, digits, ., _ and -, starting with a letter or digit; unique among the workspace’s credentials
Secret IDNo expiry and no use limit, until you issue a new one or revoke the credential
Token from a login1 hour, renewable up to 24 hours
Logins5 per second from one IP address

Logins, token renewals and lookups aren’t billed.

Troubleshooting

You seeWhat it meansWhat to do
409 app_credential_limit — “This workspace has the most app credentials”50 credentials existRevoke unused ones
409 app_credential_name_takenAnother credential has the nameChoose another name
409 app_credential_pendingThe credential is still being set upWait a few seconds and try again
400 on auth/approle/login, saying the role or secret ID is invalidThe Secret ID was replaced, the credential was revoked, or a value was copied wronglyIssue a new Secret ID and update the app
403 permission denied when readingThe secret is outside the credential’s folder, or in ibee-managed/ with a folder-limited credentialUse a credential for that folder, or one with no folder
403 permission denied when writingThe credential is read only, or the workspace is read-onlyUse a read & write credential; see Workspace states
403 on login at the root namespace (bao agent)The namespace is set only in the agent’s vault {} blockSet namespace on the approle method. See bao agent.