-
Notifications
You must be signed in to change notification settings - Fork 36
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
snapcraft.yaml: enable unconfined mode in lxd-support interface #277
snapcraft.yaml: enable unconfined mode in lxd-support interface #277
Conversation
What is this @alexmurray ? |
Signed-off-by: Alex Murray <alex.murray@canonical.com>
cac7a68
to
2f0fcab
Compare
Rebased this onto current latest-edge and squashed the two commits into one. |
Hi folks, the snapd support for this feature landed in the 2.62 release of snapd - any chance you could merge this into the lxd snap? cc @tomponline @simondeziel |
Hi @alexmurray Before I can merge this we need to understand what happens if this is installed on a system without snapd2.62 (ie one without The LXD snap needs operate on older Ubuntu releases that don't necessarily have this snapd version. Please can you advise about the backwards compatibility of this change? |
The |
Hrm, that sounds like it could be quite risky though - we would need to understand what happens on systems that do not yet have snapd 2.62 or where its pinned to a previous version. |
There are multiple series of LXD: 5.0 - Previous LTS that needs to be able to run on >= Jammy (and ideally before that to allow upgrades). So starting off we should consider the 5.0 series and what needs to be included in it to allow it to run with these restrictions and whether that will work on Jammy onwards. Also considering that LXD is preseeded into the Jammy images and so the snapd refresh may not have run on first LXD use. |
@alexmurray shall we have a meeting about this to discuss? |
snapd 2.62 just migrated into the updates pocket for all the stable releases of Ubuntu and has been in the snapd snap stable channel for a while now too. So it should be quite safe to merge this PR now. |
Thanks! We can try this now on various systems and check it doesn't cause a regression. |
@mihalicyn this pr can help with your roadmap item to support restricted user namespaces. |
I think we can merge this today, so we can test if there are any problems with it. For me it looks perfectly safe and valid. We have merged two other PRs related to this: which are preparation to having this change if I understand correctly. cc @tomponline |
Lets give it a go - this will need to be tested on bionic onwards please. |
@alexmurray @mihalicyn this change is causing lxd snaps to be rejected by the snap store, so they are building ok in launchpad, but not being accepted for upload. Effectively this is now blocking latest/edge and will need to be reverted. https://dashboard.snapcraft.io/snaps/lxd/revisions/29132/
@alexmurray please can you advise what the next steps are here? |
Theoretically, this should allow using this option in snap store https://git.launchpad.net/review-tools/commit/reviewtools/sr_common.py?id=08e83bf8d0b36eb8ff82ae74e774f00d56493d5f |
@tomponline we are waiting on the store team to deploy the latest review-tools revision to the store dashboard - in the meantime we can manually approve revisions which I will do now - and I will poke the store team to get the latest review-tools deployed. |
How do we do that? |
Unfortunately it's a manual process to approve each revision, apologies for the delay. They are now published. |
Do you know how long it will take to get the snapstore updated? We may need to revert this change if its going to take a while. |
Hi, I am seeing some permission errors in the snap. Maybe related to those changes here? When trying to force stop an instance in error state using Kernel log shows this apparmor denied message: It's reproducible by repeating this https://github.com/canonical/lxd-ci/blob/main/tests/storage-vm#L226 |
@roosterfish thanks for reporting this, Julian! Related to: |
Right now this patch does not change anything, because user namespaces are always allowed. But after we merge canonical/lxd-pkg-snap#277 user namespaces become restricted by default and we need to explicitly allow it when needed. Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
Right now this patch does not change anything, because user namespaces are always allowed. But after we merge canonical/lxd-pkg-snap#277 user namespaces become restricted by default and we need to explicitly allow it when needed.
Right now this patch does not change anything, because user namespaces are always allowed. But after we merge canonical/lxd-pkg-snap#277 user namespaces become restricted by default and we need to explicitly allow it when needed. Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
Right now this patch does not change anything, because user namespaces are always allowed. But after we merge canonical/lxd-pkg-snap#277 user namespaces become restricted by default and we need to explicitly allow it when needed. Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
Right now this patch does not change anything, because user namespaces are always allowed. But after we merge canonical/lxd-pkg-snap#277 user namespaces become restricted by default and we need to explicitly allow it when needed. Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com> (cherry picked from commit 20b397e)
The associated PR for snapd is still open in canonical/snapd#13514 but opening this one against the lxd snap so the two can be reviewed in tandem.
This should not be merged until at least the snapd one has been AND the correct assumes syntax has been decided upon.
--
The old
lxd-support
interface allowed lxd to set itself to be unconfined - ie to not have any apparmor profile associated with it - but when the userns restrictions are enabled it would then still be blocked from using userns - so we then instead added the unconfined mode which allows a profile to essentially be the equivalent of the unconfined profile (ie no profile) - but then to also add in extra permissions (like the use of userns).ie. the only way to use userns when the restrictions are enabled is to have an apparmor profile which grants the userns permission in apparmor - AND for the case of lxd which wants to be unconfined we then use the new unconfined profile mode as well
Signed-off-by: Alex Murray alex.murray@canonical.com