Skip to content

[occm] Reduce ClusterRole scope - #3165

Open
stephenfin wants to merge 3 commits into
kubernetes:masterfrom
shiftstack:reduce-clusterrole-scope
Open

[occm] Reduce ClusterRole scope#3165
stephenfin wants to merge 3 commits into
kubernetes:masterfrom
shiftstack:reduce-clusterrole-scope

Conversation

@stephenfin

Copy link
Copy Markdown
Member

What this PR does / why we need it:

A collection of 3 changes, all intended to reduce the cluster-wide access granted by the system:cloud-controller-manager ClusterRole.

  • [occm] Limit verbs for node access: OCCM does not need to create or delete nodes
  • [occm] Prevent access to PVs: OCCM does not need access to PVs
  • [occm] Add new Role for secrets: OCCM does not need cluster-wide secret access. It only needs access to the configuration secret (kube-system / cloud-config if using the standard manifests).

Which issue this PR fixes(if applicable):

(none)

Special notes for reviewers:

Release note:

[openstack-cloud-controller-manager] Reduce scope of `system:cloud-controller-manager` cluster role

OCCM does not need to create or delete nodes

Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
OCCM does not need this access.

Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
OCCM does not query Kubernetes secrets via the Kubernetes API in any of
its controllers. The only secret is needs access to is the
'cloud-config' secret mounted as a volume into the container. This
exists in the 'kube-system' namespace for standard manifests and the
release namespace when deployed via Helm. Therefore it's unnecessary to
grand cluster-wide get, list and watch access to all secrets via the
system:cloud-controller-manager ClusterRole.

Fix this by introducing a new
'system:cloud-controller-manager:secret-reader' Role in the standard
manifests and a '{{ .Values.clusterRoleName }}:secret-reader' Role in
the Helm charts.

Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
@kubernetes-prow kubernetes-prow Bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 26, 2026
@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign zetaab for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant