On this pageThe questions it has to answer
Performance monitoring asks whether your servers are healthy. Security monitoring asks whether anyone is doing something they should not. For a handful of cloud servers you do not need a security operations center. You need a short list of signals, collected somewhere an intruder cannot erase them, and alerts that a person reads and acts on. This guide covers which signals matter, how to collect them on Linux with standard tools, when a platform such as Wazuh is worth running, and how to keep alerts useful.
The questions it has to answer
Every signal below serves one of five questions:
- Who logged in, from where, and with what credential?
- Who used administrator rights?
- What changed: accounts, keys, binaries, configuration, packages, firewall rules, listening ports?
- What is the server talking to?
- What happened in the control plane: console sign-ins, new API tokens, revealed passwords?
If a question has no answer in your setup today, that gap matters more than any tool choice.
Signals worth collecting
| Signal | Source on Linux | Alert when |
|---|---|---|
| SSH logins | journald, Accepted lines from sshd |
A login from an address you never use, or a password login where only keys should work |
| Failed logins | journald, sshd | A burst against one account, beyond the usual background noise |
| sudo and root use | journald, auditd | An account that never uses sudo suddenly does, or root logs in directly |
| Accounts and keys | auditd watches on identity files | Any change outside a planned change |
| Listening ports | A baseline of ss -tlnH |
A new listener appears |
| File integrity | AIDE | System binaries or files in /etc change unexpectedly |
| Packages | /var/log/dpkg.log, dnf history |
Installs outside a maintenance window |
| Outbound traffic | Firewall logs, ss -tnp state established |
Connections to unknown destinations, or a jump in outgoing volume |
| Web requests | Reverse proxy and WAF logs | Error spikes, or many blocks against one endpoint |
| Provider account | The provider's activity log | Sign-ins, tokens, SSH keys or firewall changes you did not make |
On Windows servers, the Security event log carries the same story: 4624 and 4625 for successful and failed logons, 4672 for logons with administrator privileges, 4720 for a new user account and 4732 for a user added to a local group.
Start on one server
Read the journal
On current distributions, sshd and sudo write to the systemd journal. Two queries cover the first two questions:
journalctl -u ssh -u sshd --since "24 hours ago" | grep -E 'Accepted|Failed'
journalctl _COMM=sudo --since today
The unit is called ssh on Debian and Ubuntu and sshd on the RHEL family, so the first command asks for both. Make sure the journal survives reboots: Storage=persistent in /etc/systemd/journald.conf, or simply an existing /var/log/journal directory.
Watch identity files with auditd
The Linux audit system records every write to the files that control who can log in and who is an administrator. Install auditd (Debian, Ubuntu) or audit (RHEL family, usually present already), then add a rules file:
sudo tee /etc/audit/rules.d/50-identity.rules >/dev/null <<'EOF'
-w /etc/passwd -p wa -k identity
-w /etc/shadow -p wa -k identity
-w /etc/group -p wa -k identity
-w /etc/sudoers -p wa -k identity
-w /etc/sudoers.d/ -p wa -k identity
-w /etc/ssh/sshd_config -p wa -k sshd
-w /root/.ssh/ -p wa -k root-keys
EOF
sudo augenrules --load
sudo ausearch -k identity --start today
Each -w line watches a path for writes and attribute changes and tags matches with a key, which is what ausearch -k searches for. Add a line for the key directory of every account that can use sudo.
Detect changed files with AIDE
AIDE stores checksums of the files you care about and reports differences. On Debian and Ubuntu:
sudo apt install aide
sudo aideinit # builds /var/lib/aide/aide.db.new and offers to install it
sudo aide --check --config /etc/aide/aide.conf # compare the system with the database
Schedule the check daily with cron or a systemd timer, unless your package already does. After every planned change, run aide --update and install the new database, or the next report drowns in expected differences. Keep a copy of the database off the server: an intruder who can rewrite it can hide their changes.
Notice new listening ports
A new listener is one of the clearest signs of an unwanted program or a misconfigured service. A small script compares the current listeners with an approved list:
sudo tee /usr/local/sbin/port-check >/dev/null <<'EOF'
#!/bin/sh
# Print listening TCP sockets that are not in the approved list.
ss -tlnH | awk '{print $4}' | sort -u > /run/ports.now
diff /etc/ports.approved /run/ports.now
EOF
sudo chmod 755 /usr/local/sbin/port-check
ss -tlnH | awk '{print $4}' | sort -u | sudo tee /etc/ports.approved
Run it every 15 minutes from cron and send any output to your alert channel. diff prints nothing while the two lists match.
Centralize before you need it
Logs that stay on a compromised server can be deleted by the intruder, so ship them elsewhere as they are written. The simplest routes are journald or rsyslog forwarding, or a lightweight agent such as Vector or Fluent Bit sending to a log store on another machine.
When you want rules, dashboards and file integrity monitoring in one place, Wazuh is the usual open-source choice. Its agents collect logs, file integrity events, system inventory and configuration checks, and a central server correlates them. The official all-in-one quickstart asks for 4 vCPU, 8 GiB of memory and 50 GB of storage for up to 25 agents, keeping 90 days of indexed data. On CloudSat, the Wazuh one-click app fits that sizing on the 4 vCPU, 8 GB Cloud VPS plan ($21.18).
Whatever you choose, keep server clocks synchronized, or events from different machines will not line up. Decide retention before an incident forces the question: 90 days searchable and a year in cheap archive storage is a reasonable starting point, adjusted to your legal obligations.
Watch the control plane too
Some of the most damaging actions never touch a server's own logs: deleting a server, adding an SSH key through the console, creating an API token, revealing a root password. Read your provider's audit trail as part of monitoring. In CloudSat, the activity log records sign-ins, API token creation, SSH key changes, firewall changes and password reveals, with who acted and from which address. Check it weekly, and immediately when an alert fires on a server.
Alerts people act on
An alert nobody reads is worse than none, because it creates false confidence. Four habits keep alerts useful:
- Split by urgency. Page someone for events that should never happen unannounced: a new administrator account, a new SSH key, a direct root login, a new listening port, a console sign-in from somewhere new, a monitoring agent that went silent. Everything else goes into a daily digest: failed login counts, package changes, top WAF blocks.
- Attach a first step. Each alert carries one line saying what to check first and who owns it. When it is real, the incident response plan takes over.
- Tune ruthlessly. An alert that fires every day for normal reasons gets ignored. Fix the cause, narrow the rule or demote it to the digest.
- Test the path. Trigger one harmless alert a month, such as a temporary listener on a spare port, and confirm it reaches a person.
FAQ
Do I need a SIEM for three servers?
No. Central logs and a handful of well-chosen alerts cover a small fleet. A SIEM or Wazuh earns its place when you have more sources than you can read by hand, or when customers ask for evidence of monitoring.
How long should security logs be kept?
Long enough to investigate an intrusion discovered late, and as long as your contracts and laws require. Weeks are rarely enough; months are a sensible minimum for authentication and audit logs.
Can an attacker delete the evidence?
On the compromised server, yes, which is why logs must leave it as they are written. Store them on a machine the production servers can send to but cannot delete from.
What about containers?
Send container output to the same log pipeline as the host, and watch the host itself, because a container escape lands there. For runtime detection inside container fleets, Falco watches system calls for suspicious behavior.
Run it on CloudSat. Cloud VPS on AMD EPYC and NVMe from $1.98/mo in 13 regions, delivered in under 5 minutes and paid in crypto. See plans or deploy a server.




