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:
co-authored by
Claude Opus 5.5
parent
ce6dad9a58
commit
c50020e420
+8
-2
@@ -83,7 +83,13 @@ History is kept in memory: after a pod restart the windows fill again. The statu
|
||||
|
||||
The web interface reads the cluster through the module's own service account (`d8:cluster-map` ClusterRole): `get`, `list`, `watch` on namespaces, pods, services, nodes, events, deployments, statefulsets, daemonsets, cronjobs, ingresses, Deckhouse `clusteralerts` and operator-trivy `vulnerabilityreports`, `get` and `list` on `metrics.k8s.io` pods and nodes, and `get` on `pods/log`. It never reads Secrets or ConfigMaps and has no write verbs. Changes go through [actions](#actions), which use the viewer's own identity.
|
||||
|
||||
This means **anyone admitted to the web interface sees every namespace and can read container logs**, whatever their own RBAC permissions are; what they can change is limited by their own RBAC. Restrict access with `auth.allowedUserGroups` (and optionally `auth.allowedUserEmails` and `auth.whitelistSourceRanges`).
|
||||
**What a viewer sees follows the viewer's own RBAC** (`auth.visibility: ViewerRBAC`, the default). With every request the DexAuthenticator passes the user's token; the module asks the API server with that token (`SelfSubjectAccessReview`) and caches the answer for a minute:
|
||||
|
||||
- `list pods` in all namespaces — the whole cluster;
|
||||
- otherwise only the namespaces where the user can `list pods`; cards, YAML, events, load and vulnerabilities of other namespaces are not returned, and a traffic peer there is shown as a hidden peer, with its connections but without its name;
|
||||
- container logs additionally need `get pods/log` in that namespace, node cards and the node view `list nodes`; cluster-wide alerts are shown to cluster-wide viewers only.
|
||||
|
||||
With `auth.visibility: Everything`, anyone admitted to the web interface sees every namespace and can read container logs, whatever their own RBAC is. In both modes restrict who is admitted with `auth.allowedUserGroups` (and optionally `auth.allowedUserEmails` and `auth.whitelistSourceRanges`); what a user can change always follows their own RBAC.
|
||||
|
||||
The frontend is served with a strict Content Security Policy: only its own scripts, styles and API, no inline code, no framing.
|
||||
|
||||
@@ -99,6 +105,6 @@ The pod exposes Prometheus metrics on port `9090` (`cluster_map_*`: Hubble strea
|
||||
## Limitations
|
||||
|
||||
- One replica: traffic history lives in the process. A second replica would keep its own history and double the load on hubble-relay.
|
||||
- Reading is all-or-nothing, as described in [Security](#security). Showing each user only what their RBAC allows to read is planned; actions already follow the user's RBAC.
|
||||
- Visibility is by namespace: a user who can list pods in a namespace sees all its cards, including the manifests of its Deployments and Services, even if their role would not let them read those objects one by one.
|
||||
- Alerts need the `prometheus` module, which creates `ClusterAlert` objects. Without it the map shows problems from object state and events only.
|
||||
- Traffic is L3/L4. HTTP-level details (paths, status codes) need Cilium L7 visibility and are not shown yet.
|
||||
|
||||
Reference in New Issue
Block a user