Skip to content

Commit 79ddfad

Browse files
committed
Apply hardening measurements in bitcoind systemd service file
Adds typical systemd hardening measurements for network services.
1 parent 6acd870 commit 79ddfad

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

contrib/init/bitcoind.service

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,26 @@ User=bitcoin
1919
Type=forking
2020
PIDFile=/run/bitcoind/bitcoind.pid
2121
Restart=on-failure
22+
23+
# Hardening measures
24+
####################
25+
26+
# Provide a private /tmp and /var/tmp.
2227
PrivateTmp=true
2328

29+
# Mount /usr, /boot/ and /etc read-only for the process.
30+
ProtectSystem=full
31+
32+
# Disallow the process and all of its children to gain
33+
# new privileges through execve().
34+
NoNewPrivileges=true
35+
36+
# Use a new /dev namespace only populated with API pseudo devices
37+
# such as /dev/null, /dev/zero and /dev/random.
38+
PrivateDevices=true
39+
40+
# Deny the creation of writable and executable memory mappings.
41+
MemoryDenyWriteExecute=true
42+
2443
[Install]
2544
WantedBy=multi-user.target

0 commit comments

Comments
 (0)