diff --git a/apparmor.d/profiles-s-z/sing-box b/apparmor.d/profiles-s-z/sing-box new file mode 100644 index 00000000..0ebe76ad --- /dev/null +++ b/apparmor.d/profiles-s-z/sing-box @@ -0,0 +1,33 @@ +# apparmor.d - Full set of apparmor profiles +# SPDX-License-Identifier: GPL-2.0-only + +# https://github.com/SagerNet/sing-box + +abi , + +include + +@{exec_path} = @{bin}/sing-box +profile sing-box @{exec_path} { + include + include + include + + capability net_bind_service, + + network inet stream, + network inet6 stream, + network inet dgram, + network inet6 dgram, + + /proc/meminfo r, + /sys/kernel/mm/transparent_hugepage/hpage_pmd_size r, + + @{bin}/tor mrix, + @{bin}/sing-box mr, + /usr/{,local/}share/sing-box/geoip.db r, + /usr/{,local/}share/sing-box/geosite.db r, + + owner /{,usr/local/}etc/sing-box/config.json r, + owner @{user_share_dirs}/certmagic/** rw, +}