|
| 1 | +--- |
| 2 | +name: audit-vps |
| 3 | +description: "Audit every Hostinger VPS (KVM plans) on the account and report what needs attention: server state and failed actions, CPU, memory, disk and monthly traffic use, firewall missing or not synced, SSH keys, Monarx malware counts, backup age, Docker Manager projects that are not healthy, old OpenVZ servers, and VPS plans about to lapse. Read-only; produces a prioritised to-do list and names the skill or hPanel page that fixes each item. Triggers: what VPS do I have, audit my servers, check all my VPS, which servers need attention, health check my VPS, are my servers secure, is my VPS backed up, when does my VPS expire." |
| 4 | +--- |
| 5 | + |
| 6 | +# Audit VPS |
| 7 | + |
| 8 | +Read-only from start to finish. The output is a report; every fix is a separate, confirmed step through another skill or in hPanel. |
| 9 | + |
| 10 | +## Calling the operations |
| 11 | + |
| 12 | +- Read the `inputSchema` that `search` returns before the first call of each operation. If a name below is rejected as unknown, `search` for what the step does (e.g. "virtual machine metrics"). |
| 13 | +- Batch reads with `multi-execute`, up to 20 steps a batch. Batches chain operations from one server only — the Hostinger Connector runs `vps` and `billing` as separate servers. When a product group is switched off, skip its checks and say which were skipped. |
| 14 | +- `vps_virtual-machines_list` returns a plain array; paged lists (`vps_actions_list`, `vps_backups_list`, `vps_firewall_list`) return `data` and `meta`. |
| 15 | +- Call only read operations. Do not take a snapshot, sync a firewall, install Monarx or restart anything during the audit. |
| 16 | + |
| 17 | +## 1. Inventory |
| 18 | + |
| 19 | +- `vps_virtual-machines_list` — per server `id`, `hostname`, `plan`, `state`, `actions_lock`, `template.name`, `memory` and `disk` (MB), `bandwidth`, `firewall_group_id`, `subscription_id`, `ipv4[0].address`, `created_at`. |
| 20 | +- `vps_firewall_list` — every firewall group with its rules and `is_synced`. |
| 21 | +- `vps_data-centers_list` — to name each server's location from `data_center_id`. |
| 22 | +- `billing_subscriptions_list` (billing product) — joined to servers on `subscription_id`. |
| 23 | + |
| 24 | +Tell the user the size (servers by plan and location) before the checks. For large accounts offer to scope the audit. |
| 25 | + |
| 26 | +## 2. Checks |
| 27 | + |
| 28 | +Per server, one batch for every read below except `vps_monarx_scan-metrics` and `vps_docker_list`. Their errors stop a batch, so call each of those two on its own: |
| 29 | + |
| 30 | +- **State.** `running` is normal; `stopped` may be the user's own stop or a Hostinger stop after malware was found; `suspended` is non-payment or abuse; `error` needs Hostinger support; `initial` is bought and waiting for setup. Any other state with `actions_lock: locked` is an action in progress. Expired plans can still show `running` — use the subscription. |
| 31 | +- **Actions.** `vps_actions_list` (first page): an `error` in the last 7 days, or an action still `sent` after 12 hours (stuck — Hostinger support). |
| 32 | +- **Usage.** `vps_virtual-machines_metrics` for the last 24 h. `disk_space` and `ram_usage` are in bytes, while `disk` and `memory` are in MB, so convert before comparing: `disk_space` above 85 % of `disk`, `ram_usage` above 90 % of `memory` most of the day, `cpu_usage` above 90 % most of the day. Sustained high CPU leads Hostinger to limit the server's CPU; whether a limit is active shows only in hPanel. |
| 33 | +- **Traffic.** The same metrics from the 1st of the month: inbound plus outbound traffic near the plan's monthly `bandwidth` means the server will be throttled for the rest of the month. |
| 34 | +- **Backups.** `vps_backups_list`: no backup newer than 8 days on a server older than 7 days means the weekly schedule is probably off. The API cannot show the schedule; the user checks hPanel → VPS → Snapshots & Backups, where Auto-backups shows it. |
| 35 | +- **SSH keys.** `vps_ssh-keys_list-virtual-machine`: none means password login only. |
| 36 | +- **Malware.** `vps_monarx_scan-metrics`: `[VPS:2042] Monarx is not installed` means it is not installed; counts mean it is. `malicious` or `compromised` above 0 is a finding. |
| 37 | +- **Docker Manager.** `vps_docker_list` on every server; an empty list means no projects. `[VPS:2044]` means this server has no Docker Manager, so skip it. Availability does not follow the template name. For each project, flag any container not `running`, or with `health` other than `healthy`. |
| 38 | +- **OpenVZ.** A plan named `KVM n` is KVM and is never flagged. Flag a server whose plan name does not start with `KVM`. Only when the plan name is missing or unclear, use `created_at` before 18 April 2023 as a hint, because VPS bought on hostinger.com before then were usually OpenVZ. For a flagged server, the user checks hPanel and follows Hostinger's OpenVZ-to-KVM migration guide. |
| 39 | + |
| 40 | +**Firewall**, from the API only. In hPanel a group's rules sit behind an Actions menu the agent cannot open, so read them here and never send the user to hPanel to read them. Match each server's `firewall_group_id` to a group from `vps_firewall_list` (or `vps_firewall_get` with that id), then check: |
| 41 | + |
| 42 | +- `firewall_group_id: null`: no group is active, so every port the OS listens on is reachable. |
| 43 | +- `is_synced: false`: rule changes are not applied yet. hPanel does not show this. |
| 44 | +- an `accept` rule with `source: "any"` on a database or cache port (3306, 5432, 6379, 27017). |
| 45 | + |
| 46 | +hPanel's Firewall page lists every group on the account with an on/off switch per server, and its rule counts run one higher than the API's. Count rules from the API. |
| 47 | + |
| 48 | +Plans: auto-renew off (`is_auto_renewed: false`, status `non_renewing`) **and** `expires_at` within 30 days. After expiry a VPS is suspended for up to 21 days with data kept, then cancelled; it can be restored from hPanel for 9 more days and is then destroyed. |
| 49 | + |
| 50 | +From outside, per server: |
| 51 | + |
| 52 | +```bash |
| 53 | +nc -z -w 3 IP 22 && echo ssh; curl -s -o /dev/null -w "%{http_code}\n" --max-time 10 http://IP/ |
| 54 | +for p in 3306 5432 6379 27017; do nc -z -w 3 IP $p && echo "open $p"; done |
| 55 | +``` |
| 56 | + |
| 57 | +Before trusting the scan, run the same check against `192.0.2.1`, a reserved address with no server. Any port that answers there is faked by the local network (a VPN or proxy; 80, 443 and 8080 are common), so check it with `curl` instead. On macOS add `-G 3` to `nc`; without it a port that drops traffic hangs for over a minute. |
| 58 | + |
| 59 | +A database port answering from outside is a finding whatever the rules say. |
| 60 | + |
| 61 | +## 3. Report |
| 62 | + |
| 63 | +``` |
| 64 | +# VPS audit |
| 65 | +4 servers (2 KVM 2, 1 KVM 4, 1 KVM 8) · Vilnius 3, Düsseldorf 1 |
| 66 | +
|
| 67 | +## Fix now |
| 68 | +- srv100 (203.0.113.10) — state error since the restart 2 days ago → Hostinger support |
| 69 | +- srv101 — Monarx counts 3 malicious files → secure-vps, file list in hPanel |
| 70 | +- srv102 — disk 96 % full → troubleshoot-vps |
| 71 | +
|
| 72 | +## Soon |
| 73 | +- srv101 — KVM 2 expires in 9 days, auto-renew off → renew in hPanel |
| 74 | +- srv103 — no firewall group; 22, 80, 443, 6379 answer from the internet → secure-vps |
| 75 | +- srv100 — no backup in the last 30 days → hPanel → Snapshots & Backups → Manage schedule |
| 76 | +
|
| 77 | +## Worth knowing |
| 78 | +- srv102 — password login only, no SSH key → secure-vps |
| 79 | +- srv103 — firewall group "web" not synced → secure-vps |
| 80 | +
|
| 81 | +## Healthy |
| 82 | +srv104 |
| 83 | +``` |
| 84 | + |
| 85 | +- **Fix now:** state `error`, `suspended`, or `stopped` without the user's knowledge; a failed or stuck action; malware counts above 0; disk above 95 %; a Docker project down; a plan already lapsed; an OpenVZ server. |
| 86 | +- **Soon:** no firewall group, or a database port open to the internet; no backup in 8 days; a plan lapsing within 30 days; disk above 85 %; CPU or memory saturated most of the day; monthly traffic near the quota. |
| 87 | +- **Worth knowing:** no SSH key; firewall group not synced; Monarx not installed. |
| 88 | + |
| 89 | +Each item names the evidence and what fixes it: `troubleshoot-vps`, `secure-vps`, `deploy-to-vps`, `provision-vps`, Hostinger support, or the hPanel page. Hand back without fixing anything. |
| 90 | + |
| 91 | +## Not available through the API |
| 92 | + |
| 93 | +What runs inside each server, whether a CPU limit is active, the backup schedule and the Monarx file list. Mention them once at the end so the user knows what the audit could not see. |
0 commit comments