A network sensor raised no alert while a contractor's laptop copied ransomware onto a file server. Anti-malware found the infection a week later.
Systems that detect intrusions, and systems that block them
A burglar alarm announces that someone is in the house. A door that locks itself when the alarm sounds also keeps the intruder out, and it locks the owner out too when it is wrong. Intrusion detection and intrusion prevention systems are those two ideas applied to networks and computers. No background is assumed. A security professional has to know what each can see, how each recognises an attack and what its mistakes cost.
By the end of this unit you will be able to:
- Tell apart an intrusion detection system and an intrusion prevention system
- Choose between a network sensor and a host sensor for a stated need
- Tell apart signature, anomaly and protocol-based detection and name the weakness of each
- Classify an alert as a true or false positive, or a silence as a true or false negative
- Explain why tuning trades one kind of error for the other
The alarm everybody ignored
An illustrative example
A furniture showroom fits a new alarm in its warehouse. The sensors are set to their most sensitive level. The alarm sounds three or four nights a week: a banner moving in the heating, a bird, the owner's cat.
At first the manager drives in each time. After a month he silences it from his phone and goes back to sleep. One night in the third month the alarm sounds for forty minutes while a van is loaded at the back door.
The alarm did exactly what it was built to do. What had gone wrong?
Detect or prevent: the alarm and the door that locks
Intrusion detection is watching the events on a computer or a network and analysing them for signs of an attack or a breach of the rules. An intrusion detection system (IDS) does the watching and raises an alert. People decide what to do next.
Intrusion prevention is detection plus an attempt to stop what was detected. An intrusion prevention system (IPS) can drop the offending traffic, end the connection or isolate a file without waiting for a person. The two are often sold as one product and written together as IDPS, .
Raising an alert and recording the event is a passive response. Blocking is an active response.
The price of a mistake differs. When an is wrong, an analyst loses some time. When an IPS is wrong, it blocks legitimate work: an order is not placed, a clinic cannot reach its records. For that reason a new IPS is usually run in alert-only mode first. Its false alarms are found and corrected, and then blocking is switched on.
Where the sensor sits: network or host, beside the path or in it
The part of the system that watches is the sensor. Two choices decide what it can see.
| Kind | What it watches | Sees well | Blind to |
|---|---|---|---|
| Network-based (NIDS or NIPS) | Traffic on one part of a network | Attacks on many machines at once, scans, floods | The inside of traffic, and what happens on a machine itself |
| Host-based (HIDS or HIPS) | One computer: its logs, files, running programs and its traffic after | Whether an attack on that machine succeeded, and changes to its files | Other machines. An intruder with administrator rights may switch it off |
The second choice is the sensor's position. A sensor out of band receives a copy of the traffic. The copy comes from a span port, a port on a set to repeat everything the switch carries. It can also come from a network tap, a device fitted into a cable. The sensor cannot stop a it sees, because the original has already gone on. If the sensor fails, traffic is unaffected. This is how an IDS is normally placed.
A sensor in line sits in the path, so all traffic passes through it. It can block. If it fails or is overloaded, traffic is slowed or cut. An IPS must be in line.
A sensor beside the path alerts; one in it blocks
Read this figure as text
The same traffic reaches the same servers in both panels. What differs is where the sensor sits: beside the path, out of band, or in it, in line.
- Out of band: traffic from the internet flows to a switch.
- The switch forwards the original traffic to the servers, so the packet has already gone on when the sensor sees it.
- A span port on the switch, or a network tap fitted into the cable, sends a copy to the intrusion detection system. This is how an IDS is normally placed.
- The IDS can raise an alert to an analyst, but it cannot stop a packet. If it fails, traffic is unaffected.
- In line: all traffic from the internet passes through the intrusion prevention system, which is drawn as a checkpoint because it can stop traffic.
- The IPS forwards only clean traffic to the servers and can drop a bad packet. If it fails or is overloaded, traffic is slowed or cut. An IPS must be in line.
Three ways to recognise an attack
| Method | How it decides | Strong at | Weak at |
|---|---|---|---|
| Signature-based, also called knowledge-based or pattern matching | Compares activity with stored patterns of known attacks | Known attacks, with few false alarms | New attacks and altered versions of old ones. Needs constant updates |
| Anomaly-based, also called behaviour-based or statistical | Compares activity with a learned profile of what is normal | Attacks never seen before | Many false alarms. Needs a learning period and a fresh profile after every real change |
| Stateful protocol analysis | Compares the use of a protocol with published rules for its proper use | Misuse of a protocol, such as commands sent in the wrong order | Attacks that follow the rules. Heavy use of computing power |
A signature is a pattern that corresponds to a known threat, such as a particular file name in an email attachment. A signature for one file name does not match the same attack under another name.
A zero-day attack uses a weakness that defenders did not know about. No signature exists for it, so only the other methods have a chance.
The profile of normal activity used by anomaly detection is a baseline. It is built by watching for days or weeks. An intruder already at work during that period is learned as normal.
Heuristic detection uses rules of thumb to score how suspicious something looks, without needing an exact match. It catches variants of known attacks. Heuristic detection is a form of behaviour-based detection.
Four outcomes of every judgement
Each time a sensor examines an event there are two facts: whether an attack is really happening, and whether the sensor raised an alert. That gives four outcomes.
| What the sensor did | An attack is happening | No attack is happening |
|---|---|---|
| Alert raised | True positive: a correct alarm | False positive: a false alarm |
| No alert | False negative: a missed attack | True negative: a correct silence |
A false positive costs time, and on an IPS it blocks real work. Enough of them and people stop reading the alerts at all, which is called alert fatigue. A false negative is the more dangerous error. The attack goes ahead and nobody knows.
Positive or negative says what the sensor did. True or false says whether it was right. A false negative is silence when there should have been an alarm.
Tuning trades one error for the other
Tuning is adjusting a detection system to improve its accuracy. It cannot remove both kinds of error. A more sensitive sensor misses fewer attacks and raises more false alarms. A less sensitive one does the reverse. Many organisations choose fewer missed attacks and pay for it in analysts' time.
- Switch off signatures for products the organisation does not run.
- Raise or lower thresholds, such as the number of failed sign-ins that counts as an attack.
- List known harmless sources, such as the organisation's own security scanner, so that they stop raising alerts.
- Rebuild the after a real change, such as a new office or a new application.
Some gaps cannot be tuned away. A network sensor sees an encrypted connection but not its contents. Covering that needs a host sensor, or an inspection point where traffic is decrypted. A patient attacker who works slowly may stay under every threshold.
Common misconception
“An IPS is a better IDS, so blocking should always be switched on.”
Blocking turns every false alarm into an interruption of real work, and an in-line device that fails can cut the network. Detection alone is the right choice where an interruption would cost more than a delayed response.
Worked example: Four alerts on a Monday morning
An analyst at a mail-order company reviews what the network IDS did overnight and compares it with what is later established to have happened.
- The IDS alerted on a flood of sign-in attempts against the web shop from one address. The attempts were real. True positive.
- The IDS alerted on the nightly backup, which moves a large amount of data at 02:00. The backup is harmless. False positive.
- The IDS raised nothing when a member of staff's stolen password was used to sign in and download the customer list. It was a real attack. False negative.
- The IDS raised nothing about the thousands of ordinary customer visits. Nothing was wrong. True negatives.
- Tuning follows. The backup server is listed as a known source at 02:00. A new rule reports any single account that downloads more than 500 customer records in an hour.
The false positive is removed without making the sensor less alert elsewhere. The false negative is answered with a behaviour rule, because a valid password matches no attack signature.
A question, worked through
A hospital put an in-line network IPS into blocking mode a week ago. It has stopped several real attacks. It has also twice cut the link between the pharmacy system and a drug wholesaler, because the ordering messages resemble a known attack pattern, and deliveries were delayed. The chief information officer wants the device switched off.
What is the BEST recommendation for the security manager to make?
Decide on your answer, then open the reasoning
- The device is doing two things: stopping real attacks and, through one signature, blocking one legitimate flow. The question asks for the best way to keep the first and end the second.
- Rule out c. Switching off removes protection that has been shown to work, to cure a fault in one rule.
- Rule out d. Making every signature less sensitive reduces false alarms everywhere and raises the number of missed attacks everywhere.
- Option b ends the interruptions, but it also ends all blocking. The real attacks of last week would have got through.
- Option a deals with the cause. The one signature is adjusted, or the known wholesaler traffic is excepted, and blocking continues for everything else. It is the best answer.
Answer: A. Tune the signature that misfires and keep the device blocking
Choosing between good answers
- The requirement is to stop attacks as they happen
- choose an IPS in line. When the requirement is to observe without any risk to traffic, choose an IDS on a copy of the traffic.
- The attack is new, or uses a valid account
- choose anomaly or behaviour-based detection. A signature has nothing to match.
- Traffic is encrypted from end to end
- a network sensor cannot inspect it. Choose a host-based sensor.
- A question asks which error is more serious
- choose the false negative: an attack that raised no alert.
- A detection system raises too many false alarms
- choose tuning. Do not choose to switch it off or to ignore the alerts.
Check your understanding
4 questions on this unit, easiest first. Confirm an answer to see the reasoning for it, then the right answer, the other options and the rule to reuse. Your answers are kept in this browser and feed readiness and review.
These questions are drafts that no named reviewer has approved yet.
Question 1 of 4
What to remember
- An IDS detects and alerts. An IPS also blocks, so it must sit in line and its false alarms interrupt real work.
- A network sensor sees many machines but not inside encrypted traffic. A host sensor sees one machine in depth.
- Signature detection finds known attacks. Anomaly detection finds new ones and raises more false alarms.
- A false positive is a false alarm. A false negative is a missed attack and is the more dangerous.
- Tuning improves accuracy by trading one kind of error against the other. It cannot remove both.
Say it from memory
How does an intrusion detection and prevention system recognise an attack, and what are the four outcomes of its judgement?
By signatures of known attacks, by anomalies against a learned profile of normal, or by checking that a protocol is used properly. True positive: attack and alert. False positive: alert, no attack. False negative: attack, no alert. True negative: neither.
What is the difference between an IDS and an IPS, and where does each sit?
An IDS detects and alerts. It normally works on a copy of the traffic from a span port or tap and cannot block. An IPS sits in line, so traffic passes through it and it can block. Its false positives stop legitimate traffic. Both come in network and host forms.
What is the difference between a passive and an active response, and why is a new IPS first run in alert-only mode?
A passive response raises an alert and records the event. An active response blocks. A wrong IPS blocks legitimate work, so a new one runs in alert-only mode first. Its false alarms are found and corrected, and then blocking is switched on.
Which detection error is more dangerous, and what is alert fatigue?
A false negative is more dangerous: the attack goes ahead and nobody knows. Alert fatigue is what happens after enough false positives: people stop reading the alerts at all.
What does tuning trade, and which gaps cannot be tuned away?
A more sensitive sensor misses fewer attacks and raises more false alarms; a less sensitive one does the reverse. A network sensor cannot see inside an encrypted connection, which needs a host sensor or a decryption point. A patient attacker who works slowly may stay under every threshold.
Sources
- NIST SP 800-94: Guide to Intrusion Detection and Prevention Systems (IDPS), NISTThe definitions of intrusion detection and prevention, network-based and host-based sensors, inline and passive deployment with spanning ports and taps, signature-based, anomaly-based and stateful protocol analysis detection, false positives and negatives, and tuning.
- Zero day attack (NIST CSRC Glossary), National Institute of Standards and TechnologyA zero-day attack as one that exploits a previously unknown hardware, firmware or software vulnerability.