Documentation · Usage
Quickstart with OpenBao
Run Credvane on your machine with OpenBao as its secret store and Keycloak for sign-in, declare a policy, add a credential that is checked against GitHub, and read it with the command line. About fifteen minutes.
What you get
| Service | Address | Role |
|---|---|---|
| Credvane | http://localhost:9091 | The web app and the credentials API |
| OpenBao | http://localhost:8200 | Holds every credential value, and Credvane's own secrets |
| Keycloak | http://keycloak.localhost:8180 | Sign-in, with one admin already set up |
| Postgres | inside the network only | Specs, owners, history and the audit log; never a value |
You need Docker with Compose, ports 9091, 8180 and 8200 free, openssl, and a GitHub account for step 5. Everything listens on this machine only.
This is for trying Credvane out. OpenBao runs in development mode and keeps everything in memory, so values are gone when it stops. From here to production lists what to change.
1. Get the files
Two files in a new folder: compose.yaml and credvane-realm.json, the Keycloak realm with the Credvane client, the credvane-admins group and one admin.
mkdir credvane-quickstart && cd credvane-quickstart
curl -fsSLO https://credvane.dev/quickstart/compose.yaml
curl -fsSLO https://credvane.dev/quickstart/credvane-realm.jsonRead compose.yaml
# Credvane quickstart: Credvane, Postgres, OpenBao and Keycloak on one machine.
# For trying Credvane out, not for production: OpenBao runs in dev mode, in memory, so values are lost when it stops.
# Create .env first (see the quickstart), then: docker compose up -d
name: credvane-quickstart
services:
postgres:
image: postgres:17
environment:
POSTGRES_DB: credvane
POSTGRES_USER: credvane
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?run the .env step of the quickstart first}
volumes: [postgres-data:/var/lib/postgresql/data]
healthcheck:
test: ["CMD-SHELL", "pg_isready -U credvane -d credvane"]
interval: 3s
retries: 20
# Where Credvane keeps every credential value. Port 8200 is published on this machine only, to look inside.
openbao:
image: openbao/openbao:2.4.1
command: ["server", "-dev", "-dev-listen-address=0.0.0.0:8200"]
environment:
BAO_DEV_ROOT_TOKEN_ID: ${BAO_TOKEN:?run the .env step of the quickstart first}
ports: ["127.0.0.1:8200:8200"]
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://127.0.0.1:8200/v1/sys/health | grep -q '\"sealed\":false'"]
interval: 3s
retries: 20
# Sign-in. The realm file adds the Credvane client, the credvane-admins group and one admin.
# The name keycloak.localhost reaches this container from Credvane and from your browser alike.
keycloak:
image: quay.io/keycloak/keycloak:26.4
command: ["start-dev", "--http-port=8180", "--import-realm"]
environment:
KC_BOOTSTRAP_ADMIN_USERNAME: admin
KC_BOOTSTRAP_ADMIN_PASSWORD: ${ADMIN_PASSWORD:?run the .env step of the quickstart first}
KC_HEALTH_ENABLED: "true"
OAUTH_CLIENT_SECRET: ${OAUTH_CLIENT_SECRET:?run the .env step of the quickstart first}
ADMIN_PASSWORD: ${ADMIN_PASSWORD}
volumes: ["./credvane-realm.json:/opt/keycloak/data/import/credvane-realm.json:ro"]
ports: ["127.0.0.1:8180:8180"]
networks:
default:
aliases: [keycloak.localhost]
healthcheck:
test: ["CMD-SHELL", "exec 3<>/dev/tcp/127.0.0.1/9000; printf 'GET /health/ready HTTP/1.0\\r\\n\\r\\n' >&3; grep -q '\"UP\"' <&3"]
interval: 5s
retries: 30
credvane:
image: ghcr.io/commitwisedev/credvane:latest
depends_on:
postgres: { condition: service_healthy }
openbao: { condition: service_healthy }
keycloak: { condition: service_healthy }
ports: ["127.0.0.1:9091:9091"]
environment:
CREDVANE_PUBLIC_URL: http://localhost:9091
DATASOURCES_DEFAULT_URL: jdbc:postgresql://postgres:5432/credvane?currentSchema=credvane
DATASOURCES_DEFAULT_USERNAME: credvane
DATASOURCES_DEFAULT_PASSWORD: ${POSTGRES_PASSWORD}
# Credvane's own secret store: the OpenBao above, KV version 2 at secret/, under credvane/.
CREDVANE_SECRET_STORE_PLATFORM_TYPE: bao
CREDVANE_SECRET_STORE_ADDRESS: http://openbao:8200
CREDVANE_SECRET_STORE_TOKEN: ${BAO_TOKEN}
# OpenBao and Keycloak are on this machine's private network and speak plain http. Credvane refuses that
# unless told otherwise; leave it off in production.
CREDVANE_SOURCES_ALLOW_PRIVATE_HOSTS: "true"
OAUTH_ISSUER: http://keycloak.localhost:8180/realms/credvane
OAUTH_CLIENT_ID: credvane
OAUTH_CLIENT_SECRET: ${OAUTH_CLIENT_SECRET}
CREDVANE_ADMIN_GROUPS: credvane-admins
CREDVANE_ORG_NAME: Example
volumes:
postgres-data:
Read credvane-realm.json
{
"realm": "credvane",
"enabled": true,
"groups": [{ "name": "credvane-admins" }],
"clients": [
{
"clientId": "credvane",
"name": "Credvane",
"protocol": "openid-connect",
"publicClient": false,
"clientAuthenticatorType": "client-secret",
"secret": "${OAUTH_CLIENT_SECRET}",
"standardFlowEnabled": true,
"directAccessGrantsEnabled": false,
"redirectUris": ["http://localhost:9091/oauth/callback/keycloak"],
"webOrigins": ["http://localhost:9091"],
"attributes": { "post.logout.redirect.uris": "http://localhost:9091/logout" },
"protocolMappers": [
{
"name": "groups",
"protocol": "openid-connect",
"protocolMapper": "oidc-group-membership-mapper",
"config": {
"claim.name": "groups",
"full.path": "true",
"multivalued": "true",
"id.token.claim": "true",
"access.token.claim": "true",
"userinfo.token.claim": "true"
}
}
]
}
],
"users": [
{
"username": "admin",
"email": "[email protected]",
"emailVerified": true,
"firstName": "Quickstart",
"lastName": "Admin",
"enabled": true,
"groups": ["credvane-admins"],
"credentials": [{ "type": "password", "value": "${ADMIN_PASSWORD}", "temporary": false }]
}
]
}
2. Create the secrets
Credvane ships with no default secrets and no default admin, so you make them. In the same folder:
cat > .env <<EOF
POSTGRES_PASSWORD=$(openssl rand -hex 16)
BAO_TOKEN=$(openssl rand -hex 16)
OAUTH_CLIENT_SECRET=$(openssl rand -hex 16)
ADMIN_PASSWORD=$(openssl rand -hex 12)
EOF| Variable | Used for |
|---|---|
BAO_TOKEN | OpenBao's root token, which Credvane uses to read and write values |
OAUTH_CLIENT_SECRET | Shared by Keycloak and Credvane for sign-in |
ADMIN_PASSWORD | The admin user's password, in Keycloak's realm and its console |
POSTGRES_PASSWORD | The database |
3. Start it
docker compose up -d --wait
docker compose logs credvane | grep "secret store"... d.c.s.PlatformSecretsStartupProbe - platform secret store verifiedThe first start downloads the images. Before it accepts a request, Credvane writes a test value to OpenBao, reads it back and deletes it; if OpenBao were unreachable or the token wrong, it would refuse to start and say why.
The compose file tells Credvane where OpenBao is with three settings, the same ones you would use for a real deployment:
CREDVANE_SECRET_STORE_PLATFORM_TYPE=bao
CREDVANE_SECRET_STORE_ADDRESS=http://openbao:8200
CREDVANE_SECRET_STORE_TOKEN=${BAO_TOKEN}4. Sign in
Open http://localhost:9091 and sign in as admin with the password from grep ADMIN_PASSWORD .env. You are an admin because Keycloak puts admin in the credvane-admins group, which the compose file names in CREDVANE_ADMIN_GROUPS. The admin pages are in the left menu.
5. Declare a spec and add a credential
- Secrets → Specs → Add spec. Name GitHub packages (read), key
github-packages, source GitHub, scoperead:packages. GitHub.com needs no source setup. - Credentials → Add credential, choose the spec, and follow its link to GitHub's new-token page: the description and the
read:packagesscope are filled in. Create a classic token with a short expiry and paste it. - Credvane asks GitHub what the token can do. With exactly
read:packagesit becomes Active and Verified, with its GitHub account and expiry. Tick one more scope and try again: it is Rejected, and the value is never stored.
6. See where the value lives
The value is in OpenBao, under secret/credvane/orgs/<organization>/credentials/<credential>. Look with the bao command inside the container, or sign in to OpenBao's own UI at http://localhost:8200/ui with BAO_TOKEN.
docker compose exec openbao sh -c \
'BAO_ADDR=http://127.0.0.1:8200 BAO_TOKEN=$BAO_DEV_ROOT_TOKEN_ID bao kv list secret/credvane/orgs'Postgres holds only a reference to it:
docker compose exec postgres psql -U credvane \
-c "select value_reference from credvane.credential" value_reference
----------------------------------------------------------
openbao:credentials/ad52632a-e9ea-441b-addb-dcae8913d5b0Next to the organization folders, secret/credvane/credvane/value-fingerprint-key is the key Credvane uses to recognise a leaked value without storing it.
7. Read it from the command line
Install the credvane CLI, then sign in with your browser, approve, and run a command with the token. The program sees GH_TOKEN; your shell never does.
credvane login --url http://localhost:9091
credvane ls
credvane run github-packages=GH_TOKEN -- \
sh -c 'curl -s -H "Authorization: Bearer $GH_TOKEN" https://api.github.com/user | grep login'Back in the web app, Audit has an entry for the read, by you, through credvane CLI on <your machine>. Exchange tokens lists the CLI session; end it there or with credvane logout.
8. Clean up
docker compose down -vThis removes the containers and the database. OpenBao's values were only in memory, so they are gone too.
From here to production
| In the quickstart | In production |
|---|---|
| OpenBao in development mode, in memory | A persistent, sealed OpenBao (or Vault) cluster that you back up with Postgres, as a pair |
| OpenBao's root token | AppRole with a policy for Credvane's path only: see secret stores |
Plain HTTP on this machine, with CREDVANE_SOURCES_ALLOW_PRIVATE_HOSTS=true | HTTPS behind your proxy; private addresses refused |
| Keycloak with one local user | Your own identity provider, ideally with SCIM: see sign-in and provisioning |
| Values in Credvane's platform store | Optionally a store of your organization's own, in Settings → Secret store |
The install guide covers the rest.