Egress filtering: controlling what can leave your network
Most networks filter inbound traffic carefully and let everything out. How default-deny egress, DNS forced through your resolvers, and proxy-only web access cut off command-and-control and data theft, with firewall and cloud examples.
Diagram
From allow-all to default-deny outbound
Step 1 of 4
Inventory
Find what servers actually need to reach.
$ zeek-cut id.orig_h id.resp_h id.resp_p < conn.log | awk '$1 ~ /^10\.20\./' | sort | uniq -c | sort -rn | head 8812 10.20.0.11 10.20.0.2 53 2240 10.20.0.11 52.94.0.10 443
The example on the open step is one illustration, or the fix you can paste into an application you own.
What this page is made of
3 pieces. Each one says what fails, who is affected, what you would notice, and what you change.
Servers that browse
- What fails
- Servers rarely need arbitrary internet access.
- Who is affected
- Data on servers if they are compromised.
- What you would notice
- Server outbound traffic to many unknown destinations.
- What you change
- Default-deny for server subnets, with explicit allows.
DNS bypass
- What fails
- Hosts using external resolvers skip your filtering and logs.
- Who is affected
- Visibility and filtering.
- What you would notice
- Port 53 or 853 to outside addresses.
- What you change
- Allow DNS only to internal resolvers.
Cloud egress
- What fails
- Cloud workloads often have open outbound by default.
- Who is affected
- Cloud data.
- What you would notice
- Security groups with 0.0.0.0/0 outbound.
- What you change
- Use NAT with firewall policy or egress proxies for workloads.
Workstations
For user devices, route web traffic through a proxy or secure web gateway that logs and filters by category, and block direct outbound on unusual ports. Users notice nothing, and malware loses easy paths out.
Check yourself
Recognition and the fix. Nothing here is a procedure.
A database server tries to reach an unknown IP on port 4444 and is denied. Why is this a strong alert?
Sibling techniques
Pages at the same depth, plus a lab and a glossary card for this one.