11cbe6d7e0
Doc-only: redirect all references to Headlamp's own install namespace from kube-system to headlamp, except: - Driver namespace (CLAUDE.md) stays kube-system (upstream) - CSI controller API paths (docs/architecture/overview.md) stay kube-system (upstream workload) Co-Authored-By: Paperclip <noreply@paperclip.ing>
65 lines
1.8 KiB
Markdown
65 lines
1.8 KiB
Markdown
# RBAC Issues
|
|
|
|
## 403 Forbidden Errors
|
|
|
|
A 403 error means the identity making the API request (Headlamp's service account or the logged-in user's token) lacks the required permission.
|
|
|
|
### Diagnosing Which Permission Is Missing
|
|
|
|
Use `kubectl auth can-i` to check specific permissions:
|
|
|
|
```bash
|
|
# Check if the Headlamp service account can list StorageClasses
|
|
kubectl auth can-i list storageclasses \
|
|
--as=system:serviceaccount:headlamp:headlamp
|
|
|
|
# Check pod proxy access (for metrics)
|
|
kubectl auth can-i get pods/proxy \
|
|
-n kube-system \
|
|
--as=system:serviceaccount:headlamp:headlamp
|
|
|
|
# Check snapshot access
|
|
kubectl auth can-i list volumesnapshots \
|
|
--as=system:serviceaccount:headlamp:headlamp
|
|
```
|
|
|
|
### Applying the Required RBAC
|
|
|
|
See [RBAC Permissions](../user-guide/rbac.md) for the complete ClusterRole manifest.
|
|
|
|
Quick apply:
|
|
|
|
```bash
|
|
kubectl apply -f https://raw.githubusercontent.com/privilegedescalation/headlamp-tns-csi-plugin/main/docs/user-guide/rbac-manifest.yaml
|
|
```
|
|
|
|
Or manually apply the ClusterRole and ClusterRoleBinding from [SECURITY.md](../../SECURITY.md).
|
|
|
|
### OIDC Token Mode
|
|
|
|
If Headlamp is configured for OIDC authentication, each user's own token is used for API requests. The RBAC must be bound to the user's identity (email, group) rather than the service account:
|
|
|
|
```yaml
|
|
subjects:
|
|
- kind: Group
|
|
name: "engineering"
|
|
apiGroup: rbac.authorization.k8s.io
|
|
```
|
|
|
|
Users not in the group will see 403 errors in the plugin.
|
|
|
|
### Benchmark 403
|
|
|
|
The Benchmark page requires additional write permissions:
|
|
|
|
```yaml
|
|
- apiGroups: ["batch"]
|
|
resources: ["jobs"]
|
|
verbs: ["get", "list", "watch", "create", "delete"]
|
|
- apiGroups: [""]
|
|
resources: ["persistentvolumeclaims"]
|
|
verbs: ["create", "delete"]
|
|
```
|
|
|
|
If only the Benchmark page shows 403, add these rules to your ClusterRole (or a separate Role scoped to the benchmark namespace).
|