Comment 20 for bug 1939949

Revision history for this message
Jerzy Husakowski (jhusakowski) wrote :

MAAS checks for changes in interfaces, which needs to be picked up quickly, hence the 30s interval. LXD API for obtaining host information tries to retrieve comprehensive information about the host, which includes enumeration of block devices. This triggers the logspam from apparmor when this happens inside of a snap.

Snapd does offer a connector that would allow such enumeration without logspam - the user can connect `block-devices` plug and it should silence the apparmor notification, which is what LXD does (and it's not considered a security issue).
Alternatively, comment #15 shows how to update the apparmor rules on the host to silence the message.

The mechanism works as designed, and there are at least two methods to remove the unwanted apparmor warnings. Making the retrieval of host information aware of the environment it runs in and conditionally exclude accessing certain types of devices would be the wrong place to address the apparmor warnings and introduce unnecessary complexity.