53 lines
1.8 KiB
Desktop File
53 lines
1.8 KiB
Desktop File
[Unit]
|
|
Description=AdGuard Shield - Go DNS Rate-Limit Monitor
|
|
Documentation=https://git.techniverse.net/scriptos/adguard-shield
|
|
After=network.target AdGuardHome.service
|
|
Wants=AdGuardHome.service
|
|
StartLimitBurst=5
|
|
StartLimitIntervalSec=300
|
|
|
|
[Service]
|
|
Type=simple
|
|
ExecStart=/opt/adguard-shield/adguard-shield -config /opt/adguard-shield/adguard-shield.conf run
|
|
|
|
# Neustart-Verhalten
|
|
Restart=on-failure
|
|
RestartSec=30
|
|
|
|
# Sicherheits-Hardening
|
|
# Der Daemon läuft als root, aber nur mit den Capabilities, die er wirklich
|
|
# nutzt. Log, State-DB, Listen-Caches, GeoIP-Downloads und PID-Datei gehören
|
|
# root, daher sind CAP_DAC_OVERRIDE, CAP_DAC_READ_SEARCH, CAP_FOWNER und
|
|
# CAP_CHOWN nicht nötig. Der Daemon wechselt keine Benutzer (kein CAP_SETUID/
|
|
# CAP_SETGID) und signalisiert keine fremden Prozesse (kein CAP_KILL).
|
|
# E-Mail-Reports laufen per Cron (report-send) außerhalb dieses Service;
|
|
# NoNewPrivileges betrifft sendmail/postdrop daher nicht.
|
|
ProtectSystem=full
|
|
ReadWritePaths=/var/log /var/lib/adguard-shield /var/run /opt/adguard-shield/geoip
|
|
ProtectHome=true
|
|
PrivateTmp=true
|
|
NoNewPrivileges=true
|
|
RestrictSUIDSGID=true
|
|
LockPersonality=true
|
|
RestrictRealtime=true
|
|
ProtectClock=true
|
|
ProtectControlGroups=true
|
|
ProtectKernelLogs=true
|
|
SystemCallArchitectures=native
|
|
# Bewusst nicht gesetzt: ProtectKernelTunables (iptables/ipset können
|
|
# /proc/sys/net beschreiben) und ProtectKernelModules (Netfilter-Module).
|
|
|
|
# CAP_NET_ADMIN: iptables, ip6tables, ipset
|
|
# CAP_NET_RAW: iptables-legacy nutzt einen Raw-Socket
|
|
# CAP_NET_BIND_SERVICE: nur für WEB_PORT unter 1024
|
|
AmbientCapabilities=CAP_NET_ADMIN CAP_NET_RAW CAP_NET_BIND_SERVICE
|
|
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_RAW CAP_NET_BIND_SERVICE
|
|
|
|
# Logging
|
|
StandardOutput=journal
|
|
StandardError=journal
|
|
SyslogIdentifier=adguard-shield
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|