Files
ivanfetch-fw 742b21c6a2 FWI-2582: Add clusterrolebindingClusterAdmin, rolebindingClusterAdminRole, and rolebindingClusterAdminClusterRole checks + schema tests (#823)
* 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
2022-08-22 09:50:58 -06:00

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 ]