Skip to content
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

Fix apparmor host check to include aa-parser #3946

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

apostasie
Copy link
Contributor

Fix #3945

@apostasie apostasie marked this pull request as ready for review February 27, 2025 19:37
@apostasie
Copy link
Contributor Author

@AkihiroSuda this is minor/corner-case, as outlined by @dancavallaro, but it is still a regression.
Suggesting we have this for 2.0.4.

@AkihiroSuda AkihiroSuda added this to the v2.0.4 milestone Feb 28, 2025
@apostasie
Copy link
Contributor Author

apostasie commented Feb 28, 2025

@dancavallaro it should be noted that things will still be somewhat "weird", even with the patch.

In your specific circumstances (kernel enabled, no userland tool), nerdctl info will still happily report apparmor as a security option, and if the profile was loaded already, you may still run containers with it.

What the patch does is prevent (the problem you reported) loading profile for a container, which is the only place hostSupports (or aa-parser) is needed.

Finally, this patch will not prevent you from calling nerdctl apparmor load, which will loudly error complaining about aa_parser not being here (which is... fine).

I think this is fine (given this is indeed a corner case), but the whole thing is a bit shaky IMHO.

@apostasie
Copy link
Contributor Author

@AkihiroSuda your suggestions integrated with latest push.

I do always have a mild panic attack whenever I fiddle with logic involving /sys/module.
Verified working of course locally, but wanted to make sure we are 100% comfortable with the new logic here.

(now going to grab coffee outside to cure my kernel anxiety)

@dancavallaro
Copy link
Contributor

@apostasie I totally hear you. I'm already installing apparmor-utils as a workaround, and I've verified that explicitly setting apparmor=0 on the kernel command line resolves the real issue (since finally /sys/module/apparmor/parameters/enabled will say N).

Definitely agree that this is all pretty hairy, but thanks for the quick fix!

@apostasie
Copy link
Contributor Author

Definitely agree that this is all pretty hairy, but thanks for the quick fix!

Well, I am operating under the assumption that @AkihiroSuda will tolerate me here as long as I live by the motto: "you broke it, you better fix it", so, better act fast to sweep my mistakes under the carpet. 🤣🤣🤣

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Regression (maybe?) in AppArmor detection logic
3 participants