forked from flatcar/scripts
-
Notifications
You must be signed in to change notification settings - Fork 7
selinux-policy: add confined CSI and log-reader support #67
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
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
acl/SPECS/selinux-policy/0062-container-Add-CSI-sidecar-domain.patch
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| From 2aeae85b1942d2bc12a7b827bdc896cdba3692eb Mon Sep 17 00:00:00 2001 | ||
| From: Sean Dougherty <sdougherty@microsoft.com> | ||
| Date: Mon, 31 Aug 2026 16:30:00 +0000 | ||
| Subject: [PATCH] container: Add CSI sidecar domain | ||
|
|
||
| Add an opt-in container_csi_sidecar_t domain for trusted CSI helper | ||
| containers that must connect to a privileged CSI driver socket. Include the | ||
| read-only sysfs and cgroup probes observed during helper startup. | ||
|
|
||
| Signed-off-by: Sean Dougherty <sdougherty@microsoft.com> | ||
| --- | ||
| policy/modules/services/container.te | 15 +++++++++++++++ | ||
| 1 file changed, 15 insertions(+) | ||
|
|
||
| diff --git a/policy/modules/services/container.te b/policy/modules/services/container.te | ||
| index 4559fb5..f2d339f 100644 | ||
| --- a/policy/modules/services/container.te | ||
| +++ b/policy/modules/services/container.te | ||
| @@ -173,6 +173,12 @@ optional_policy(` | ||
| container_domain_template(container_logreader) | ||
| typeattribute container_logreader_t container_system_domain, container_user_domain, container_net_domain; | ||
|
|
||
| +container_domain_template(container_csi_sidecar) | ||
| +typeattribute container_csi_sidecar_t container_system_domain, container_net_domain; | ||
| +optional_policy(` | ||
|
SeanDougherty marked this conversation as resolved.
|
||
| + kubernetes_container(container_csi_sidecar_t) | ||
|
SeanDougherty marked this conversation as resolved.
|
||
| +') | ||
| + | ||
| container_engine_domain_template(container_engine) | ||
| typeattribute container_engine_t container_engine_system_domain; | ||
| type container_engine_exec_t, container_engine_exec_type; | ||
| @@ -599,6 +605,15 @@ optional_policy(` | ||
| rpm_read_db(container_t) | ||
| ') | ||
|
|
||
| +######################################## | ||
| +# | ||
| +# CSI sidecar container local policy | ||
| +# | ||
| + | ||
|
SeanDougherty marked this conversation as resolved.
|
||
| +allow container_csi_sidecar_t spc_t:unix_stream_socket connectto; | ||
|
SeanDougherty marked this conversation as resolved.
SeanDougherty marked this conversation as resolved.
|
||
| +dev_read_sysfs(container_csi_sidecar_t) | ||
| +fs_read_cgroup_files(container_csi_sidecar_t) | ||
| + | ||
| ######################################## | ||
| # | ||
| # Log reader container local policy | ||
| -- | ||
| 2.45.4 | ||
|
|
||
29 changes: 29 additions & 0 deletions
29
acl/SPECS/selinux-policy/0063-container-Allow-log-reader-runtime-probes.patch
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| From 1299975ad7844e95b95f90214801ed6c12ae9ea0 Mon Sep 17 00:00:00 2001 | ||
| From: Sean Dougherty <sdougherty@microsoft.com> | ||
| Date: Mon, 31 Aug 2026 17:45:00 +0000 | ||
| Subject: [PATCH] container: Allow log reader runtime probes | ||
|
|
||
| Fluent Bit probes VM overcommit and sysfs state during startup. Preserve the | ||
| read-only access available to the default container domain without granting | ||
| broad sysctl or sysfs access to container_logreader_t. | ||
|
|
||
| Signed-off-by: Sean Dougherty <sdougherty@microsoft.com> | ||
| --- | ||
| policy/modules/services/container.te | 2 ++ | ||
| 1 file changed, 2 insertions(+) | ||
|
|
||
| diff --git a/policy/modules/services/container.te b/policy/modules/services/container.te | ||
| index e244da8..5402ec4 100644 | ||
| --- a/policy/modules/services/container.te | ||
| +++ b/policy/modules/services/container.te | ||
| @@ -626,6 +626,8 @@ logging_read_audit_log(container_logreader_t) | ||
| logging_list_logs(container_logreader_t) | ||
| allow container_logreader_t logfile:lnk_file read_lnk_file_perms; | ||
| allow container_logreader_t container_log_t:file watch; | ||
| +kernel_read_vm_overcommit_sysctl(container_logreader_t) | ||
| +dev_read_sysfs(container_logreader_t) | ||
|
|
||
| optional_policy(` | ||
| systemd_read_journal_files(container_logreader_t) | ||
| -- | ||
| 2.51.0 |
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.