harden-vps

harden-vps is a cursor rule for Cursor from danielvm-git/bigpowers. It costs 94 tokens per session (3,058 once invoked), scanned A, original, MIT.

A set of steps for securing a production Linux VPS, which is a rented internet-connected server. It covers the Ubuntu operating system, the hosted application, and the VPS provider's backups and health checks.

In plain words
What is it for?
Use it to configure a firewall, block repeated SSH attacks, automate updates and backups, harden system services, and set up provider snapshots.
Why use it?
It reduces common server risks such as open network access, weak SSH settings, missing updates, and absent recovery copies.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/. Also seen: positional $N argument.

Good fit Use it to configure a firewall, block repeated SSH attacks, automate updates and backups, harden system services, and set up provider snapshots.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/danielvm-git/bigpowers/harden-vps
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/danielvm-git/bigpowers

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for harden-vps

README.md
[![agentmods](https://agentmods.dev/badge/rules/danielvm-git/bigpowers/harden-vps/github.svg)](https://agentmods.dev/rules/danielvm-git/bigpowers/harden-vps)
Your own site
<a href="https://agentmods.dev/rules/danielvm-git/bigpowers/harden-vps"><img src="https://agentmods.dev/badge/rules/danielvm-git/bigpowers/harden-vps/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for harden-vps

Your own site · 80×15
<a href="https://agentmods.dev/rules/danielvm-git/bigpowers/harden-vps"><img src="https://agentmods.dev/badge/rules/danielvm-git/bigpowers/harden-vps.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 94 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,058 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 2 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00094 $0.03058
Opus 5.5 $0.00038 $0.01223
Sonnet 5.5 $0.00019 $0.00612
Haiku 4.5 $0.00009 $0.00306

Measured 2mo ago against content hash 60c95b9f8389, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

harden-vps scanned grade A with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Sends data to an external URLlowData exfiltration

A POST to an outside endpoint may be telemetry or may be exfiltration; either way the mod talks to somewhere, and you should know where.

TOKEN=$(curl -s -d "client_id=$CONTABO_CLIENT_ID" \

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -sL "$(curl -sL https://api.github.com/repos/contabo/cntb/releases/latest \
.cursor/rules/harden-vps.mdc · 291 lines

How it starts

The opening of the file, as written. The whole thing — 291 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Harden VPS

Three-layer production hardening for a self-hosted app on any VPS. Each layer independently verifiable. Apply OS first (firewall blocks attacks immediately), then your application (alerts + backups), then your VPS provider (snapshots). See REFERENCE.md for full script bodies, systemd unit template, and gotchas.

Quick start

SSH as root into the VPS. Find credentials in the your VPS provider Customer Control Panel.

HARD GATE — Run ufw status first. No firewall = layer 1 takes priority over everything.

Layer 1 — Ubuntu OS

# UFW
ufw default deny incoming && ufw default allow outgoing
ufw allow 22/tcp && ufw allow 80/tcp && ufw allow 443/tcp && ufw enable
# → verify: ufw status | grep -q active

# fail2ban
apt install -y fail2ban
# Configure /etc/fail2ban/jail.local: sshd, maxretry=3, bantime=3600, findtime=600
systemctl restart fail2ban
# → verify: fail2ban-client status sshd

# unattended-upgrades
apt install -y unattended-upgrades && dpkg-reconfigure -plow unattended-upgrades
# → verify: systemctl is-active unattended-upgrades | grep -q active

# SSH: PermitRootLogin no, PasswordAuthentication no, PubkeyAuthentication yes
# → verify: sshd -T | grep -E 'permitrootlogin no|passwordauthentication no'

# Deploy healthcheck.sh → /opt/your-app/scripts/healthcheck.sh
# Crontab: */5 * * * * /opt/your-app/scripts/healthcheck.sh

Layer 2 — applicationlication

# systemd: User=your-app, NoNewPrivileges=yes, ProtectSystem=full,
#   ProtectKernelTunables=yes, ProtectKernelModules=yes,
#   ProtectControlGroups=yes, RestrictAddressFamilies=AF_INET AF_INET6,
#   RestrictRealtime=yes, PrivateTmp=yes, LimitNOFILE=65536
# → verify: systemctl show your-app -p NoNewPrivileges -p ProtectSystem -p User

# Alerts (your application requires auth; insert via SQLite)
sqlite3 /opt/your-app/data/your-app.db "
INSERT INTO monitoring_alerts (id,name,metric,threshold,operator,enabled,duration_seconds)
VALUES ('a1','Disk >80%','disk_used_percent',80,'gt',1,300);
INSERT INTO monitoring_alerts (id,name,metric,threshold,operator,enabled,duration_seconds)
VALUES ('a2','CPU >90%','cpu_percent',90,'gt',1,60);
INSERT INTO monitoring_alerts (id,name,metric,threshold,operator,enabled,duration_seconds)
VALUES ('a3','RAM >85%','mem_used_percent',85,'gt',1,120);
"
systemctl restart your-app

# Backup crontab (root):
# 0 2 * * * cp /opt/your-app/data/your-app.db /backup/your-app-$(date +\%Y\%m\%d).db
# 0 3 * * * find /backup/ -name "your-app-*.db" -mtime +90 -delete

Read the full file on GitHub · 291 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 291 lines · 94 tokens per session scan A 60c95b9f8389

Subscribe to this mod's changes

harden-vps is a cursor rule published in the GitHub repository danielvm-git/bigpowers (297 stars, last pushed 4d ago), licensed MIT. It adds 94 tokens to every session and 3,058 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 2 findings (sends data to an external url, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

harden-vps compared with cursor rules from other repositories

harden-vps next to 6 cursor rules from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
harden-vpsdanielvm-git/bigpowersCursor rule2974d agoMITA94Cursor
windsurfrulesCacinieP/network-troubleshoot-skillCursor rule81mo agoMITA987Windsurf
vercel-optimizekok-o/koko-contextos-agentsCursor rule22mo agoMITA13Cursor
cloudflare-workersnedcodes-ok/cursorrules-collectionCursor rule389mo agoMITA774Cursor
monitoringnedcodes-ok/cursorrules-collectionCursor rule389mo agoMITA513Cursor
awsnedcodes-ok/cursorrules-collectionCursor rule389mo agoMITA447Cursor
nginxnedcodes-ok/cursorrules-collectionCursor rule389mo agoMITA516Cursor