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

hard code apparmor profle ? #190

Open
tych0 opened this issue Aug 9, 2021 · 1 comment
Open

hard code apparmor profle ? #190

tych0 opened this issue Aug 9, 2021 · 1 comment

Comments

@tych0
Copy link
Collaborator

tych0 commented Aug 9, 2021

right now, we depend on some external entity (packaging, aliens) to distribute an apparmor profile called lxc-container-default-cgns, and we hope that profile is reasonable. we should really have some way for stacker to generate that profile, perhaps using lxd's apparmor library:

https://github.com/lxc/lxd/tree/master/lxd/apparmor

which was written for this purpose, but has a lot of lxd-specific code.

@tych0
Copy link
Collaborator Author

tych0 commented Jan 25, 2022

FWIW, it looks like liblxc proper has this functionality. It should be fairly easy to use this in stacker: tych0@434cfeb

However, this assumes that you are a privileged user, since users without CAP_MAC_ADMIN can't load policy in the root apparmor namespace or create namespaces (though if a namespace exists, unprivileged users can load policy there if they have CAP_MAC_ADMIN in the userns that owns the AA ns). We could fix this by allowing unprivileged userns creation: tych0/linux@b6e0913

...but then there are several other times that liblxc assumes you are privileged. Drafts of several fixes necessary are here: https://github.com/tych0/lxc/commits/parameterize-apparmor-cache-dir

I think this is possible, but the liblxc patches will be a bit more invasive than I was originally thinking.

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

No branches or pull requests

1 participant