aboutsummarylogtreecommitdiffstats
path: root/zeroclaw.service
blob: 1547994cb0ecd3522efb20f9cbba78ad83bdb2fe (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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
[Unit]
Description=ZeroClaw autonomous AI agent runtime
Documentation=https://github.com/zeroclaw-labs/zeroclaw
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
User=zeroclaw
Group=zeroclaw
WorkingDirectory=/var/lib/zeroclaw
ExecStart=/usr/bin/zeroclaw daemon
Restart=on-failure
RestartSec=5s
Environment=RUST_LOG=info
Environment=HOME=/var/lib/zeroclaw
Environment=ZEROCLAW_WORKSPACE=/var/lib/zeroclaw/workspace

# ── Logging ───────────────────────────────────────────────────────
StandardOutput=journal
StandardError=journal
SyslogIdentifier=zeroclaw

# ── Identity & Privilege ──────────────────────────────────────────
NoNewPrivileges=yes
CapabilityBoundingSet=
AmbientCapabilities=

# ── Filesystem ───────────────────────────────────────────────────
ProtectSystem=strict
ProtectHome=yes
ReadWritePaths=/var/lib/zeroclaw
ReadOnlyPaths=/etc/ssl /etc/ca-certificates /etc/resolv.conf /etc/hosts /etc/nsswitch.conf
PrivateTmp=yes
PrivateDevices=yes
PrivateMounts=yes

# ── Kernel Protection ─────────────────────────────────────────────
ProtectKernelTunables=yes
ProtectKernelModules=yes
ProtectKernelLogs=yes
ProtectControlGroups=yes
ProtectClock=yes
ProtectHostname=yes
ProtectProc=invisible
ProcSubset=pid

# ── Network ───────────────────────────────────────────────────────
RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX

# ── Namespaces & Personality ──────────────────────────────────────
RestrictNamespaces=yes
LockPersonality=yes

# ── Memory Security ───────────────────────────────────────────────
# MemoryDenyWriteExecute is intentionally omitted: zeroclaw uses wasmtime/cranelift
# JIT compilation for WASM plugins, which requires write+execute memory mappings.

# ── Syscall Filtering ─────────────────────────────────────────────
SystemCallArchitectures=native
SystemCallFilter=@system-service
SystemCallFilter=~@clock @cpu-emulation @debug @keyring @module @mount @obsolete @privileged @raw-io @reboot @resources @setuid @swap
SystemCallFilter=~memfd_create

# ── IPC & Misc ────────────────────────────────────────────────────
PrivateIPC=yes
RestrictSUIDSGID=yes
RestrictRealtime=yes
KeyringMode=private
UMask=0077


[Install]
WantedBy=multi-user.target