mirror of
https://github.com/FairwindsOps/polaris.git
synced 2026-08-23 22:26:34 +00:00
* Add `clusterrolebindingClusterAdmin`, `rolebindingClusterAdminRole`, and `rolebindingClusterAdminClusterRole` checks + schema tests * Update `rolebindingClusterAdminClusterRole` check to explicitly match the `cluster-admin` default ClusterRole, fix `...all_verbs` schema test, add schema checks for unrelated permissions
36 lines
777 B
YAML
36 lines
777 B
YAML
# This succeeds because the roleBinding references a Role with a safer subset of resources.
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
kind: Role
|
|
metadata:
|
|
name: test
|
|
namespace: test
|
|
rules:
|
|
- apiGroups: [ "*" ]
|
|
resources: [ "pods" ]
|
|
verbs: [ "*" ]
|
|
---
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
kind: RoleBinding
|
|
metadata:
|
|
name: test
|
|
namespace: test
|
|
roleRef:
|
|
apiGroup: rbac.authorization.k8s.io
|
|
kind: Role
|
|
name: test
|
|
subjects:
|
|
- apiGroup: rbac.authorization.k8s.io
|
|
kind: User
|
|
name: testuser
|
|
---
|
|
# This ClusterRole exists so there is at leat one ClusterRole for the additionalSchema to find.
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
kind: ClusterRole
|
|
metadata:
|
|
name: not-used
|
|
rules:
|
|
- apiGroups: [ "" ]
|
|
resources: [ "pods" ]
|
|
verbs: [ list ]
|
|
|