Skip to content

fix: mount azure.json read-only in CSI controller and node pods - #3780

Merged
andyzhangx merged 2 commits into
kubernetes-sigs:masterfrom
andyzhangx:security/mount-azure-cred-readonly
Aug 29, 2026
Merged

fix: mount azure.json read-only in CSI controller and node pods#3780
andyzhangx merged 2 commits into
kubernetes-sigs:masterfrom
andyzhangx:security/mount-azure-cred-readonly

Conversation

@andyzhangx

Copy link
Copy Markdown
Member

What this PR does / why we need it

The CSI controller and node pods mount /etc/kubernetes/ from the host — that directory contains azure.json, which holds the cloud provider credentials (tenant ID, subscription ID, service principal secret / MSI config, resource group, etc.) the driver uses to authenticate to Azure Resource Manager.

Today the bind mount is writable, which means any container in the pod that gets a write-path bug can silently overwrite the node's cloud credentials on disk. The driver only ever reads azure.json — it never needs to mutate it — so leaving the mount writable is unnecessary attack surface (defense-in-depth issue).

What's changed

Set readOnly: true on the azure-cred host mount in:

  • deploy/csi-azuredisk-controller.yaml
  • deploy/csi-azuredisk-node.yaml
  • charts/latest/azuredisk-csi-driver/templates/csi-azuredisk-controller.yaml
  • charts/latest/azuredisk-csi-driver/templates/csi-azuredisk-node.yaml

No functional change — the driver has always only read azure.json.

Which issue(s) this PR fixes

None filed — treating this as a straightforward defense-in-depth cleanup.

Special notes for your reviewer

  • Only master deploy manifests + Helm chart templates are touched; versioned deploy/vX.Y.Z/ snapshots are left alone (they are point-in-time releases).
  • Windows manifests reference azure-cred-file (an individual-file mount via hostPath: file), not the directory bind mount, so no change is needed there.

Release note

NONE

The CSI controller and node pods mount /etc/kubernetes/ (which
contains azure.json — the cloud provider credentials, tenant ID,
subscription ID, service principal secret, etc.) from the host.
Today the mount is writable, which means any container in the pod
that gets a write bug can silently overwrite the node's cloud
credentials on disk. The driver only ever reads azure.json — it
never needs to mutate it — so the write path is unnecessary
attack surface.

Set readOnly: true on the azure-cred host mount in:
  - deploy/csi-azuredisk-controller.yaml
  - deploy/csi-azuredisk-node.yaml
  - charts/latest/azuredisk-csi-driver/templates/csi-azuredisk-controller.yaml
  - charts/latest/azuredisk-csi-driver/templates/csi-azuredisk-node.yaml

Follows the standard defense-in-depth pattern of dropping write
permission on host-config bind mounts wherever the workload only
reads them.
@andyzhangx

Copy link
Copy Markdown
Member Author

/release-note-none

@kubernetes-prow kubernetes-prow Bot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Aug 28, 2026
@kubernetes-prow
kubernetes-prow Bot requested review from cvvz and landreasyan August 28, 2026 13:30
@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andyzhangx

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 28, 2026
@andyzhangx andyzhangx changed the title security: mount azure.json read-only in CSI controller and node pods fix: mount azure.json read-only in CSI controller and node pods Aug 28, 2026
Regenerated charts/latest/azuredisk-csi-driver-v0.0.0.tgz to include
the readOnly: true update to the azure-cred host mount.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Makes Linux Azure credential mounts read-only for defense in depth.

Changes:

  • Marks controller credential mounts read-only.
  • Marks node credential mounts read-only.
  • Updates static manifests and Helm templates.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.

File Description
deploy/csi-azuredisk-node.yaml Secures node credential mount.
deploy/csi-azuredisk-controller.yaml Secures controller credential mount.
charts/latest/azuredisk-csi-driver/templates/csi-azuredisk-node.yaml Updates Helm node template.
charts/latest/azuredisk-csi-driver/templates/csi-azuredisk-controller.yaml Updates Helm controller template.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants