DB vps-openclaw-security-hardening
Production-ready security hardening for VPS running OpenClaw AI agents. Includes SSH hardening (custom port), firewall, audit logging, credential management, and intelligent alerting. Follows BSI IT-Grundschutz and NIST guidelines with minimal resource overhead.
Production-ready security hardening for VPS running OpenClaw AI agents.
As a process B 67/100 · Nearly there — weak spots: result and completion, running it twice, progress reporting
What is at stake
The skill contains fragments that, in the wrong hands, cost money or data. Below: what the installer risks and what the author should do.
The skill contains commands that delete files, rewrite disks or execute code fetched from the network. The agent may run them without asking if it believes the instructions require it.
Replace destructive commands with safe equivalents that ask for confirmation, scope them to one folder, and stop piping curl into a shell: pin a version and a checksum.
Below is the worst case for this category. The finding here is medium: the guard saw a sign, not a proof.
The instructions or scripts send data out: environment variables, keys, file contents, chat history. You may never notice, because the agent performs the upload as "part of the task".
If the upload is not needed for the task, remove it: catalogs flag such skills and delist them. If it is needed, name the destination explicitly, say what leaves the machine, and give the user a switch.
How to improve
- Address the high-severity findings: each costs 18 safety points. If one is a false positive, add the rule id to guard.allow in spec.yaml.
- Say in the description WHEN to use the skill ("use when…", example requests): that is the agent's main cue.
- Your own cases (evals/evals.json, 4–6 real requests with expected answers): the full check would then run those instead of a model-drafted suite.
- A spec.yaml with trigger phrases and assertions — a behaviour contract for CI; `skilltest init` writes a template.
Guard findings · 20
-
high Dangerous commands
cmd-persistencescripts/install.sh:186Persistence mechanism (cron / launchd / scheduled task / autorun registry)cat > /etc/cron.d/agent-security <> 'EOF'
-
high Dangerous commands
cmd-persistencescripts/install.sh:199Persistence mechanism (cron / launchd / scheduled task / autorun registry)chmod 644 /etc/cron.d/agent-security
Medium and low: 18
-
medium Dangerous commands
cmd-disable-securityREADME.md:274Disables a security control (Defender, Gatekeeper, SIP, firewall, execution policy) (documentation of a security skill)sudo ufw disable
security skill -
medium Dangerous commands
cmd-persistenceREADME.md:281Persistence mechanism (cron / launchd / scheduled task / autorun registry) (documentation of a security skill)sudo rm /etc/cron.d/agent-security
security skill -
medium Exfiltration
net-credential-usescripts/critical-alert.sh:46Credential used in a network call (verify the destination is the intended service)curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendMessage" \ -
medium Exfiltration
net-credential-usescripts/daily-briefing.sh:129Credential used in a network call (verify the destination is the intended service)curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendMessage" \ -
medium Dangerous commands
cmd-persistencescripts/verify.sh:99Persistence mechanism (cron / launchd / scheduled task / autorun registry) (string literal in code, not executed)check "Security cron installed" "test -f /etc/cron.d/agent-security"
code literal -
medium Exfiltration
net-credential-usescripts/weekly-report.sh:31Credential used in a network call (verify the destination is the intended service)curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendMessage" \ -
low Risky intent
intent-offensive-securityREADME.md:171Offensive-security / dual-use content (legitimate for authorised testing; review intended use)- Privilege escalation attempts
-
low Risky intent
intent-offensive-securityREADME.md:188Offensive-security / dual-use content (legitimate for authorised testing; review intended use)# Failed privilege escalation
-
low Risky intent
intent-offensive-securityREADME.md:216Offensive-security / dual-use content (legitimate for authorised testing; review intended use)- Privilege escalation detected
-
low Dangerous commands
cmd-privilegeREADME.md:281Privilege escalation / world-writable permissions (documentation of a security skill)sudo rm /etc/cron.d/agent-security
security skill -
low Exfiltration
exfil-webhook-urlscripts/critical-alert.sh:46Webhook / callback URL commonly used for exfiltration (verify the destination) (placeholder value)curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendMessage" \placeholder -
low Dangerous commands
cmd-privilegescripts/critical-alert.sh:196Privilege escalation / world-writable permissions (detector / deny-list definition; string literal in code, not executed)elif echo "$event_data" | grep -q "type=SYSCALL.*setuid"; then
detectorcode literal -
low Exfiltration
exfil-webhook-urlscripts/daily-briefing.sh:129Webhook / callback URL commonly used for exfiltration (verify the destination) (placeholder value)curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendMessage" \placeholder -
low Dangerous commands
cmd-background-processscripts/install.sh:83Starts a background / autostarted processsystemctl enable fail2ban 2>/dev/null || warn "Could not enable fail2ban"
-
low Dangerous commands
cmd-background-processscripts/install.sh:148Starts a background / autostarted processsystemctl enable auditd
-
low Dangerous commands
cmd-background-processscripts/install.sh:177Starts a background / autostarted processsystemctl enable unattended-upgrades
-
low Exfiltration
exfil-webhook-urlscripts/weekly-report.sh:31Webhook / callback URL commonly used for exfiltration (verify the destination) (placeholder value)curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendMessage" \placeholder -
low Risky intent
intent-offensive-securitySKILL.md:88Offensive-security / dual-use content (legitimate for authorised testing; review intended use)- Privilege escalation alerts
Files scanned: 12. Evidence is masked. Grey chips explain why severity was lowered.
Against the Agent Skills spec
- warning
description-no-whendescription does not say WHEN to use the skill (no "use when") - note
frontmatter-keyunknown frontmatter key "homepage"
Process rating: all ten parameters 67/100
- 0Result and completion. Does not say what the result is
- 0Progress reporting. Says nothing while it works
- 30Running it twice. 1 mutating operations with no state check
- 50When it triggers. No condition that starts the skill
- 50Failures and branches. 0 branches, has a failure section
- 70Inputs and preconditions. Inputs and preconditions are listed
- 100Tools and files. No external tools needed
- 100Steps. 26 steps
- 100Consistency. Name and required fields are in place
- 100Execution cost. Instruction body is 681 tokens
- medium Safety rules and hard prohibitions inside a skill: they belong in the system prompt, here they protect nothing
Everything here is measured from the skill text rather than judged by a model, so the numbers are checkable. A parameter weighs more when it is a more common reason for the process to stall.
Quality signals
- +5Description has no quoted example phrases that should trigger the skill
- +4Description does not say when NOT to use the skill (false activations)
- +3Output format is not stated: the model decides each time
- -32 of 7 scripts are never mentioned in SKILL.md
- +1No license
- +2Single-language instructions
- +3Description length 262: enough signal without eating the budget
- +4Structure: 14 headings
- +3Step-by-step instructions: 26 items
- +4Has examples (1 code blocks)
Quality base 70; lint remarks subtract, signals add up to 100. Result: 68.