2020-09-12 17:19:23 +02:00
|
|
|
# vim:syntax=apparmor
|
|
|
|
# ------------------------------------------------------------------
|
|
|
|
#
|
2021-01-10 16:35:07 +01:00
|
|
|
# Copyright (C) 2018-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/exim4
|
|
|
|
profile exim4 @{exec_path} {
|
2020-12-10 22:33:39 +01:00
|
|
|
include <abstractions/base>
|
|
|
|
include <abstractions/consoles>
|
|
|
|
include <abstractions/nameservice-strict>
|
|
|
|
|
2020-12-24 13:55:12 +01:00
|
|
|
network inet dgram,
|
|
|
|
network inet6 dgram,
|
|
|
|
network inet stream,
|
|
|
|
network inet6 stream,
|
2020-12-10 22:33:39 +01:00
|
|
|
network netlink raw,
|
2020-09-12 17:19:23 +02:00
|
|
|
|
|
|
|
@{exec_path} mrix,
|
|
|
|
|
2020-12-24 13:55:12 +01:00
|
|
|
# To bind to port 25/tcp
|
|
|
|
capability net_bind_service,
|
|
|
|
|
|
|
|
# To remove the following error:
|
|
|
|
# exim4[]: exim: setgroups() failed: Operation not permitted
|
2020-09-12 17:19:23 +02:00
|
|
|
capability setgid,
|
2020-12-24 13:55:12 +01:00
|
|
|
|
|
|
|
# To remove the following error:
|
|
|
|
# exim4[]: unable to set gid=110 or uid=105 (euid=0): calling tls_validate_require_cipher
|
2020-09-12 17:19:23 +02:00
|
|
|
capability setuid,
|
2020-12-24 13:55:12 +01:00
|
|
|
|
|
|
|
# To remove the following error:
|
|
|
|
# exim4[]: Cannot open main log file "/var/log/exim4/mainlog": Permission denied: euid=0 egid=110
|
|
|
|
capability dac_read_search,
|
|
|
|
capability dac_override,
|
|
|
|
|
|
|
|
# To remove the following error:
|
|
|
|
# exim.c:774: chown(/var/spool/exim4//msglog//1kqH5Z-000RUf-UR, 105:110) failed (Operation not
|
|
|
|
# permitted). Please contact the authors and refer to https://bugs.exim.org/show_bug.cgi?id=2391
|
2020-09-12 17:19:23 +02:00
|
|
|
capability chown,
|
2020-12-24 13:55:12 +01:00
|
|
|
|
|
|
|
# To remove the following error:
|
|
|
|
# Couldn't chmod message log /var/spool/exim4//msglog//1kqH6c-000S7r-Ni: Operation not permitted
|
2020-09-12 17:19:23 +02:00
|
|
|
capability fowner,
|
2020-12-24 13:55:12 +01:00
|
|
|
|
|
|
|
# Needed?
|
|
|
|
audit deny capability net_admin,
|
2020-09-12 17:19:23 +02:00
|
|
|
|
|
|
|
/var/lib/exim4/config.autogenerated{,.tmp} r,
|
|
|
|
|
|
|
|
/etc/email-addresses r,
|
|
|
|
/etc/aliases r,
|
|
|
|
|
2020-12-24 13:55:12 +01:00
|
|
|
deny /var/log/exim4/ w,
|
2020-09-12 17:19:23 +02:00
|
|
|
/var/log/exim4/mainlog w,
|
|
|
|
/var/log/exim4/paniclog w,
|
|
|
|
|
|
|
|
owner /var/spool/exim4/ r,
|
|
|
|
/var/spool/exim4/input/ r,
|
|
|
|
/var/spool/exim4/input/*-*-*-* rwk,
|
|
|
|
owner /var/spool/exim4/input/hdr.*-*-* rw,
|
|
|
|
owner /var/spool/exim4/input/hdr.@{pid} rw,
|
|
|
|
/var/spool/exim4/db/retry.lockfile rwk,
|
|
|
|
/var/spool/exim4/msglog/*-*-* w,
|
|
|
|
|
|
|
|
owner /var/mail/* rwk,
|
|
|
|
owner /var/mail/*.lock.*.[0-9a-f]*.[0-9a-f]* w,
|
|
|
|
owner /var/mail/*.lock wl -> /var/mail/*.lock.*.[0-9a-f]*.[0-9a-f]*,
|
|
|
|
|
2020-10-25 10:23:34 +01:00
|
|
|
owner @{run}/exim4/exim.pid rw,
|
2020-09-12 17:19:23 +02:00
|
|
|
|
2020-10-25 10:23:34 +01:00
|
|
|
owner @{run}/dbus/system_bus_socket rw,
|
2020-09-12 17:19:23 +02:00
|
|
|
|
|
|
|
# file_inherit
|
|
|
|
/tmp/#[0-9]*[0-9] rw,
|
|
|
|
/var/lib/dpkg/status r,
|
|
|
|
/var/log/cron-apt/lastfullmessage r,
|
|
|
|
|
2020-12-10 22:33:39 +01:00
|
|
|
include if exists <local/exim4>
|
2020-09-12 17:19:23 +02:00
|
|
|
}
|