contrib/apparmor: add explicit Unix socket permissions#12729
contrib/apparmor: add explicit Unix socket permissions#12729nmn3m wants to merge 2 commits intocontainerd:mainfrom
Conversation
|
I don't believe this is the right fix. My read of the apparmor issue is we need to add a "unix" term, not a "network unix" term. |
6b424a2 to
776f276
Compare
you are right, I checked the manual page https://manpages.ubuntu.com/manpages/noble/man5/apparmor.d.5.html, |
776f276 to
6d9e0b8
Compare
|
I can't find apparmor doc about change the behavior about network @achernya |
|
@ningmingxiao I wrote more details in #12726 -- specifically take a look at https://gitlab.com/apparmor/apparmor/-/issues/561 where John Johansen says "[...], in that under newer abi's unix rules are not covered by the generic network socket rule, you have to create a unix rule.". Later on John also says "What apparmor does for abis, is take an intersection of what the policy was authored under, and what the kernel supports, to find a common set of features." -- since containerd is not declaring an ABI, we are auto-migrated to the newer ABI as the kernel supports it, which eventually removes |
It sounds like it would be best for us to declare an ABI here as well then? |
|
That is the fix I had in mind when I reported #12726; my biggest issue (as a user but not contributor) was figuring out how to add a test for this. |
Our guidelines for the contrib folder (and specifically the apparmor and selinux profiles) are a bit looser since they're often very platform-dependent; if we're able to test this manually on both recent systems and still-supported older ones I think that's reasonable. |
|
@nmn3m Do you plan to update this to address the comments? |
Signed-off-by: Nour <[email protected]>
Signed-off-by: Nour <[email protected]>
6d9e0b8 to
6556f44
Compare
Yes, I've updated the PR to address the feedback:
This ensures consistent behavior across different kernel versions by explicitly declaring the ABI rather than relying on auto-migration. |
|
@nmn3m I don't think this strategy makes sense as currently implemented in the PR.
|
Thanks for the detailed feedback. I may be missing some context, but I’m not fully confident I understand the exact requirements or the intended ABI strategy here. Given the ABI semantics and compatibility concerns you outlined, I’m not sure I’m the best person to continue driving this change. |
|
I've written up an alternative pull request #12864 and performed one-off testing that looks successful. |
AppArmor Policy Fix for Linux 6.17+
Problem
Solution
Explicitly add
network unix,permission to AppArmor policy templateResult
Unix socket operations work on both older and newer kernels
Fixes: #12726