mattandClaude Sonnet 5.5 a13d2cb04a
CI / integration (push) Successful in 10s
CI / check (push) Successful in 12s
Add Dockerfile, nginx config and docker-compose demo
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-20 11:12:20 +01:00

EnvBao Admin

A browser-based admin UI for OpenBao. Create users and tokens, tie them to individual secrets without hand-writing policy HCL, and see who has access to what in an Identity → Policy → Secret graph.

Licensed under the BSD 3-Clause License.

The UI talks directly to the OpenBao HTTP API from the browser. There is no backend.

Quick start with Docker

docker compose up --build

Open http://localhost:8080 and connect to http://localhost:8200 with token root. This starts a throwaway in-memory OpenBao dev server (CORS pre-configured for the UI) and the UI. Not for production.

To run just the UI image: docker build -t envbao-admin . && docker run -p 8080:80 envbao-admin.

OpenBao setup

Quickstart (dev mode)

bao server -dev -dev-root-token-id=root
export BAO_ADDR=http://127.0.0.1:8200
export BAO_TOKEN=root

Dev mode already mounts secret/ as KV v2. Then enable CORS and userpass (below) and run npm install && npm run dev.

CORS

The browser must be allowed to call OpenBao from the UI's origin. Either set it in the server config:

listener "tcp" {
  address     = "0.0.0.0:8200"
  tls_disable = false
  # ...
}

and then configure CORS at runtime:

bao write sys/config/cors \
  enabled=true \
  allowed_origins="http://localhost:5173" \
  allowed_headers="X-Vault-Token,Content-Type"

Use your real UI origin in production.

Auth method and secrets engine

bao auth enable userpass
bao secrets enable -path=secret -version=2 kv   # skip if already mounted

Admin policy for the UI

Least privilege for the account that uses the UI:

path "sys/policies/acl/*"      { capabilities = ["create", "read", "update", "delete", "list"] }
path "sys/policies/acl"        { capabilities = ["list"] }
path "auth/userpass/users/*"   { capabilities = ["create", "read", "update", "delete", "list"] }
path "auth/userpass/users"     { capabilities = ["list"] }
path "auth/token/create"       { capabilities = ["create", "update"] }
path "auth/token/lookup"       { capabilities = ["update"] }
path "auth/token/accessors"    { capabilities = ["list"] }
path "auth/token/revoke-accessor" { capabilities = ["update"] }
path "identity/*"              { capabilities = ["create", "read", "update", "delete", "list"] }
path "sys/mounts"              { capabilities = ["read"] }
path "secret/metadata/*"       { capabilities = ["list"] }
path "sys/capabilities"        { capabilities = ["update"] }

Admin login

bao policy write envbao-admin envbao-admin.hcl
bao write auth/userpass/users/admin password=... policies=envbao-admin
# or
bao token create -policy=envbao-admin

Log in to the UI with either the userpass credentials or the token.

Deployment

npm ci
npm run build

This produces a static dist/ directory. Serve it with any static host, with an SPA fallback to index.html. Use HTTPS: the OpenBao token is held in the browser, and browsers block mixed content from an HTTPS page to an HTTP OpenBao.

nginx:

server {
  listen 443 ssl;
  server_name envbao.example.com;
  root /srv/envbao-admin/dist;
  location / { try_files $uri /index.html; }
}

Caddy:

envbao.example.com {
  root * /srv/envbao-admin/dist
  try_files {path} /index.html
  file_server
}

The OpenBao URL is entered on the Connect screen. Add the UI's origin to OpenBao's CORS allowed origins.

CI runs on Gitea Actions (.gitea/workflows/): lint, test, build.

Limitations

  • Browser-direct access means CORS must be enabled on OpenBao, and the token lives in the browser (in memory; sessionStorage optional).
  • No server-side audit trail beyond OpenBao's own audit log.
  • KV v2 only.
  • Only userpass auth, tokens and identity entities/groups are supported.
  • Policies not created by the UI (not named envbao-*) are shown read-only in the graph.
  • Glob and templated policy paths are approximated.
  • The graph is not paginated, so large instances may be slow.
S
Description
No description provided
Readme BSD-3-Clause
772 KiB
0 Stars 1 Watchers 0 Forks
Languages
TypeScript 92%
CSS 6.2%
Shell 1.4%
Dockerfile 0.3%