Explainer

What is egress filtering? A plain-English guide

Learn how egress filtering controls outbound traffic, why default deny rules matter, and how to roll out allowlists without breaking apps.

By the Cloudverg engineering team · · 6 min read

What it is

Egress filtering is the practice of controlling traffic that leaves your network. Most teams focus on inbound rules: who can reach the web server or the VPN. Egress filtering asks the opposite question: what is allowed to call out? A laptop, server, container, or function can open a connection to a payment API, a package registry, a SaaS tool, or an attacker's server. The filter decides which connections are permitted.

The control can sit in several places. A firewall at the network edge can allow or deny outbound IP addresses and ports. A proxy or secure web gateway can check the domain, the user, and sometimes the application. A DNS filter can block name resolution for specific domains. Cloud controls, such as security group outbound rules or a firewall policy with domain objects, apply the same idea inside a virtual network.

The key choice is the default. A default allow policy lets everything out unless a rule blocks it. That is easy to run, but it gives little protection. A default deny policy blocks all outbound traffic and permits only what you list. That is stronger, but it needs care. The goal is not to block everything. It is to make outbound traffic intentional, visible, and easy to review.

How it works

Egress filtering matches a connection against a policy before it leaves. At the packet level, a firewall checks the source, destination IP, port, and protocol. A stateful firewall remembers the outbound connection and lets the return traffic back in. A stateless access list does not, so you must allow both directions. Many cloud security groups are stateful, while network ACLs are stateless. Check which one you are changing.

At the application level, a proxy sees more. It can allow a domain name, a URL path, a user identity, or a client certificate. That matters for SaaS, where the IP address changes and one domain may share infrastructure with other sites. DNS filtering is another layer: if a name does not resolve, the connection usually fails before it starts. It is not a full firewall, though. A direct IP connection can skip DNS.

In cloud networks, apply egress filtering close to the workload. Use outbound rules on security groups, firewall policies on subnets, and egress rules in Kubernetes NetworkPolicy for pods. A service mesh can add identity based rules for service to service calls. Keep flow logs, firewall logs, proxy logs, and DNS query logs. The logs show what normal outbound traffic looks like before you tighten the policy. Rollout usually follows a loop: log first, build an allowlist, move a pilot group to default deny, fix gaps, then expand.

The first gaps are often boring: DNS to the internal resolver, NTP for time, OS update servers, certificate revocation checks, and backup targets. Those are not exceptions to hide. They are part of the design.

Why it matters for a business

Most breaches need a way out. Malware on a server may try to download a tool, contact a command server, or upload files. Egress filtering does not stop the first infection, but it can stop that outbound step. It also gives you a record. When an alert fires, the proxy log or flow log can show which internal host talked to which external name.

The business value is control over data movement. Customer lists, source code, contracts, and financial files should leave through known paths. A default deny policy with a short allowlist makes unknown transfers stand out. It also makes shadow IT visible. If a team signs up for a new SaaS tool, the proxy log shows the domain. You can approve it, limit it, or block it with a reason.

Egress filtering helps operations too. It reduces the number of outbound paths you must monitor. It makes incident response faster because the list of allowed destinations is small enough to read. It supports change control: a new vendor integration needs a firewall or proxy change, an owner, and a review date. That is more work up front. The trade-off is fewer surprises later.

Common mistakes

The classic mistake is to turn on default deny without a discovery period. Teams block the internet on a Friday, then spend Monday fixing broken builds and payment jobs. Run in log only mode first. Collect a full business cycle, including month end, payroll, and backups. Use that data to write the first allowlist.

Another mistake is to allow by IP address only. SaaS providers move traffic across shared address ranges, and a hard coded IP can break without warning. Where the tool supports it, allow by domain name through a proxy or a firewall with domain objects. Keep a small IP exception list for endpoints that cannot use a proxy. Put an owner and expiry date on each entry.

Do not forget the boring services. Blocking DNS to the internal resolver, NTP, OS updates, or certificate checks causes strange failures that look like application bugs. Do not forget IPv6 either. A rule set that covers IPv4 only leaves a second path open. Do not rely on users to report blocks. Put the block page or alert in front of them, and route exceptions through a ticket.

A policy that no one reviews becomes stale. Old vendor rules stay open after the contract ends. Developers find a direct IP path around the proxy. Logs fill a disk and no one reads them. Give one team ownership of the egress policy, review exceptions on a schedule, and remove rules that no longer have a named owner.

How to get started

Start with an inventory. List the networks, cloud accounts, and user groups that send traffic out. For each one, find the current egress path: direct internet gateway, NAT gateway, proxy, firewall, or VPN hub. Turn on logging if it is off. You cannot write a good policy from a diagram alone.

Pick one low risk pilot, such as a test account or a small office. Set the policy to log first. Export a week of flows and group them by domain, destination, port, and process where you can. Write an allowlist for business services. Add a default deny rule after the allowlist is in place. Test DNS, time sync, updates, and backups before you widen the rollout.

Use named rules and short review cycles. Every exception needs a requester, a business reason, and a date to revisit. Put alerts on blocks so you see what breaks and what tries to bypass the policy. Include IPv6 in every rule set. Test a failover path: if the proxy is down, does the business stop, or is there a controlled bypass? Write that decision down.

If you want a second opinion before you change production firewall policy, one option among others is the Expert architecture session from Cloudverg at $450/month. It is a 90-minute call with a senior architect, a pre-read of your diagrams or bills, and a written summary with ranked recommendations. That fits teams that need a review before a big cutover. Other options include your cloud provider's support plan or a local network consultant.

Frequently asked questions

What is the difference between ingress and egress filtering?

Ingress filtering controls traffic coming into a network. Egress filtering controls traffic leaving it. Most security programs start with ingress because it protects exposed services. Egress filtering adds control over what internal hosts can reach on the outside.

Does egress filtering stop malware?

It can stop some malware from reaching the internet, but it is not a replacement for endpoint protection. A default deny policy can block a download or a command server connection. It also creates logs that help you find the affected host.

What should I allow first when I turn on egress filtering?

Allow the services that keep the network healthy: DNS to your internal resolver, NTP, OS update sources, certificate checks, and backup targets. Then add business applications by domain and port. Keep each rule named and tied to an owner so it can be reviewed later.

Monthly plan

Want help with this? Expert architecture session

$450/month

90 minutes a month · Within 5 business days

Ninety minutes a month with a senior architect on the cloud, AI or security question that is blocking you, plus a written summary.

Renews monthly. Cancel any time.
What is included

Related guides

More cloud networking guides   Cloudverg platforms

Smallest way to start

Get a senior architect on your problem this week

Ninety minutes a month on the cloud, AI or security question that is blocking you, a pre-read of your material and a written summary within two business days.

$450/month

Renews monthly. Cancel any time.