apparmor does not start in Disco LXD containers
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
AppArmor |
Fix Released
|
Undecided
|
Unassigned | ||
apparmor (Ubuntu) |
Fix Released
|
High
|
Jamie Strandboge | ||
libvirt (Ubuntu) |
Invalid
|
Undecided
|
Unassigned | ||
linux (Ubuntu) |
Fix Released
|
Undecided
|
Christian Brauner | ||
Disco |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
In LXD apparmor now skips starting.
Steps to reproduce:
1. start LXD container
$ lxc launch ubuntu-daily:d d-testapparmor
(disco to trigger the issue, cosmic as reference)
2. check the default profiles loaded
$ aa-status
=> This will in cosmic and up to recently disco list plenty of profiles active even in the default install.
Cosmic:
25 profiles are loaded.
25 profiles are in enforce mode.
Disco:
15 profiles are loaded.
15 profiles are in enforce mode.
All those 15 remaining are from snaps.
The service of apparmor.service actually states that it refuses to start.
$ systemctl status apparmor
...
Apr 15 13:56:12 testkvm-disco-to apparmor.
I can get those profiles (the default installed ones) loaded, for example:
$ sudo apparmor_parser -r /etc/apparmor.
makes it appear
22 profiles are in enforce mode.
/sbin/dhclient
I was wondering as in my case I found my guest with no (=0) profiles loaded. But as shown above after "apparmor_parser -r" and package install profiles seemed fine. Then the puzzle was solved, on package install they
will call apparmor_parser via the dh_apparmor snippet and it is fine.
To fully disable all of them:
$ lxc stop <container>
$ lxc start <container>
$ lxc exec d-testapparmor aa-status
apparmor module is loaded.
0 profiles are loaded.
0 profiles are in enforce mode.
0 profiles are in complain mode.
0 processes have profiles defined.
0 processes are in enforce mode.
0 processes are in complain mode.
0 processes are unconfined but have a profile defined.
That would match the service doing an early exit as shown in systemctl status output above. The package install or manual load works, but none are loaded by the service automatically e.g. on container restart.
--- --- ---
This bug started as:
Migrations to Disco trigger "Unable to find security driver for model apparmor"
This most likely is related to my KVM-in-LXD setup but it worked fine for years and I'd like to sort out what broke. I have migrated to Disco's qemu 3.1 already which makes me doubts generic issues in qemu 3.1 in general.
The virt tests that run cross release work fine starting from X/B/C but all those chains fail at mirgating to Disco now with:
$ lxc exec testkvm-cosmic-from -- virsh migrate --unsafe --live kvmguest-
qemu+
error: unsupported configuration: Unable to find security driver for model apparmor
I need to analyze what changed
description: | updated |
Changed in libvirt (Ubuntu): | |
status: | New → Invalid |
Changed in apparmor (Ubuntu): | |
status: | New → Triaged |
assignee: | nobody → Jamie Strandboge (jdstrand) |
importance: | Undecided → High |
Changed in apparmor: | |
status: | New → Triaged |
summary: |
- apparmor no more starting in Disco LXD containers + apparmor does not start in Disco LXD containers |
tags: | added: shiftfs |
no longer affects: | libvirt (Ubuntu Disco) |
no longer affects: | apparmor (Ubuntu Disco) |
Changed in linux (Ubuntu Disco): | |
status: | New → Fix Committed |
tags: |
added: verification-done-bionic removed: verification-needed-bionic |
Changed in linux (Ubuntu): | |
status: | In Progress → Fix Released |
In my disco container they really start without apparmor isolation nowadays.
After startign a guest with uvtool I checked what was auto-labelled.
Classic: libvirt- 6400c017- 06af-4ef4- a483-93380dae26 1c</label> >libvirt- 6400c017- 06af-4ef4- a483-93380dae26 1c</imagelabel> +64055: +115</label> >+64055: +115</imagelabe l>
<seclabel type='dynamic' model='apparmor' relabel='yes'>
<label>
<imagelabel
</seclabel>
<seclabel type='dynamic' model='dac' relabel='yes'>
<label>
<imagelabel
</seclabel>
Disco: +64055: +108</label> >+64055: +108</imagelabe l>
<seclabel type='dynamic' model='dac' relabel='yes'>
<label>
<imagelabel
</seclabel>