-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsimpledeploy.service
More file actions
60 lines (50 loc) · 1.84 KB
/
simpledeploy.service
File metadata and controls
60 lines (50 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
[Unit]
Description=SimpleDeploy
After=docker.service
Requires=docker.service
[Service]
Type=simple
ExecStart=/usr/local/bin/simpledeploy serve --config /etc/simpledeploy/config.yaml
Restart=always
RestartSec=5
# Point HOME at a writable, allow-listed path. ProtectHome=true masks /root,
# so anything that consults $HOME (docker CLI config, certmagic ACME fallback,
# future deps) needs an alternate writable HOME. /var/lib/simpledeploy is
# already in ReadWritePaths below.
Environment=HOME=/var/lib/simpledeploy
# --- Hardening ---
# SimpleDeploy must run as root by default because it talks to the docker
# daemon socket and binds privileged ports (80/443) via Caddy. The
# directives below reduce blast radius without breaking the runtime path.
# Allow binding low ports without full root capabilities.
AmbientCapabilities=CAP_NET_BIND_SERVICE
CapabilityBoundingSet=CAP_NET_BIND_SERVICE CAP_NET_RAW CAP_DAC_OVERRIDE CAP_CHOWN CAP_SETUID CAP_SETGID CAP_KILL
# Block setuid/setgid binaries inside the unit.
NoNewPrivileges=true
# Read-only system tree, with explicit writable paths for state.
ProtectSystem=strict
ReadWritePaths=/etc/simpledeploy /var/lib/simpledeploy
ProtectHome=true
PrivateTmp=true
# Kernel and tuning surface.
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectKernelLogs=true
ProtectControlGroups=true
ProtectClock=true
ProtectHostname=true
ProtectProc=invisible
RestrictNamespaces=true
RestrictRealtime=true
RestrictSUIDSGID=true
LockPersonality=true
MemoryDenyWriteExecute=true
# Network: dashboard speaks IP and unix (docker.sock); deny the rest.
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6 AF_NETLINK
# Syscall filter: standard system-service set covers our needs (including
# fork/exec for docker compose).
SystemCallFilter=@system-service
SystemCallErrorNumber=EPERM
SystemCallArchitectures=native
[Install]
WantedBy=multi-user.target