1 |
commit: 6d1bfd687106fcb4a75e0d225d77153f2b9c581d |
2 |
Author: Craig Andrews <candrews <AT> integralblue <DOT> com> |
3 |
AuthorDate: Tue Jan 24 17:39:20 2017 +0000 |
4 |
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Jan 29 23:46:19 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6d1bfd68 |
7 |
|
8 |
mail-mta/postfix: additional systemd hardening |
9 |
|
10 |
Other distributions are doing the same thing, and these additions are recommended by systemd. See https://lwn.net/Articles/709755/ |
11 |
|
12 |
(cherry picked from commit 388f5cae8b89039f285a66651bc70d662a9d8e57) |
13 |
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org> |
14 |
Fixes: https://github.com/gentoo/gentoo/pull/3629 |
15 |
|
16 |
mail-mta/postfix/files/postfix.service | 6 ++++++ |
17 |
1 file changed, 6 insertions(+) |
18 |
|
19 |
diff --git a/mail-mta/postfix/files/postfix.service b/mail-mta/postfix/files/postfix.service |
20 |
index 585849e..db585b3 100644 |
21 |
--- a/mail-mta/postfix/files/postfix.service |
22 |
+++ b/mail-mta/postfix/files/postfix.service |
23 |
@@ -15,6 +15,12 @@ ProtectSystem=full |
24 |
ReadWritePaths=-/etc/mail/aliases.db |
25 |
CapabilityBoundingSet=~ CAP_NET_ADMIN CAP_SYS_ADMIN CAP_SYS_BOOT CAP_SYS_MODULE |
26 |
MemoryDenyWriteExecute=true |
27 |
+ProtectKernelModules=true |
28 |
+ProtectKernelTunables=true |
29 |
+ProtectControlGroups=true |
30 |
+RestrictAddressFamilies=AF_INET AF_INET6 AF_NETLINK AF_UNIX |
31 |
+RestrictNamespaces=true |
32 |
+RestrictRealtime=true |
33 |
|
34 |
[Install] |
35 |
WantedBy=multi-user.target |