diff --git a/apparmor.d/groups/firewall/ufw-init b/apparmor.d/groups/firewall/ufw-init new file mode 100644 index 000000000..78483a399 --- /dev/null +++ b/apparmor.d/groups/firewall/ufw-init @@ -0,0 +1,38 @@ +# apparmor.d - Full set of apparmor profiles +# Copyright (C) 2025 Alexandre Pujol +# SPDX-License-Identifier: GPL-2.0-only + +abi , + +include + +@{exec_path} = @{lib}/ufw/ufw-init +profile ufw-init @{exec_path} { + include + include + + capability net_admin, + + network inet dgram, + network inet raw, + network inet6 dgram, + network inet6 raw, + network netlink raw, + + @{exec_path} mr, + + @{sh_path} rix, + @{bin}/sysctl rix, + @{bin}/xtables-legacy-multi rix, + @{bin}/xtables-nft-multi rix, + + /etc/default/ufw r, + /etc/ufw/* r, + + @{PROC}/@{pid}/net/ip_tables_names r, + @{PROC}/sys/net/ipv{4,6}/** rw, + + include if exists +} + +# vim:syntax=apparmor