Certified Information Systems Security Professional (CISSP)
IDS vs IPS: signature vs anomaly-based detection (CISSP)
NIST SP 800-94 defines intrusion detection as monitoring events and analyzing them for signs of possible incidents, and intrusion prevention as also attempting to stop them. Signature-based detection compares known-threat patterns with observed events. Anomaly-based detection compares activity with a learned profile of normal behavior. Stateful protocol analysis compares it with vendor-developed profiles of benign protocol use.
Signature-based vs anomaly-based detection
A signature is a pattern that corresponds to a known threat. Signature-based detection is the simplest method: it compares the current unit of activity, such as a packet or a log entry, with a list of signatures. It is very effective against known threats and largely ineffective against previously unknown threats, disguised threats and many variants of known threats. NIST's example is malware renamed from freepics.exe to freepics2.exe, which a signature for the first name does not match.
Anomaly-based detection builds profiles of the normal behavior of users, hosts, network connections or applications over a training period, then flags significant deviations. Its major benefit is that it can be very effective at detecting previously unknown threats.
Its cost is false positives. Benign activity that deviates from the profile raises alerts, such as a monthly maintenance job with large file transfers that never ran during training. A static profile becomes inaccurate as systems change and must be regenerated periodically. A dynamic profile adjusts constantly, but an attacker can raise malicious activity slowly enough for it to be absorbed into the profile.
What is stateful protocol analysis?
Stateful protocol analysis compares observed events with predetermined profiles of generally accepted benign protocol activity for each protocol state. Unlike anomaly-based detection, the profiles are universal and developed by the vendor, not learned from one host or network.
Stateful means the system tracks the state of the protocol and pairs requests with responses. In an FTP session, a user in the unauthenticated state should issue only a few commands. Issuing most other commands before authenticating is treated as suspicious.
IDS, IPS and the four IDPS types
SP 800-94 treats detection and prevention together as intrusion detection and prevention systems (IDPS). False positives and false negatives cannot both be eliminated, since reducing one increases the other. Many organizations choose to reduce false negatives at the cost of more false positives. Altering the configuration to improve detection accuracy is called tuning.
The four types are network-based, wireless, network behavior analysis and host-based. A wireless IDPS analyzes the wireless protocols themselves and cannot identify suspicious activity in the higher-layer protocols the wireless traffic carries. Network behavior analysis examines traffic to identify threats that generate unusual flows, such as distributed denial of service attacks and certain malware.
Where the exam catches people
Believing signature-based detection catches a renamed variant of known malware: a small change to the matched pattern defeats the signature.
Believing an alert on a rare but legitimate maintenance job is a false negative: it is an anomaly-based false positive.
Believing stateful protocol analysis learns each network's normal traffic: it uses vendor-developed universal profiles, and learned profiles are anomaly-based.
Believing tuning removes both false positives and false negatives: lowering one raises the other.
Believing a dynamic profile is always safer than a static one: it avoids going stale but can be trained by slow, gradual malicious activity.