39.10 Detecting Data Theft (DLP)
Example first. In the 2017 Equifax breach, attackers quietly took the personal data of about 147 million people over many weeks. One reason it went unseen so long: a device that should have inspected outgoing traffic had an expired certificate, so nobody was watching the data leave. Spotting data theft is its own skill.
Why it matters
The worst part of many attacks is data leaving the company: customer records, card numbers, source code. If you can see and stop exfiltration (data being taken out), you limit the damage even after a break-in.
What it is
DLP = Data Loss Prevention. These are tools and rules that find sensitive data and stop it from leaving without permission. Exfiltration means moving data out to the attacker.
| Word | Simple meaning |
|---|---|
| Sensitive data | Data that must be protected: card numbers, Aadhaar, health records, passwords. |
| Data in motion | Data moving on the network, like an email or upload. |
| Data at rest | Stored data, like files on a laptop or in S3. |
| DNS tunnelling | Hiding stolen data inside DNS lookups to sneak it out. |
| Baseline | Normal traffic, so a big jump stands out. |
| Sign of theft | What to check |
|---|---|
| Large upload to the internet | Who, when, to where |
| Many DNS lookups to one odd domain | Possible DNS tunnelling |
| Big file copied to a USB stick | Endpoint DLP log |
| Data sent to personal cloud or email | Email and web DLP rule |
How to detect and reduce it
- Find and label your sensitive data first; you cannot guard what you have not found.
- Set DLP rules for patterns like card numbers in email or uploads.
- Baseline normal outbound traffic, then alert on big jumps.
- Watch DNS for many lookups to one strange domain.
- Log USB and personal-cloud use on laptops.
- On an alert, block the transfer and start incident response.
Worked examples
Worked example 1: A huge upload at night
- Baseline: this server sends about 50 MB out per day.
- One night it sends 20 GB to an unknown IP.
- The alert fires on the jump; you block the IP and investigate.
Worked example 2: DNS tunnelling
# count DNS lookups per domain in a log; a flood to one odd domain is a red flag
awk '{print $NF}' dns.log | sort | uniq -c | sort -rn | head
Thousands of long, random-looking names under one domain can mean data is leaving inside DNS.
Worked example 3: Card numbers in an email
- A DLP rule looks for 16-digit card-number patterns in outgoing email.
- An employee tries to email a list of card numbers to a personal address.
- The rule blocks it and alerts the security team.
Real incident: Equifax (2017)
1. What happened
Attackers used an unpatched web app bug to get in, then took personal data on about 147 million people over several weeks.
2. Why it went unseen
- A device meant to inspect outgoing traffic had an expired certificate.
- So the encrypted data leaving was not being checked.
- The theft continued quietly for weeks.
3. How to stop it
- Keep traffic-inspection tools working and up to date.
- Baseline outbound traffic and alert on big jumps.
- Patch internet-facing apps fast so attackers cannot get in to begin with.
In short
- DLP finds sensitive data and stops it leaving without permission.
- Exfiltration = data being taken out by the attacker.
- Watch for big uploads, odd DNS traffic and USB or personal-cloud use.
- Find and label sensitive data before you can guard it.