Skip to content

Commit

Permalink
AppArmor: Explicitly allow netlink raw socket for Supervisor (#370)
Browse files Browse the repository at this point in the history
The Supervisor uses netlink raw sockets to get access to udev events
sent through netlink. Technically, the rules so far have denied all raw
sockets. However, in practice it seems that netlink raw sockets have
still been working.

For unknown reasons, in Debian Bookworm that behavior changed: The rule
now also denies netlink raw sockets.

This new ruleset starts off with the default setting (where almost
everything seems to be denied), and enables explicitly what is needed
in Supervisor. In tests this ruleset worked on Home Assistant OS as well
as Debian Bookworm.

Fixes: home-assistant/supervisor#4381
  • Loading branch information
agners committed Apr 10, 2024
1 parent 042cfc4 commit e6ff010
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions apparmor_beta.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@ profile hassio-supervisor flags=(attach_disconnected,mediate_deleted) {
#include <abstractions/base>
#include <abstractions/python>

network,
deny network raw,
network unix stream,
network inet stream,
network inet6 stream,
network inet dgram,
network inet6 dgram,
network netlink raw,

signal (send) set=(kill,term,int,hup,cont),

Expand Down
8 changes: 6 additions & 2 deletions apparmor_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@ profile hassio-supervisor flags=(attach_disconnected,mediate_deleted) {
#include <abstractions/base>
#include <abstractions/python>

network,
deny network raw,
network unix stream,
network inet stream,
network inet6 stream,
network inet dgram,
network inet6 dgram,
network netlink raw,

signal (send) set=(kill,term,int,hup,cont),

Expand Down

0 comments on commit e6ff010

Please sign in to comment.