Skip to content

Commit

Permalink
Fix console impersonation (#90)
Browse files Browse the repository at this point in the history
The console started checking with the following `SelfSubjectAccessReview`:

```
{
  "kind": "SelfSubjectAccessReview",
  "apiVersion": "authorization.k8s.io/v1",
  "metadata": {
    "creationTimestamp": null,
  },
  "spec": {
    "resourceAttributes": {
      "verb": "impersonate",
      "group": "authorization.k8s.io",
      "resource": "users",
      "name": "cluster-admin"
    }
  },
  "status": {
    "allowed": false
  }
}
```

Both users.authorization.k8s.io and `users` seem to be correct to receive impersonation rights in the API server.
  • Loading branch information
bastjan authored Jan 22, 2024
1 parent e67bf2f commit 803451e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion component/rbac.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ local sudoGroupSubjects = std.map(

local sudoClusterRole = kube.ClusterRole('sudo-impersonator') {
rules: [ {
apiGroups: [ '' ],
apiGroups: [ '', 'authorization.k8s.io' ],
resources: [ 'users', 'serviceaccounts', 'groups' ],
verbs: [ 'impersonate' ],
}, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ metadata:
rules:
- apiGroups:
- ''
- authorization.k8s.io
resources:
- users
- serviceaccounts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ metadata:
rules:
- apiGroups:
- ''
- authorization.k8s.io
resources:
- users
- serviceaccounts
Expand Down

0 comments on commit 803451e

Please sign in to comment.