Skip to content

Commit 7fb8fb4

Browse files
committed
Merge #12102: Apply hardening measures in bitcoind systemd service file
79ddfad Apply hardening measurements in bitcoind systemd service file (Florian Schmaus) Pull request description: Adds typical systemd hardening measurements for network services. Tree-SHA512: 63e54d5a2e3e625c123c91e4392474226ec26c48709f2627f4d9d257a59f6960dd53ba4faa10cd355a89cad37fe351e2dbe8db79e681645b59081cf83e940438
2 parents c4219ff + 79ddfad commit 7fb8fb4

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)