Egress Filtering: The Control That Makes Exfiltration Expensive
Egress Filtering: The Control That Makes Exfiltration Expensive The asymmetry worth correcting Inbound filtering receives most of the attention, and outbound traffic is left permissive because a strict egres
Egress Filtering: The Control That Makes Exfiltration Expensive
The asymmetry worth correcting
Inbound filtering receives most of the attention, and outbound traffic is left permissive because a strict egress policy breaks things on the day it is enabled. The asymmetry has a cost. Once an attacker has execution, an unrestricted outbound path lets them choose their own protocol, destination and timing, and data leaves over the route the application uses legitimately.
Egress filtering does not prevent exfiltration. It raises its cost, narrows the attacker's options, and creates events that a defender can detect.
What a workable policy looks like
A permissive egress rule is any destination on any port. The alternatives exist along a spectrum, and each step adds visibility without requiring a full inventory first.
Deny direct outbound access by IP address and require a named destination. The simplest version is a forward proxy or a DNS-based policy that resolves an allowed name rather than permitting a raw address.
Restrict by destination catalogue. Allow the registry, the package repository, the identity provider and the update endpoint, and require a request for anything else.
Restrict by protocol where the application allows it. A service that only needs HTTPS does not need unrestricted DNS, and a build system that pulls from a mirror does not need arbitrary SSH.
Log the denials. A blocked outbound connection is one of the few reliable signals that something in the environment is behaving unexpectedly.
Where this goes wrong
The first deployment breaks production. This happens when the policy is derived from documentation rather than from observed traffic. Recording outbound destinations for a period before enforcing the policy is what makes the cutover survivable.
The proxy becomes a single point of failure and a single point of inspection. That is an acceptable trade, provided the proxy is patched, monitored and sized for the load, and provided it is not a device that everyone has learned to bypass.
Denied traffic is logged and never reviewed. The value of the control is in the review, not in the configuration.
Defensive implications and limits
Attackers adapt. Exfiltration over an allowed destination, such as a permitted cloud storage endpoint, or over DNS, will pass an egress policy that permits those paths. Egress filtering changes the attacker's problem from choosing a path to abusing a permitted one, which is a meaningful difference and not a complete defence.
The honest framing is that this control converts an open network into an observed one. It will not stop a determined adversary, and it will surface the ordinary incidents, which is what most organisations actually face.
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.