Add sysctl_kernel_apparmor_restrict_unprivileged_unconfined rule#14769
Add sysctl_kernel_apparmor_restrict_unprivileged_unconfined rule#14769israel-villar wants to merge 3 commits into
Conversation
Add a new rule and variable to enforce kernel.apparmor_restrict_unprivileged_unconfined=1 via the sysctl template. This sysctl prevents unprivileged processes from loading AppArmor profiles without confinement, reducing the local attack surface. Map the new rule to the apparmor component. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Hi @israel-villar. Thanks for your PR. I'm waiting for a ComplianceAsCode member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. 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. |
| options: | ||
| default: 1 | ||
| 1: "1" | ||
| 2: "2" |
There was a problem hiding this comment.
Is 2 a valid value for this sysctl item? Shouldn't the choice be 0 and 1?
There was a problem hiding this comment.
You are right, kernel.apparmor_restrict_unprivileged_unconfined is a boolean — 0 (disabled) and 1 enabled). The value 2 was mistakenly copied from a similar variable (sysctl_kernel_unprivileged_bpf_disabled) that does accept 1 and 2. Fixed in the latest commit.
… options Replace invalid value 2 with 0; this sysctl is a boolean (0=disabled, 1=enabled) and 2 is not a valid kernel value. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
@israel-villar CI fails |
…l component Rules using the sysctl template must be assigned to the kernel component. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Moved sysctl_kernel_apparmor_restrict_unprivileged_unconfined from components/apparmor.yml to components/kernel.yml |
Add a new rule and variable to enforce
kernel.apparmor_restrict_unprivileged_unconfined=1 via the sysctl template. This sysctl prevents unprivileged processes from loading AppArmor profiles without confinement, reducing the local attack surface. Map the new rule to the apparmor component.
Description:
sysctl_kernel_apparmor_restrict_unprivileged_unconfinedand its associated variable
sysctl_kernel_apparmor_restrict_unprivileged_unconfined_value.varto enforce
kernel.apparmor_restrict_unprivileged_unconfined=1.sysctltemplate.apparmorcomponent.Rationale:
kernel.apparmor_restrict_unprivileged_unconfinedis set to1,unprivileged processes are prevented from loading AppArmor profiles
without confinement. This reduces the local attack surface by limiting
what an unprivileged user can do with AppArmor.
Review Hints:
.varfile underlinux_os/guide/system/permissions/restrictions/../build_product debian13 --datastream-only