diff --git a/apparmor.d/profiles-s-z/sysctl b/apparmor.d/profiles-s-z/sysctl index 4e50430b..02964dd7 100644 --- a/apparmor.d/profiles-s-z/sysctl +++ b/apparmor.d/profiles-s-z/sysctl @@ -30,6 +30,8 @@ profile sysctl @{exec_path} { deny network inet6 stream, deny network inet stream, + /etc/ufw/sysctl.conf r, # Add support for ufw + include if exists } diff --git a/apparmor.d/profiles-s-z/ufw b/apparmor.d/profiles-s-z/ufw new file mode 100644 index 00000000..63352e65 --- /dev/null +++ b/apparmor.d/profiles-s-z/ufw @@ -0,0 +1,57 @@ +# apparmor.d - Full set of apparmor profiles +# Copyright (C) 2024 EricLin +# SPDX-License-Identifier: GPL-2.0-only + +abi , + +include + +@{exec_path} = @{bin}/ufw +profile ufw @{exec_path} { + + include + + capability dac_read_search, + capability net_admin, + + network netlink raw, + network inet dgram, + network inet6 dgram, + + @{exec_path} mr, + + @{bin}/ r, + @{bin}/python3* ix, + @{bin}/cat ix, + @{bin}/xtables-nft-multi ix, + + @{lib}/ufw/ufw-init ix, + + @{PROC}/@{pid}/stat r, + @{PROC}/@{pid}/fd/ r, + @{PROC}/@{pid}/net/ip_tables_names r, + + owner @{bin}/env r, + + /etc/ufw/{,**} rwk, + + /etc/default/ufw r, + + /run/ufw.lock wk, + + /etc/gai.conf r, + /etc/nsswitch.conf r, + /etc/passwd r, + /etc/services r, + + /var/tmp/* rw, + /tmp/* rw, + + /dev/pts/[0-9]* rw, + /dev/tty rw, + + include if exists + +} + +# vim:syntax=apparmor