<div dir="ltr">Hi,<br><div><br></div><div>Actually, it seems AppArmor has support for containers and can have a specific profile for inside the containers only.</div><div><br></div><div>Docker does support it:</div><div><a href="https://docs.docker.com/engine/security/apparmor/">https://docs.docker.com/engine/security/apparmor/</a><br></div><div><br></div><div>Agree it shouldn't be too hard to hook this into nspawn... I don't really use AppArmor or know it well though, so I'm not best placed to test it...</div><div><br></div><div>Cheers,</div><div>Filipe</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 12, 2018 at 2:48 AM, Lennart Poettering <span dir="ltr"><<a href="mailto:lennart@poettering.net" target="_blank">lennart@poettering.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Di, 10.04.18 18:16, Matthias Pfau (<a href="mailto:matthias@tutanota.de">matthias@tutanota.de</a>) wrote:<br>
<br>
> Hi there,<br>
> we use apparmor on our production systems and want to test the setup in our test environment based on systemd-nspawn.<br>
> <br>
> Therefore, I installed apparmor on the host (debian stretch) and updated GRUB_CMDLINE_LINUX in /etc/default/grub to enable apparmor. I can use apparmor on the host system. However, within my containers, apparmor can not be started.<br>
> <br>
> `journalctl -kf` does not print anything when invoking `systemctl start apparmor` on the container and `systemctl status apparmor` just returns "ConditionSecurity=apparmor was not met".<br>
> <br>
> Is it possible to run apparmor in a container?<br>
<br>
</span>Uh, I have no experience with AA but to my knowledge none of the<br>
kernel MACs (AA, SMACK, SELinux) are virtualized for container<br>
environments, i.e. there can only be one system policy, and containers<br>
tend to be managed under a single context only as a whole.<br>
<br>
But I'd be happy to be proved wrong, as I never touched AA, so I don't<br>
really know.<br>
<br>
If AA should indeed be virtualizable for containers then making nspawn<br>
support it is likely very easy, but I have my doubts it is...<br>
<br>
Please contact the AA community, and ask them whether AA containers<br>
can load their own policies. If yes, then please file an RFE issue<br>
against systemd, asking us to add support for this, with links to the<br>
APIs. best chance to get this implemented quickly would be to file a<br>
patch too, we'd be happy to review that.<br>
<span class="HOEnZb"><font color="#888888"><br>
Lennart<br>
<br>
-- <br>
Lennart Poettering, Red Hat<br>
</font></span><div class="HOEnZb"><div class="h5">______________________________<wbr>_________________<br>
systemd-devel mailing list<br>
<a href="mailto:systemd-devel@lists.freedesktop.org">systemd-devel@lists.<wbr>freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/systemd-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/systemd-devel</a><br>
</div></div></blockquote></div><br></div>