v0.10.0: each viewer sees what their own RBAC allows

Until now anyone admitted through Dex saw every namespace and every log,
read with the module's service account. auth.visibility: ViewerRBAC (the
default) asks the API server as the viewer, with the token the
DexAuthenticator forwards: list pods in all namespaces means the whole
cluster; otherwise the namespaces where they can list pods. Logs also
need get pods/log, node cards list nodes, cluster-wide alerts are for
cluster-wide viewers. Traffic to a hidden namespace keeps its counts with
the peer shown as hidden. One minute cache per token hash, SSARs in
parallel (8), a cluster-wide viewer costs two.

Verified against the live cluster with two real tokens: a service
account with view in one namespace got that namespace only (0 nodes, 403
on another namespace's YAML and logs, 403 on node usage); the module's
own account, cluster-wide, got all 56 namespaces and 6 nodes; no token,
401. auth.visibility: Everything keeps the old behaviour. The
DexAuthenticator now forwards the token when either actions or ViewerRBAC
need it (templates/_helpers.tpl).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Виталий Чефанов
2026-09-25 01:03:50 +03:00
co-authored by Claude Opus 5.5
parent ce6dad9a58
commit c50020e420
27 changed files with 791 additions and 26 deletions
+12 -1
View File
@@ -109,8 +109,19 @@ properties:
description: |
Access to the web interface.
Anyone admitted here sees every namespace, the manifests of workloads, Services and Ingresses (never Secrets) and container logs, through the module's own read-only service account. Restrict access with `allowedUserGroups`.
With `visibility: ViewerRBAC` (the default) each viewer sees only the namespaces their own RBAC lets them list pods in; with `Everything`, anyone admitted here sees every namespace, the manifests of workloads, Services and Ingresses (never Secrets) and container logs. Either way, restrict who is admitted with `allowedUserGroups`.
properties:
visibility:
type: string
default: ViewerRBAC
enum: ["ViewerRBAC", "Everything"]
description: |
What a viewer sees.
- `ViewerRBAC` — what the viewer's own permissions allow: the whole cluster for a viewer who can list pods in all namespaces, otherwise only the namespaces where they can list pods. Container logs additionally need `get pods/log`, node cards `list nodes`. Traffic to a hidden namespace is shown as coming from or going to a hidden peer. Checked with SelfSubjectAccessReviews as the viewer and cached for a minute.
- `Everything` — every admitted viewer sees the whole cluster, read with the module's service account.
`ViewerRBAC` needs the viewer's token: the `user-authn` module, or an `externalAuthentication` that puts a token the API server accepts into the `Authorization` header.
externalAuthentication:
type: object
description: |