fix: mount azure.json read-only in CSI controller and node pods - #3780
Merged
andyzhangx merged 2 commits intoAug 29, 2026
Merged
Conversation
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.
Member
Author
|
/release-note-none |
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 DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Regenerated charts/latest/azuredisk-csi-driver-v0.0.0.tgz to include the readOnly: true update to the azure-cred host mount.
There was a problem hiding this comment.
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.
This was referenced Aug 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it
The CSI controller and node pods mount
/etc/kubernetes/from the host — that directory containsazure.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: trueon theazure-credhost mount in:deploy/csi-azuredisk-controller.yamldeploy/csi-azuredisk-node.yamlcharts/latest/azuredisk-csi-driver/templates/csi-azuredisk-controller.yamlcharts/latest/azuredisk-csi-driver/templates/csi-azuredisk-node.yamlNo 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
masterdeploy manifests + Helm chart templates are touched; versioneddeploy/vX.Y.Z/snapshots are left alone (they are point-in-time releases).azure-cred-file(an individual-file mount viahostPath: file), not the directory bind mount, so no change is needed there.Release note