[Unit] Description=Strawberry Security Scanner Documentation=https://github.com/trvon/strawberry After=local-fs.target [Service] Type=simple ExecStart=/usr/local/bin/strawberry daemon run --config /etc/strawberry/strawberry.conf Environment=XDG_DATA_HOME=/var/lib Environment=STRAWBERRY_BPF_OBJECT=/usr/local/share/strawberry/process_monitor.bpf.o Restart=on-failure RestartSec=10 StandardOutput=journal StandardError=journal # Runs as root but keeps only the capabilities it needs: # CAP_BPF + CAP_PERFMON load and attach the exec tracepoints # CAP_SYS_RESOURCE raise RLIMIT_MEMLOCK for BPF maps on older kernels # CAP_SYS_PTRACE read /proc//exe and cmdline of every process # CAP_DAC_READ_SEARCH read any executable image for hashing/YARA # CAP_SYS_ADMIN fanotify permission events (execution prevention) # CAP_KILL suspend/kill a process from the app (response) User=root # Files and the control socket are group-owned by `strawberry`: members can # read findings (read-only) and use the desktop app's controls. Group=strawberry CapabilityBoundingSet=CAP_BPF CAP_PERFMON CAP_SYS_RESOURCE CAP_SYS_PTRACE CAP_DAC_READ_SEARCH CAP_SYS_ADMIN CAP_KILL AmbientCapabilities=CAP_BPF CAP_PERFMON CAP_SYS_RESOURCE CAP_SYS_PTRACE CAP_DAC_READ_SEARCH CAP_SYS_ADMIN CAP_KILL NoNewPrivileges=true # Filesystem: read-only view of the host, writable state dir only. # /home and /tmp stay visible (read-only) on purpose: malware is commonly # dropped and run from there, and the scanner must be able to read it. ProtectSystem=strict ProtectHome=read-only PrivateTmp=false StateDirectory=strawberry StateDirectoryMode=0750 # OpenSnitch integration: Strawberry writes only strawberry-*.json rules here # (ignored if OpenSnitch is not installed). ReadWritePaths=-/etc/opensnitchd/rules RuntimeDirectory=strawberry RuntimeDirectoryMode=0750 UMask=0027 ProtectKernelModules=true ProtectKernelLogs=true ProtectControlGroups=true ProtectClock=true ProtectHostname=true RestrictRealtime=true RestrictSUIDSGID=true RestrictNamespaces=true LockPersonality=true MemoryDenyWriteExecute=true PrivateNetwork=true RestrictAddressFamilies=AF_UNIX SystemCallArchitectures=native SystemCallFilter=@system-service bpf perf_event_open fanotify_init fanotify_mark SystemCallErrorNumber=EPERM LimitNOFILE=65536 # Resource limits (scan_profile=balanced). The daemon also paces itself (see # the resource governor); these are the kernel-enforced backstop so a scan can # never take the desktop down. For another profile: `systemctl edit strawberry`. # efficient: CPUWeight=20 IOWeight=20 MemoryHigh=384M MemoryMax=768M # aggressive: CPUWeight=100 IOWeight=100 MemoryHigh=1536M MemoryMax=3G CPUWeight=50 IOWeight=50 MemoryHigh=768M MemoryMax=1536M TasksMax=64 # Prefer reclaiming elsewhere before killing the scanner; MemoryMax still bounds it. OOMScoreAdjust=-100 # Never core-dump: the dump helper is an exec, and execs wait on this daemon's # fanotify permission events (2026-10-25 freeze). The daemon also marks itself # non-dumpable and releases those events first on any fatal error. LimitCORE=0 [Install] WantedBy=multi-user.target