mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
MDEV-10298: Systemd hardening
Add ProtectSystem=full, NoNewPrivileges=true, PrivateDevices=true, and ProtectHome=true to the systemd units.
This commit is contained in:
committed by
Sergey Vojtovich
parent
f280a87c66
commit
53e7fcca41
@@ -45,6 +45,16 @@ Group=mysql
|
||||
# To allow memlock to be used as non-root user if set in configuration
|
||||
CapabilityBoundingSet=CAP_IPC_LOCK
|
||||
|
||||
# Prevent writes to /usr, /boot, and /etc
|
||||
ProtectSystem=full
|
||||
|
||||
NoNewPrivileges=true
|
||||
|
||||
PrivateDevices=true
|
||||
|
||||
# Prevent accessing /home, /root and /run/user
|
||||
ProtectHome=true
|
||||
|
||||
# Execute pre and post scripts as root, otherwise it does it as User=
|
||||
PermissionsStartOnly=true
|
||||
|
||||
|
||||
@@ -52,6 +52,16 @@ Group=mysql
|
||||
# To allow memlock to be used as non-root user if set in configuration
|
||||
CapabilityBoundingSet=CAP_IPC_LOCK
|
||||
|
||||
# Prevent writes to /usr, /boot, and /etc
|
||||
ProtectSystem=full
|
||||
|
||||
NoNewPrivileges=true
|
||||
|
||||
PrivateDevices=true
|
||||
|
||||
# Prevent accessing /home, /root and /run/user
|
||||
ProtectHome=true
|
||||
|
||||
# Execute pre and post scripts as root, otherwise it does it as User=
|
||||
PermissionsStartOnly=true
|
||||
|
||||
|
||||
Reference in New Issue
Block a user