diff --git a/profiles/apparmor.d/hostname b/profiles/apparmor.d/hostname new file mode 100644 index 000000000..2f2333ead --- /dev/null +++ b/profiles/apparmor.d/hostname @@ -0,0 +1,35 @@ +#------------------------------------------------------------------ +# Copyright (C) 2025 Canonical Ltd. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of version 2 of the GNU General Public +# License published by the Free Software Foundation. +#------------------------------------------------------------------ +# vim: ft=apparmor +# + +abi , + +include + +@{bin}={/usr,}/bin +@{exec}={hostname,domainname,ypdomainname,nisdomainname,dnsdomainname} + +profile hostname @{bin}/@{exec} { + include + include + + # set hostname, -F + capability sys_admin, + + @{bin}/@{exec} mr, + + network netlink raw, + network inet dgram, + network inet6 dgram, + + file r /etc/hostname, + + # Site-specific additions and overrides. See local/README for details. + include if exists +}