next: reduce diff to v1, add go hardening

This commit is contained in:
Levente Polyak
2020-05-16 00:15:22 +00:00
parent a4ae059ffc
commit 4d4473add2
3 changed files with 49 additions and 33 deletions

View File

@ -18,6 +18,8 @@ StartLimitBurst=10
[Service]
User=caddy
Group=caddy
Environment=XDG_DATA_HOME=/var/lib
Environment=XDG_CONFIG_HOME=/var/lib
ExecStart=/usr/bin/caddy run --environ --resume
# Do not allow the process to be restarted in a tight loop. If the
@ -32,19 +34,19 @@ TimeoutStopSec=5s
LimitNOFILE=1048576
LimitNPROC=512
# Hardening options
PrivateTmp=true
ProtectSystem=strict
ProtectKernelModules=true
NoNewPrivileges=true
LockPersonality=true
ProtectKernelTunables=true
ProtectHome=true
ReadWritePaths=/var/lib/caddy /var/log/caddy
PrivateDevices=true
ProtectControlGroups=true
ProtectHome=true
ProtectSystem=strict
ReadWritePaths=/var/lib/caddy /var/log/caddy
CapabilityBoundingSet=CAP_NET_BIND_SERVICE
AmbientCapabilities=CAP_NET_BIND_SERVICE
NoNewPrivileges=true
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectControlGroups=true
LockPersonality=true
[Install]
WantedBy=multi-user.target