1 |
commit: 42bdffe7965568ff651899b35bfa6dceeb757d24 |
2 |
Author: Craig Andrews <candrews <AT> integralblue <DOT> com> |
3 |
AuthorDate: Thu Jun 30 14:27:06 2016 +0000 |
4 |
Commit: Matt Thode <prometheanfire <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Jun 30 22:40:50 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=42bdffe7 |
7 |
|
8 |
net-misc/radvd: systemd hardening |
9 |
|
10 |
Improve the systemd unit by having radvd never run as root, restricting capabilities as much as possible, and limiting file system access. |
11 |
|
12 |
Gentoo-bug: 587588 |
13 |
|
14 |
net-misc/radvd/files/radvd.service | 13 ++++++++++++- |
15 |
1 file changed, 12 insertions(+), 1 deletion(-) |
16 |
|
17 |
diff --git a/net-misc/radvd/files/radvd.service b/net-misc/radvd/files/radvd.service |
18 |
index d9095f6..a3ac66f 100644 |
19 |
--- a/net-misc/radvd/files/radvd.service |
20 |
+++ b/net-misc/radvd/files/radvd.service |
21 |
@@ -4,12 +4,23 @@ Documentation=man:radvd(8) |
22 |
After=network.target |
23 |
|
24 |
[Service] |
25 |
+User=radvd |
26 |
+Group=radvd |
27 |
Type=forking |
28 |
-ExecStart=/usr/sbin/radvd --username radvd --logmethod stderr --debug 0 |
29 |
+ExecStartPre=/usr/sbin/radvd --configtest |
30 |
+ExecStart=/usr/sbin/radvd --logmethod stderr --debug 0 |
31 |
ExecReload=/usr/sbin/radvd --configtest ; \ |
32 |
/bin/kill -HUP $MAINPID |
33 |
CPUSchedulingPolicy=idle |
34 |
PIDFile=/run/radvd/radvd.pid |
35 |
+RuntimeDirectory=radvd |
36 |
+CapabilityBoundingSet=CAP_NET_BIND_SERVICE CAP_NET_RAW |
37 |
+AmbientCapabilities=CAP_NET_BIND_SERVICE CAP_NET_RAW |
38 |
+PrivateTmp=yes |
39 |
+PrivateDevices=yes |
40 |
+ProtectSystem=full |
41 |
+ProtectHome=yes |
42 |
+NoNewPrivileges=yes |
43 |
|
44 |
[Install] |
45 |
WantedBy=multi-user.target |