mirror of
https://github.com/msfjarvis/server-config
synced 2025-08-13 19:27:02 +05:30
systemd: Sync security options across units
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
This commit is contained in:
parent
9597b4f6e1
commit
e40c2c999b
9 changed files with 105 additions and 14 deletions
|
@ -16,14 +16,23 @@ KillSignal=SIGQUIT
|
||||||
TimeoutStopSec=5s
|
TimeoutStopSec=5s
|
||||||
LimitNOFILE=1048576
|
LimitNOFILE=1048576
|
||||||
LimitNPROC=512
|
LimitNPROC=512
|
||||||
PrivateTmp=true
|
|
||||||
PrivateDevices=true
|
|
||||||
ProtectHome=true
|
|
||||||
ProtectSystem=full
|
|
||||||
ReadWriteDirectories=/etc/ssl/caddy /etc/logs
|
ReadWriteDirectories=/etc/ssl/caddy /etc/logs
|
||||||
CapabilityBoundingSet=CAP_NET_BIND_SERVICE
|
CapabilityBoundingSet=CAP_NET_BIND_SERVICE
|
||||||
AmbientCapabilities=CAP_NET_BIND_SERVICE
|
AmbientCapabilities=CAP_NET_BIND_SERVICE
|
||||||
|
|
||||||
|
# Security
|
||||||
|
PrivateTmp=true
|
||||||
|
ProtectSystem=full
|
||||||
|
ProtectHome=true
|
||||||
NoNewPrivileges=true
|
NoNewPrivileges=true
|
||||||
|
ProtectControlGroups=true
|
||||||
|
ProtectKernelModules=true
|
||||||
|
ProtectKernelTunables=true
|
||||||
|
PrivateDevices=true
|
||||||
|
RestrictAddressFamilies=AF_INET AF_INET6
|
||||||
|
RestrictNamespaces=true
|
||||||
|
RestrictRealtime=true
|
||||||
|
SystemCallArchitectures=native
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
|
@ -12,10 +12,20 @@ User=caddy
|
||||||
Group=caddy
|
Group=caddy
|
||||||
ExecStart=/usr/local/bin/daas
|
ExecStart=/usr/local/bin/daas
|
||||||
Restart=always
|
Restart=always
|
||||||
|
|
||||||
|
# Security
|
||||||
PrivateTmp=true
|
PrivateTmp=true
|
||||||
PrivateDevices=true
|
|
||||||
ProtectHome=true
|
|
||||||
ProtectSystem=full
|
ProtectSystem=full
|
||||||
|
ProtectHome=true
|
||||||
|
NoNewPrivileges=true
|
||||||
|
ProtectControlGroups=true
|
||||||
|
ProtectKernelModules=true
|
||||||
|
ProtectKernelTunables=true
|
||||||
|
PrivateDevices=true
|
||||||
|
RestrictAddressFamilies=AF_INET AF_INET6
|
||||||
|
RestrictNamespaces=true
|
||||||
|
RestrictRealtime=true
|
||||||
|
SystemCallArchitectures=native
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
|
@ -15,12 +15,22 @@ WorkingDirectory=/var/lib/gitea/
|
||||||
ExecStart=/usr/local/bin/gitea web -c /etc/gitea/app.ini
|
ExecStart=/usr/local/bin/gitea web -c /etc/gitea/app.ini
|
||||||
Restart=always
|
Restart=always
|
||||||
Environment=USER=git HOME=/home/git GITEA_WORK_DIR=/var/lib/gitea
|
Environment=USER=git HOME=/home/git GITEA_WORK_DIR=/var/lib/gitea
|
||||||
PrivateTmp=true
|
|
||||||
PrivateDevices=true
|
|
||||||
ProtectSystem=full
|
|
||||||
ReadWriteDirectories=/var/lib/gitea
|
ReadWriteDirectories=/var/lib/gitea
|
||||||
CapabilityBoundingSet=CAP_NET_BIND_SERVICE
|
CapabilityBoundingSet=CAP_NET_BIND_SERVICE
|
||||||
AmbientCapabilities=CAP_NET_BIND_SERVICE
|
AmbientCapabilities=CAP_NET_BIND_SERVICE
|
||||||
|
|
||||||
|
# Security
|
||||||
|
PrivateTmp=true
|
||||||
|
ProtectSystem=full
|
||||||
|
NoNewPrivileges=true
|
||||||
|
ProtectControlGroups=true
|
||||||
|
ProtectKernelModules=true
|
||||||
|
ProtectKernelTunables=true
|
||||||
|
PrivateDevices=true
|
||||||
|
RestrictAddressFamilies=AF_INET AF_INET6
|
||||||
|
RestrictNamespaces=true
|
||||||
|
RestrictRealtime=true
|
||||||
|
SystemCallArchitectures=native
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
|
@ -12,10 +12,20 @@ User=caddy
|
||||||
Group=caddy
|
Group=caddy
|
||||||
ExecStart=/usr/bin/goaccess --log-format=VCOMMON --ws-url=wss://stats.msfjarvis.dev/ws --output=/var/www/stats.msfjarvis.dev/index.html --log-file=/etc/logs/requests.log --no-query-string --anonymize-ip --double-decode --real-os --compression=zlib --real-time-html
|
ExecStart=/usr/bin/goaccess --log-format=VCOMMON --ws-url=wss://stats.msfjarvis.dev/ws --output=/var/www/stats.msfjarvis.dev/index.html --log-file=/etc/logs/requests.log --no-query-string --anonymize-ip --double-decode --real-os --compression=zlib --real-time-html
|
||||||
Restart=always
|
Restart=always
|
||||||
|
|
||||||
|
# Security
|
||||||
PrivateTmp=true
|
PrivateTmp=true
|
||||||
PrivateDevices=true
|
|
||||||
ProtectHome=true
|
|
||||||
ProtectSystem=full
|
ProtectSystem=full
|
||||||
|
ProtectHome=true
|
||||||
|
NoNewPrivileges=true
|
||||||
|
ProtectControlGroups=true
|
||||||
|
ProtectKernelModules=true
|
||||||
|
ProtectKernelTunables=true
|
||||||
|
PrivateDevices=true
|
||||||
|
RestrictAddressFamilies=AF_INET AF_INET6
|
||||||
|
RestrictNamespaces=true
|
||||||
|
RestrictRealtime=true
|
||||||
|
SystemCallArchitectures=native
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
|
@ -13,8 +13,19 @@ ExecReload=/bin/kill -USR1 $MAINPID
|
||||||
KillMode=mixed
|
KillMode=mixed
|
||||||
KillSignal=SIGQUIT
|
KillSignal=SIGQUIT
|
||||||
TimeoutStopSec=5s
|
TimeoutStopSec=5s
|
||||||
|
|
||||||
|
# Security
|
||||||
PrivateTmp=true
|
PrivateTmp=true
|
||||||
|
ProtectSystem=full
|
||||||
|
NoNewPrivileges=true
|
||||||
|
ProtectControlGroups=true
|
||||||
|
ProtectKernelModules=true
|
||||||
|
ProtectKernelTunables=true
|
||||||
PrivateDevices=true
|
PrivateDevices=true
|
||||||
|
RestrictAddressFamilies=AF_INET AF_INET6
|
||||||
|
RestrictNamespaces=true
|
||||||
|
RestrictRealtime=true
|
||||||
|
SystemCallArchitectures=native
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
|
@ -13,8 +13,19 @@ ExecReload=/bin/kill -USR1 $MAINPID
|
||||||
KillMode=mixed
|
KillMode=mixed
|
||||||
KillSignal=SIGQUIT
|
KillSignal=SIGQUIT
|
||||||
TimeoutStopSec=5s
|
TimeoutStopSec=5s
|
||||||
|
|
||||||
|
# Security
|
||||||
PrivateTmp=true
|
PrivateTmp=true
|
||||||
|
ProtectSystem=full
|
||||||
|
NoNewPrivileges=true
|
||||||
|
ProtectControlGroups=true
|
||||||
|
ProtectKernelModules=true
|
||||||
|
ProtectKernelTunables=true
|
||||||
PrivateDevices=true
|
PrivateDevices=true
|
||||||
|
RestrictAddressFamilies=AF_INET AF_INET6
|
||||||
|
RestrictNamespaces=true
|
||||||
|
RestrictRealtime=true
|
||||||
|
SystemCallArchitectures=native
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
|
@ -14,9 +14,19 @@ ExecReload=/bin/kill -USR1 $MAINPID
|
||||||
KillMode=mixed
|
KillMode=mixed
|
||||||
KillSignal=SIGQUIT
|
KillSignal=SIGQUIT
|
||||||
TimeoutStopSec=5s
|
TimeoutStopSec=5s
|
||||||
|
|
||||||
|
# Security
|
||||||
PrivateTmp=true
|
PrivateTmp=true
|
||||||
PrivateDevices=true
|
|
||||||
ProtectSystem=full
|
ProtectSystem=full
|
||||||
|
NoNewPrivileges=true
|
||||||
|
ProtectControlGroups=true
|
||||||
|
ProtectKernelModules=true
|
||||||
|
ProtectKernelTunables=true
|
||||||
|
PrivateDevices=true
|
||||||
|
RestrictAddressFamilies=AF_INET AF_INET6
|
||||||
|
RestrictNamespaces=true
|
||||||
|
RestrictRealtime=true
|
||||||
|
SystemCallArchitectures=native
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
|
@ -12,9 +12,19 @@ ExecReload=/bin/kill -USR1 $MAINPID
|
||||||
KillMode=mixed
|
KillMode=mixed
|
||||||
KillSignal=SIGQUIT
|
KillSignal=SIGQUIT
|
||||||
TimeoutStopSec=5s
|
TimeoutStopSec=5s
|
||||||
|
|
||||||
|
# Security
|
||||||
PrivateTmp=true
|
PrivateTmp=true
|
||||||
PrivateDevices=false
|
|
||||||
ProtectSystem=full
|
ProtectSystem=full
|
||||||
|
NoNewPrivileges=true
|
||||||
|
ProtectControlGroups=true
|
||||||
|
ProtectKernelModules=true
|
||||||
|
ProtectKernelTunables=true
|
||||||
|
PrivateDevices=true
|
||||||
|
RestrictAddressFamilies=AF_INET AF_INET6
|
||||||
|
RestrictNamespaces=true
|
||||||
|
RestrictRealtime=true
|
||||||
|
SystemCallArchitectures=native
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
|
@ -12,9 +12,19 @@ ExecReload=/bin/kill -USR1 $MAINPID
|
||||||
KillMode=mixed
|
KillMode=mixed
|
||||||
KillSignal=SIGQUIT
|
KillSignal=SIGQUIT
|
||||||
TimeoutStopSec=5s
|
TimeoutStopSec=5s
|
||||||
|
|
||||||
|
# Security
|
||||||
PrivateTmp=true
|
PrivateTmp=true
|
||||||
PrivateDevices=false
|
|
||||||
ProtectSystem=full
|
ProtectSystem=full
|
||||||
|
NoNewPrivileges=true
|
||||||
|
ProtectControlGroups=true
|
||||||
|
ProtectKernelModules=true
|
||||||
|
ProtectKernelTunables=true
|
||||||
|
PrivateDevices=true
|
||||||
|
RestrictAddressFamilies=AF_INET AF_INET6
|
||||||
|
RestrictNamespaces=true
|
||||||
|
RestrictRealtime=true
|
||||||
|
SystemCallArchitectures=native
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue