Skip to content

[occm] Reduce ClusterRole scope - #3165

Merged
kubernetes-prow[bot] merged 4 commits into
kubernetes:masterfrom
shiftstack:reduce-clusterrole-scope
Aug 27, 2026
Merged

[occm] Reduce ClusterRole scope#3165
kubernetes-prow[bot] merged 4 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

@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
@winiciusallan

Copy link
Copy Markdown
Contributor

/lgtm

looks like this needs a bump to a new chart version

@kubernetes-prow

Copy link
Copy Markdown
Contributor

@winiciusallan: changing LGTM is restricted to collaborators

Details

In response to this:

/lgtm

looks like this needs a bump to a new chart version

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Comment thread charts/openstack-cloud-controller-manager/templates/clusterrole.yaml Outdated
Comment thread manifests/controller-manager/cloud-controller-manager-roles.yaml Outdated
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>
@stephenfin
stephenfin force-pushed the reduce-clusterrole-scope branch from 3fcab16 to d8e9a5d Compare August 27, 2026 15:15
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
@kubernetes-prow kubernetes-prow Bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 27, 2026

@mandre mandre left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@kubernetes-prow kubernetes-prow Bot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 27, 2026
@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mandre

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

The pull request process is described 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

@kubernetes-prow kubernetes-prow Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 27, 2026
@kubernetes-prow
kubernetes-prow Bot merged commit cc53644 into kubernetes:master Aug 27, 2026
5 checks passed
@mandre
mandre deleted the reduce-clusterrole-scope branch August 27, 2026 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants