-
Notifications
You must be signed in to change notification settings - Fork 215
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: rolebindingRolePodExecAttach check (#1070)
* Fix: rolebindingRolePodExecAttach check Fix the case of a RoleBinding that points to a ClusterRole. In that case, we ignore the RoleBinding since it will be evaluated by the rolebindingClusterRolePodExecAttach check. * add tests for role-binding that uses a cluster-role binding --------- Co-authored-by: Vitor Vezani <vitor.vezani@fairwinds.com>
- Loading branch information
1 parent
be349a8
commit 9b5438d
Showing
2 changed files
with
23 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
test/checks/rolebindingRolePodExecAttach/success.role_binding_cluster_role_binding.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: all-operations | ||
rules: | ||
- apiGroups: ["*"] | ||
resources: ["*"] | ||
verbs: ["*"] | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: RoleBinding | ||
metadata: | ||
name: all-operations | ||
namespace: my-namespace | ||
subjects: | ||
- kind: User | ||
name: example-user | ||
apiGroup: rbac.authorization.k8s.io | ||
roleRef: | ||
kind: ClusterRole | ||
name: all-operations | ||
apiGroup: rbac.authorization.k8s.io |