Open
Conversation
achernya
reviewed
Feb 14, 2026
apparmor/template.go
Outdated
|
|
||
| // baseTemplate defines the default apparmor profile for containers. | ||
| // | ||
| // It explicitly sets the AppArmor ABI to 3.0. In AppArmor 4.0 ABI, "network" |
There was a problem hiding this comment.
nit: ABI 4.0 is actually fine. It's anything newer than 4.0 (which is a function of apparmor+kernel) which is the problem.
Member
Author
There was a problem hiding this comment.
Ah, thanks! Let me try rephrasing 🤗
Member
Author
There was a problem hiding this comment.
Slightly updated to outline that it's "higher than", but that we picked 3.0 to account for some LTS distros not yet supporting 4.0; thanks!
This explicitly sets the AppArmor ABI to 3.0. In AppArmor ABI higher than 4.0, `network` no longer includes `network unix`, resulting in access to unix sockets being denied (also see https://gitlab.com/apparmor/apparmor/-/issues/561): apparmor="DENIED" operation="create" class="net" info="failed protocol match" error=-13 profile="cri-containerd.apparmor.d" pid=138752 comm=2E4E455420545020576F726B6572 family="unix" sock_type="dgram" protocol=0 requested="create" denied="create" addr=none The recommendation is to either pin to abi `<abi/4.0>`, in the policy or to update it to use the newer syntax. Given that we need to account for some LTS distros that do not yet support ABI 4.0, we pin to ABI 3.0. This is a similar patch as was included in containerd ([containerd@a6f03a7]). From that patch: > This change sets the AppArmor policy used by containerd to indicate it > is `abi/3.0`. This was chosen based on some code archeology which > indicated that containerd 1.7 came out in March 2023, before the > AppArmor 4.0 ABI. The AppArmor policies themselves date to much older; > the last apparmor version-checks were removed in [containerd@4baa187] > and [containerd@c990e3f], and both were looking for AppArmor 2.8.96 or > older, pointing to abi/3.0 being the "correct" one to pick. > > Nothing is preventing containerd from migrating to a newer AppArmor > ABI; note, however, that anything newer than `abi/4.0` will need > modifications to preserve UNIX domain sockets. [containerd@4baa187]: containerd/containerd@4baa187 [containerd@c990e3f]: containerd/containerd@c990e3f [containerd@a6f03a7]: containerd/containerd@a6f03a7 Co-authored-by: Alex Chernyakhovsky <alex@achernya.com> Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2d74668 to
6e97fb8
Compare
achernya
approved these changes
Feb 14, 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.
relates to:
apparmor: explicitly set abi/3.0
This explicitly sets the AppArmor ABI to 3.0. In AppArmor ABI higher than 4.0,
networkno longer includesnetwork unix, resulting in access to unix sockets being denied (also see https://gitlab.com/apparmor/apparmor/-/issues/561):The recommendation is to either pin to abi
<abi/4.0>, in the policy or to update it to use the newer syntax. Given that we need to account for some LTS distros that do not yet support ABI 4.0, we pin to ABI 3.0.This is a similar patch as was included in containerd (containerd@a6f03a7). From that patch: