-
Notifications
You must be signed in to change notification settings - Fork 42.1k
fc: use restrictive file permissions for sysfs writes #135957
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
fc: use restrictive file permissions for sysfs writes #135957
Conversation
Change file permission mode from 0666 (world-writable) to 0200 (write-only for owner) when writing to sysfs pseudo-files in the FC volume plugin. While sysfs files have kernel-defined permissions that override the specified mode, using 0200 better reflects the intent that only root should write to these files. This addresses part of the security audit finding in issue kubernetes#81116 (TOB-K8S-004: Pervasive world-accessible file permissions). Fixes kubernetes#81116 Signed-off-by: majiayu000 <[email protected]>
|
Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. DetailsInstructions 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. |
|
Keywords which can automatically close issues and at(@) or hashtag(#) mentions are not allowed in commit messages. The list of commits with invalid commit messages:
DetailsInstructions 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. I understand the commands that are listed here. |
|
Welcome @majiayu000! |
|
This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The DetailsInstructions 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. |
|
Hi @majiayu000. Thanks for your PR. I'm waiting for a github.com member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: majiayu000 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Summary
Details
The FC volume plugin uses
WriteFileto write to sysfs pseudo-files at:/sys/block/<device>/device/delete- to remove SCSI devices/sys/class/scsi_host/<host>/scan- to rescan SCSI busWhile sysfs files have kernel-defined permissions that override the specified mode, using 0200 better reflects the intent that only root should write to these files. This addresses the misleading use of world-writable permissions (0666) in the codebase.
This is a partial fix for the security audit finding in issue #81116 (TOB-K8S-004: Pervasive world-accessible file permissions).
Fixes #81116
Test plan
go test ./pkg/volume/fc/...- all tests pass