Labs / Security Basics / Security foundations

Lab 5 of 5 · Security foundations

Alert verdicts: true, benign or false positive?

Triage two look-alike port-scan alerts, one from a sweep you run yourself, with the firewall log and the asset inventory.

Start this lab 4 steps

The idea

Imani is on shift in Castleford University's security operations centre (SOC), and the port-scan rule has fired against the finance server. An alert is not a verdict: it is a hypothesis that something might be an attack.

Her job is to pull the evidence behind each alert and decide what it is: a true positive to escalate, a benign positive to close, or a false positive that means the rule itself is broken. Partway through she takes the security team's scanner and runs its sweep herself, so one of the alerts is evidence she made.

The same alert, two verdicts
The same alert, two verdicts
Eight log lines, one alert, one verdict
Eight log lines, one alert, one verdict
What the rule can and cannot see
What the rule can and cannot see
Suppress the exact pattern
Suppress the exact pattern

Steps

  1. An alert is a hypothesis, not a verdict

    Every alert is a claim: this traffic looks like an attack. Checking the claim ends in one of three verdicts:

    • True positive: a real attack, caught.
    • Benign positive: real activity the rule caught correctly, but it was authorised.
    • False positive: the activity the alert claims never happened. The rule's logic or its data was wrong.

    The worst case raises nothing at all: a false negative, an attack the sensor missed.

    The sensor here is a firewall. It lets web traffic through to the finance server, drops everything else, and writes one line per dropped packet to /var/log/firewall.log.

    The SOC's port-scan rule, scan-alerts, reads that log. It raises an alert, its signature, when one source has probes dropped on three or more ports of one server.

    Run the rule, then read what the SOC already knows about its own network: the asset inventory.

    sensor:~# scan-alerts
    sensor:~# cat /etc/soc/assets.txt
  2. Alert 2201: an unknown host

    An alert line is a summary. The evidence behind it is the firewall log, one line per dropped probe, and a port scan shows up there as a burst of drops from one source to many ports.

    The log is trimmed to the fields triage needs: time, source, destination and ports. A real firewall log carries more, such as the interface and TTL. Pull alert 2201's lines by its source.

    sensor:~# grep 'SRC=10.0.7.80' /var/log/firewall.log
  3. Alert 2202: run the scanner's sweep yourself

    Take the other seat. scanner is secscan, the security team's box, and its sweep is booked for today. Run that sweep from it, then run the rule again on sensor and watch your own traffic raise an alert.

    The rule cannot see the inventory. It sees only dropped probes, so the same five-port sweep should look exactly like 2201 to it.

    scanner:~# nmap -n -Pn --max-retries 1 -T4 -p 22,80,445,3306,3389 10.0.8.10
    sensor:~# scan-alerts
  4. Same signature, opposite verdicts

    Lay the two scans side by side in the log. Both swept the finance server's database port; both are a burst of drops the sensor caught. The firewall log alone cannot tell you which one mattered.

    What separated them was the asset inventory: context Imani brought, not anything the alert contained.

    sensor:~# grep 'DPT=3306' /var/log/firewall.log

Run these steps on real machines

Keep reading

Learn it on real machines.

Every lab is a small network of real Linux machines in your browser. Sign in with Google or email to start.

Start this lab