01What the firewall doesn’t see
An “allow 443” rule lets through anything that uses 443, legitimate or not. An intrusion detection engine analyses flows and compares them with signatures of known attacks. Here it is the UniFi gateway’s engine, built on Suricata: no extra box, inspection happens where all traffic already passes.
02The encryption limit
Most traffic today is TLS-encrypted: without decryption, the IDS cannot read the content of a page or an API call. It works on what remains visible: addresses and domains with a bad reputation, the requested name (SNI), certificates, TLS handshake fingerprints, and protocol anomalies.
It remains very useful on clear-text protocols (DNS, HTTP, SMB internally) and against scans, but it replaces neither patching exposed services nor segmentation.
03Phase 1: detect only
Going straight to blocking risks cutting legitimate use on the strength of an over-broad signature. The first phase is therefore detection only: the gateway alerts but blocks nothing. You measure what it reports on real traffic, and only enable the signature categories that match the network’s uses.
Inspection also has a cost: gateway datasheets list an IDS / IPS throughput well below plain routing throughput. Worth checking before enabling it on a fast link.
04Sort the false positives
Each alert is qualified: real threat, expected behaviour, or a signature that doesn’t fit the context. A false positive becomes a written, justified exception, as narrow as possible (this signature, for this address), never a whole category disabled nor an alert that ends up ignored.
05Phase 2: block at the edge
Once the noise is down, the gateway switches to prevention: scans and known attempts are stopped before they get in. Signatures are kept up to date automatically by UniFi. Alerts are still reviewed: an unexpected block reported by a user shows up in the log within seconds.
06Complement and understand
Fail2Ban covers another angle, at the level of the services themselves: it bans addresses that repeatedly fail to authenticate. On Debian 12 and later, SSH logs to journald: the jail must read the systemd journal, otherwise it won’t start.
And when an alert remains obscure, a capture opened in Wireshark shows exactly what went over the wire.
# /etc/fail2ban/jail.local
# Ban an address for 1 h after 5 failures within 10 minutes
[sshd]
enabled = true
backend = systemd
maxretry = 5
findtime = 10m
bantime = 1hKey takeaways
- The firewall filters ports; the IDS analyses flows.
- On TLS, the IDS sees metadata, not content.
- Detect, measure, sort first; block afterwards.
- A false positive becomes a narrow, documented exception.
- Wireshark to understand an alert, not guess it.