T06 · System Persistence
- Location
scripts/tunnel-setup.sh:97- Finding
Reboot-Persistent Cloudflare Tunnel Runs with Unnecessary Root Privileges
- Content
View full analysis
"$SERVICE_FILE" << EOF [Unit] Description=Cloudflare Tunnel for OpenClaw agent: ${AGENT} After=network.target [Service] Type=simple User=root ExecStart=/usr/bin/cloudflared tunnel --no-autoupdate --config ${CONFIG_FILE} run Restart=always RestartSec=5 [Install] WantedBy=multi-user.target EOF systemctl daemon-reload systemctl enable "$SERVICE_NAME" systemctl restart "$SERVICE_NAME" ``` The documented equivalent in `SKILL.md` also explicitly enables the persistent service: ```bash systemctl daemon-reload systemctl enable cloudflared-koda systemctl start cloudflared-koda systemctl is-active cloudflared-koda ``` The multi-agent instructions in `references/custom-domains.md` enable several persistent services: ```bash systemctl daemon-reload systemctl enable cloudflared-koda cloudflared-alex cloudflared-jordan systemctl start cloudflared-koda cloudflared-alex cloudflared-jordan ``` ### Technical Analysis The setup writes a system-level unit into `/etc/systemd/system`, enables it for startup under `multi-user.target`, and configures `Restart=always`. The resulting Cloudflare tunnel survives completion of the Skill, automatically starts after reboot, and reconnects whenever it exits. Cross-session persistence is relevant to the declared permanent-tunnel feature and is openly documented rather than concealed. Nevertheless, the implementation exceeds minimum necessary privileges because `cloudflared` is explicitly run as `root`. A tunnel process generally only needs permission to read its own configuration and credential file and ...[truncated 1834 chars]- Remediation
View remediation
