summarylogtreecommitdiffstats
path: root/systemd.service
blob: cc8fe078b0a58144206627da15c98d545ba1ff27 (plain)
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
[Unit]
Description=Cloudflare Tunnel client daemon
After=network.target
Wants=network.target

[Service]
Type=notify
ExecStart=/usr/bin/cloudflared --config /etc/cloudflared/config.yml --no-autoupdate
User=cloudflared
Group=cloudflared
Restart=on-failure
RestartSec=5s
TimeoutStartSec=0

# Allow cloudflared access to logfile
ReadWritePaths=/var/log/cloudflared.log

# Allow cloudflared to bind ports in the range of 0-1024 and restrict it to
# that capability
CapabilityBoundingSet=CAP_NET_BIND_SERVICE
AmbientCapabilities=CAP_NET_BIND_SERVICE

# If cloudflared is run at ports >1024, you should apply these options via a
# drop-in file
#CapabilityBoundingSet=
#AmbientCapabilities=
#PrivateUsers=yes

NoNewPrivileges=true
LimitNOFILE=1048576
UMask=0077

ProtectSystem=strict
ProtectHome=true
PrivateTmp=true
PrivateDevices=true
ProtectHostname=true
ProtectClock=true
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectKernelLogs=true
ProtectControlGroups=true
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6
RestrictNamespaces=true
LockPersonality=true
MemoryDenyWriteExecute=true
RestrictRealtime=true
RestrictSUIDSGID=true
RemoveIPC=true

SystemCallFilter=@system-service
SystemCallFilter=~@privileged @resources
SystemCallArchitectures=native

[Install]
WantedBy=multi-user.target