Hardening: session expiry and sealed handling, request timeout, list states, a11y, tested admin policy, security headers, README
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
265c618884
commit
a63f7c0faa
30 files changed
+623
-76
No files matched your search
+1
-1
@@ -11,7 +11,7 @@ EnvBao needs an admin UI over an OpenBao instance so users/tokens can be created
|
||||
## Architecture
|
||||
- `src/api/bao.ts`: typed fetch client (`X-Vault-Token`, base URL config, error mapping). Endpoints: `sys/policies/acl`, `auth/userpass/users`, `auth/token/create|lookup|accessors`, `identity/entity|group`, `sys/mounts`, `secret/metadata` (KV v2), `sys/capabilities`.
|
||||
- `src/model/`: `buildAccessGraph()` — parses ACL policy HCL path rules into `{path, capabilities}`, joins with identities' attached policies → nodes/edges. Pure and unit-testable.
|
||||
- Managed-policy convention: UI generates one policy per (identity, secret path set) named `envbao-<identity>`, so grants are editable via a simple "secret path + capability checkboxes" form rather than raw HCL (raw HCL view available).
|
||||
- Managed-policy convention (as built): one policy per user/entity/group named `envbao-<kind>-<name>`, marked with an `# envbao-owner:` header; tokens cannot be granted to after creation. Originally planned as `envbao-<identity>`, so grants are editable via a simple "secret path + capability checkboxes" form rather than raw HCL (raw HCL view available).
|
||||
- UI libs: React Router, TanStack Query (server state), `@xyflow/react` (React Flow) + dagre layout for graph, Vitest for tests.
|
||||
|
||||
## Screens
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
# Least-privilege policy for the account that uses EnvBao Admin.
|
||||
# Adjust "secret" if your KV v2 mount has a different path.
|
||||
|
||||
# Policies: list, read, create/update and delete (managed `envbao-*` and read-only viewing of the rest)
|
||||
path "sys/policies/acl" { capabilities = ["list"] }
|
||||
path "sys/policies/acl/*" { capabilities = ["create", "read", "update", "delete"] }
|
||||
|
||||
# Userpass users
|
||||
path "auth/userpass/users" { capabilities = ["list"] }
|
||||
path "auth/userpass/users/*" { capabilities = ["create", "read", "update", "delete"] }
|
||||
|
||||
# Identity entities, aliases and groups
|
||||
path "identity/entity/name" { capabilities = ["list"] }
|
||||
path "identity/entity/name/*" { capabilities = ["create", "read", "update", "delete"] }
|
||||
path "identity/entity-alias" { capabilities = ["create", "update"] }
|
||||
path "identity/entity-alias/id/*" { capabilities = ["read", "delete"] }
|
||||
path "identity/group/name" { capabilities = ["list"] }
|
||||
path "identity/group/name/*" { capabilities = ["create", "read", "update", "delete"] }
|
||||
|
||||
# Tokens: create, list (needs sudo in OpenBao), inspect and revoke by accessor
|
||||
path "auth/token/create" { capabilities = ["create", "update"] }
|
||||
path "auth/token/accessors" { capabilities = ["list", "sudo"] }
|
||||
path "auth/token/lookup-accessor" { capabilities = ["update"] }
|
||||
path "auth/token/revoke-accessor" { capabilities = ["update"] }
|
||||
|
||||
# Discovery: mounted auth methods and secrets engines, and KV v2 metadata for the secret browser
|
||||
path "sys/auth" { capabilities = ["read"] }
|
||||
path "sys/mounts" { capabilities = ["read"] }
|
||||
path "secret/metadata/*" { capabilities = ["list"] }
|
||||
Reference in new issue
Block a user