Articles

Egress control and least access: the direction almost nobody filters

The outbound direction is rarely filtered, and that is where a compromised host escapes.

Reading: 5 minNetworking

Article cover: Egress control and least access: the direction almost nobody filters

Networks are built to filter what comes in. What goes out is usually permitted without a second question: outbound rules are written for convenience, or left unwritten, and the default becomes allow. Egress filtering — the filtering of outgoing traffic — decides whether a compromised host reaches its controller, and whether data leaves. Least access (RFC 4949’s least privilege) writes those rules: an architecture “should be designed so that each system entity is granted the minimum system resources and authorizations that the entity needs to do its work” (rfc4949.txt lines 10129–10131). Ingress filtering has been recommended practice for more than twenty-five years; that discipline turned the other way is still the exception.

Two definitions, one default, one gap

A glossary defines the pair evenly — ingress filtering is “Filtering of incoming network traffic”, egress filtering “Filtering of outgoing network traffic” (nist-sp800-41r1.txt lines 1930 and 1922). One guideline holds both inside a single default — deny by default, “To block all inbound and outbound traffic that has not been expressly permitted by firewall policy” (lines 1919–1920) — then records what is deployed: “Less stringent policies are generally used for outgoing TCP and UDP traffic because most organizations permit their users to access a wide range of external applications located on millions of external hosts” (lines 1300–1302).

              inbound                          outbound
                 |                                 |
                 v                                 v
       ingress filtering                  egress filtering
       "who may enter?"                   "who may leave,
                                           and reach what?"
                 |                                 |
         denied by default                   permitted by default
         (recommended practice)              (the usual deployment)
                 |                                 |
    the source is stopped at         the compromised host is handed
    the boundary                     its route by the network

One default, written down for both directions; a practice that applies it to one.

What an unfiltered exit is worth

An outbound path that permits everything is a control the attacker never has to defeat: the compromised host reaches out and the network consents, because the rule that would have stopped it was never written. NIST describes the same mechanism from the other side: outbound proxies are “useful for detecting systems that are making inappropriate or dangerous connections from inside the protected network” (lines 1403–1404). First, the source rule: “Organizations should only permit outbound traffic that uses the source IP addresses in use by the organization–a process that helps block traffic with spoofed addresses from leaking onto other networks” (lines 447–449).

Writing the outbound ruleset

Filtering outbound answers two questions; a ruleset that answers only one is half a control.

Which sources may leave: only the addresses the organisation actually uses.

Which destinations and services may be reached, from which source: these follow the service and the class of destination, not the host — one written per service survives re-addressing, one built from addresses does not. NIST calls address-based policy “one of the most error-prone, because the IP address associated with an undesired entity often changes over time” (lines 1227–1228).

Named exceptions are part of the design, not a failure of it: a firewall denies all ICMP “except for those types and codes specifically permitted by the organization” (line 1319).

The controlled exit

An explicit proxy collapses the outbound decision into one place that also logs. “Most proxy servers now in use are outbound proxy servers” (line 668), and an outbound HTTP proxy lets an organisation “filter dangerous content before it reaches the requesting PC” (lines 1405–1406). NIST’s current guidance asks a platform instead to “deliver a common ingress and egress security policy for application environments (e.g., VPCs, VNETs, VCNs) across clouds” (nist-sp800-215.txt lines 1437–1438).

Roll it out one segment at a time, starting where the least should be leaving: user and server segments. Expect the failure that always comes — a legitimate service nobody remembered — and answer it with a named exception rather than a widened permit; approving and expiring it is a governance subject for another area.

Limits, and the ingress analogy

Filtering stops the destination it knows, not the one it does not: an allowed port carrying encrypted traffic, or a tunnel the device cannot parse, is invisible — “if the firewall does not understand the particular tunneling mechanism used, the traffic cannot be interpreted” (lines 901–902).

The analogy transfers, limit included. Ingress filtering is recommended at every level, not only the last mile: “It’s perfectly fine, and recommended, to also perform ingress filtering at the edges of ISPs where appropriate, at the routers connecting LANs to an enterprise network, etc.” (rfc3704.txt lines 408–410), because “The closer to the actual source ingress filtering is performed, the more effective it is” (lines 629–630). Outbound, that source is your own host. The limit transfers too: filtering “does not preclude an attacker using a forged source address of another host within the permitted prefix filter range” (rfc2827.txt lines 358–360).

Where IPv6 removes the argument

With IPv4 there is usually an argument: translation at the boundary hides internal hosts, so the outbound direction does not matter. The NAT and PAT sibling covers why that claim is weak. With IPv6 there is no translation to hide behind and every internal address is routable: the egress ruleset is the whole control, not half of one.

Level and prerequisites

L4 — advanced. The reader should already be able to read a firewall policy and an access list, and should know what translation does and does not buy. The mechanics of one list — order, match, action and the implicit deny — belong to acl-order-match-action-and-default-deny; the policy and its management belong to firewall-policy-versus-acls; translation and its limits belong to nat-pat-and-its-limits-as-a-security-control. This sheet owns only the direction none of them owns.

Where to go next

References

Nodrius Field Kit — cover

Get the Nodrius Field Kit

Enter your email and we'll send you the complete Field Kit: eight technical resources in one download.

Your email address is sent to Nodrius and used to deliver the Field Kit to you by email. Marketing messages are separate and optional: the checkbox does not affect your download, and you are only added to our updates list if you tick it. Privacy Policy.

Privacy & cookies

This site does not use cookies, analytics or tracking, and it does not profile you. There is nothing technical to switch off, so Accept and Reject change nothing about how the site works: either choice lets you browse everything normally.

The only difference is what your browser remembers: two entries in local storage — your choice here, so this notice is not shown again, and a marker that the Field Kit offer has already been made — so the offer is presented once and not on every page. They contain no identifier, they are not shared with anyone, and the site sets no cookie for either.

What we do with your data
How your email address is used when you ask for a Resource, how long it is kept and which rights you have — in the Privacy Policy.
What the site stores in your browser
Two entries in local storage — your choice on this notice and whether the Field Kit offer has been shown — and no cookies, no session storage, no third-party content: in the Cookie Policy.