2020-09-12 17:19:23 +02:00
|
|
|
# vim:syntax=apparmor
|
|
|
|
# ------------------------------------------------------------------
|
|
|
|
#
|
2021-01-10 16:35:07 +01:00
|
|
|
# Copyright (C) 2017-2021 Mikhail Morfikov
|
2020-09-12 17:19:23 +02:00
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
#
|
|
|
|
# ------------------------------------------------------------------
|
|
|
|
|
2020-12-10 22:33:39 +01:00
|
|
|
abi <abi/3.0>,
|
2020-09-12 17:19:23 +02:00
|
|
|
|
2020-12-10 22:33:39 +01:00
|
|
|
include <tunables/global>
|
2020-09-12 17:19:23 +02:00
|
|
|
|
|
|
|
@{exec_path} = /{usr/,}sbin/hddtemp
|
|
|
|
profile hddtemp @{exec_path} {
|
2020-12-10 22:33:39 +01:00
|
|
|
include <abstractions/base>
|
2020-09-12 17:19:23 +02:00
|
|
|
|
|
|
|
# To remove the following errors:
|
|
|
|
# /dev/sda: Permission denied
|
|
|
|
capability sys_rawio,
|
|
|
|
|
|
|
|
# There's the following error in strace:
|
|
|
|
# ioctl(3, HDIO_DRIVE_CMD, 0x7ffdfeafc074) = -1 EACCES (Permission denied)
|
|
|
|
# This should be covered by CAP_SYS_RAWIO instead.
|
|
|
|
# (see: https://www.kernel.org/doc/Documentation/ioctl/hdio.rst)
|
|
|
|
# It looks like hddtemp works just fine without it.
|
|
|
|
deny capability sys_admin,
|
|
|
|
|
2020-12-10 22:33:39 +01:00
|
|
|
network inet stream,
|
|
|
|
network inet6 stream,
|
|
|
|
|
2020-09-12 17:19:23 +02:00
|
|
|
@{exec_path} mr,
|
|
|
|
|
|
|
|
# Monitored hard drives
|
|
|
|
/dev/sd[a-z] r,
|
|
|
|
|
|
|
|
# Database file that allows hddtemp to recognize supported drives
|
|
|
|
/etc/hddtemp.db r,
|
|
|
|
|
|
|
|
# Needed when the hddtemp daemon is started in the TCP/IP mode
|
|
|
|
/etc/gai.conf r,
|
|
|
|
|
2020-12-10 22:33:39 +01:00
|
|
|
include if exists <local/hddtemp>
|
2020-09-12 17:19:23 +02:00
|
|
|
}
|