Files
polaris/test/checks/rolebindingRolePodExecAttach/failure.binding_to_system_prefix.yaml
ivanfetch-fw 467d06f4db FWI-2719: Enable new RBAC / sensitive content / Pod exec checks, add hasPrefix and hasSuffix functions to the GO template, exempt system: name prefixes for RBAC checks, sensitive content checks ignore valueFrom, (#832)
* Enable these checks in the default configuration file, which may produce many new results:
  * automountServiceAccountToken
  * linuxHardening
  * sensitiveConfigmapContent and sensitiveContainerEnvVar
  * clusterrolebindingClusterAdmin, rolebindingClusterAdminClusterRole, and rolebindingClusterAdminRole
  * clusterrolePodExecAttach, rolePodExecAttach, clusterrolebindingPodExecAttach, rolebindingClusterRolePodExecAttach, and  rolebindingRolePodExecAttach
* Ignore the `missingNetworkPolicy` and `automountServiceAccountToken` checks by default
* `hasPrefix` and `hasSuffix` functions are now available in the go template
* Fix the `sensitiveContainerEnvVar` check to ignore sensitive environment
variable names when those variables use `valueFrom` to reference an
external resource.
* Add the `*ClusterAdmin` checks to `examples/config-full.yaml`.
* Exempt the prefix `system:` instead of individual entries for RBAC checks (#871)
2022-11-14 15:05:02 -07:00

27 lines
733 B
YAML

# This fails because the roleBinding references a Role that uses all wildcards which happens to have a `system:` prefix.
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
# The system: prefix does not cause this test to fail, but this test
# avoids incorectly ignoring user-created bindings to system ClusterRoles.
name: system:test
namespace: test
rules:
- apiGroups: [ "*" ]
resources: [ "*" ]
verbs: [ "*" ]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: test-binding-to-system-prefix-role
namespace: test
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: system:test
subjects:
- apiGroup: rbac.authorization.k8s.io
kind: User
name: testuser