|
| 1 | +# vim:syntax=apparmor |
| 2 | +# |
| 3 | +# Maintained by Chef |
| 4 | +# |
| 5 | +# Updated for Ubuntu by: Jamie Strandboge < [email protected]> |
| 6 | +# ------------------------------------------------------------------ |
| 7 | +# |
| 8 | +# Copyright (C) 2002-2005 Novell/SUSE |
| 9 | +# Copyright (C) 2009-2012 Canonical Ltd. |
| 10 | +# |
| 11 | +# This program is free software; you can redistribute it and/or |
| 12 | +# modify it under the terms of version 2 of the GNU General Public |
| 13 | +# License published by the Free Software Foundation. |
| 14 | +# |
| 15 | +# ------------------------------------------------------------------ |
| 16 | + |
| 17 | +#include <tunables/global> |
| 18 | +#include <tunables/ntpd> |
| 19 | +/usr/sbin/ntpd flags=(attach_disconnected) { |
| 20 | + #include <abstractions/base> |
| 21 | + #include <abstractions/nameservice> |
| 22 | + #include <abstractions/openssl> |
| 23 | + #include <abstractions/user-tmp> |
| 24 | + |
| 25 | + capability ipc_lock, |
| 26 | + capability net_admin, |
| 27 | + capability net_bind_service, |
| 28 | + capability setgid, |
| 29 | + capability setuid, |
| 30 | + capability sys_chroot, |
| 31 | + capability sys_resource, |
| 32 | + capability sys_time, |
| 33 | + capability sys_nice, |
| 34 | + |
| 35 | + # ntp uses AF_INET, AF_INET6 and AF_UNSPEC |
| 36 | + network dgram, |
| 37 | + network stream, |
| 38 | + |
| 39 | + @{PROC}/net/if_inet6 r, |
| 40 | + @{PROC}/*/net/if_inet6 r, |
| 41 | + @{NTPD_DEVICE} rw, |
| 42 | + # pps devices are almost exclusively used with NTP |
| 43 | + /dev/pps[0-9]* rw, |
| 44 | + |
| 45 | + /{,s}bin/ r, |
| 46 | + /usr/{,s}bin/ r, |
| 47 | + /usr/local/{,s}bin/ r, |
| 48 | + /usr/sbin/ntpd rmix, |
| 49 | + |
| 50 | + /etc/ntpsec/ntp.conf r, |
| 51 | + /etc/ntpsec/ntp.d/ r, |
| 52 | + /etc/ntpsec/ntp.d/*.conf r, |
| 53 | + /run/ntpsec/ntp.conf.dhcp r, |
| 54 | + |
| 55 | + /etc/ntpsec/cert-chain.pem r, |
| 56 | + /etc/ntpsec/key.pem r, |
| 57 | + /etc/ntpsec/ntp.keys r, |
| 58 | + |
| 59 | + /var/lib/ntpsec/ntp.drift rw, |
| 60 | + /var/lib/ntpsec/ntp.drift-tmp rw, |
| 61 | + /var/lib/ntpsec/nts-keys rw, |
| 62 | + /usr/share/zoneinfo/leap-seconds.list rw, |
| 63 | + |
| 64 | + /var/log/ntp w, |
| 65 | + /var/log/ntp.log w, |
| 66 | + /var/log/ntpd w, |
| 67 | + /var/log/ntpsec/clockstats* rwl, |
| 68 | + /var/log/ntpsec/loopstats* rwl, |
| 69 | + /var/log/ntpsec/peerstats* rwl, |
| 70 | + /var/log/ntpsec/protostats* rwl, |
| 71 | + /var/log/ntpsec/rawstats* rwl, |
| 72 | + /var/log/ntpsec/sysstats* rwl, |
| 73 | + |
| 74 | + /{,var/}run/ntpd.pid w, |
| 75 | + |
| 76 | + # to be able to check for running ntpdate |
| 77 | + /run/lock/ntpsec-ntpdate wk, |
| 78 | + |
| 79 | + # To sign replies to MS-SNTP clients by the smbd daemon /var/lib/samba |
| 80 | + /var/lib/samba/ntp_signd/socket rw, |
| 81 | + |
| 82 | + # For use with clocks that report via shared memory (e.g. gpsd), |
| 83 | + # you may need to give ntpd access to all of shared memory, though |
| 84 | + # this can be considered dangerous. See https://launchpad.net/bugs/722815 |
| 85 | + # for details. To enable, add this to local/usr.sbin.ntpd: |
| 86 | + # capability ipc_owner, |
| 87 | + |
| 88 | + # Site-specific additions and overrides. See local/README for details. |
| 89 | + #include <local/usr.sbin.ntpd> |
| 90 | +} |
0 commit comments