operator-framework / operator-lifecycle-manager

A management framework for extending Kubernetes with Operators
https://olm.operatorframework.io
Apache License 2.0
1.71k stars 544 forks source link

OperatorGroup aggregate roles include wildcards which violate Kubernetes CIS 5.1.3 #2727

Open cdjohnson opened 2 years ago

cdjohnson commented 2 years ago

Feature Request

Is your feature request related to a problem? Please describe. The OpenShift Compliance Operator includes a CIS Benchmark rule set that enforces the OpenSCAP CIS OpenShift 4 Benchmark which includes Kubernetes CIS Benchmark 5.1.3:

Defining OperatorGroups intentionally creates ClusterRoles with wildcards which violates one of the rules:

Describe the solution you'd like Instead of providing wildcards for the verbs for the CRDs and APIs provided by the operator, provide instructions in the ClusterServiceVersion that describe what verbs the controller needs.

cdjohnson commented 2 years ago

Related Enhancement PR: https://github.com/operator-framework/enhancements/pull/116

dmesser commented 2 years ago

The linked enhancement is only tangentially related, it's aim is to disable the aggregation altogether to make room for custom RBAC to be put in place. What the benchmark is complaining about is the * access with give namespace admins on the APIs that the operator creates in question provides. Arguably this is very useful as we don't know what an admin / user might want to do with those APIs. If we want to satisfy the report, is it an option to just spell out the specific verbs we want namespace admins to have on operator APIs?