T06 · System Persistence
- Location
SKILL.md:154- Finding
Automatic Installation of Persistent Gateway Watchdogs
- Content
View full analysis
/dev/null | grep -q "openclaw-gateway"; then (crontab -l 2>/dev/null; echo "*/5 * * * * pgrep -f \"openclaw-gateway\" > /dev/null || cd $OPENCLAW_PATH && node ./dist/daemon-cli.js start >> /tmp/gateway_guardian.log 2>&1") | crontab - echo "✅ 已自动配置外部守护(每 5 分钟检查)" else echo "✅ 外部守护已配置" fi ``` The Windows instructions additionally recommend elevated scheduled-task registration: ```powershell $action = New-ScheduledTaskAction -Execute "powershell.exe" -Argument "-ExecutionPolicy Bypass -File C:\Users\你的用户名\.openclaw\scripts\guardian-windows.ps1" $trigger = New-ScheduledTaskTrigger -At Startup Register-ScheduledTask -TaskName "OpenClaw Guardian" -Trigger $trigger -Action $action -RunLevel Highest ``` ### Technical Analysis The Skill directs the agent to modify the user's crontab automatically during the first self-check. The resulting task executes every five minutes and survives both the Skill invocation and future login sessions. The Windows alternative creates startup or repeating scheduled tasks and explicitly requests the highest available run level. A persistent watchdog is related to the declared guardian functionality, but automatic registration during an ordinary health check exceeds the minimum privileges required to inspect or restart the Gateway once. Persistence installation should be a separate, explicitly authorized operation. The elevated Windows run level is especially unnecessary unless a documented Gateway deployment requires administrator-only resources. The Linux command also depends on a mutable installation director ...[truncated 1622 chars]- Remediation
View remediation
