
Ingress vs Egress: Meaning, Differences and Network Security Examples
Ingress and egress describe the direction of network traffic. Ingress is traffic coming into a network, a system or an application; egress is traffic going out. The distinction sounds simple, and it is — but it sits at the heart of firewall rules, cloud bills, Kubernetes networking and data-loss prevention. If you can answer “which way is this traffic going, and should it be allowed?” for every flow in your network, you have the foundation of network security.
This guide explains ingress vs egress in plain language: what each term means, how they differ, the network security examples that matter, and the rules and best practices that keep both directions under control.
What Is Ingress?
Ingress is network traffic that enters a system, a network or an application from outside. When a user opens your website, their HTTP request is ingress traffic to your web server. When a customer connects to your API, that connection is ingress. When an attacker scans your public IP addresses, that scan is ingress too.
The defining feature of ingress is the direction: the traffic originates outside the boundary and arrives inside. The boundary can be a firewall, a cloud security group, a Kubernetes cluster, or a single host. Everything that crosses that boundary inward is ingress, regardless of whether it is legitimate or malicious.
What Is Egress?
Egress is network traffic that leaves a system, a network or an application. When your web server sends a page back to the user, that is egress. When your server downloads a software update, queries an external API, or sends an email, that is egress. When malware on a compromised machine sends stolen data to an attacker’s server, that is also egress — and it is exactly the kind of egress that security teams work hardest to stop.
Egress is often the neglected half of network security. Organisations spend heavily on blocking unwanted ingress, then allow almost any outbound connection. That asymmetry is what makes data exfiltration possible: the attacker only needs one way in, but the data leaves through the wide-open egress path.
Ingress vs Egress: Key Differences
| Aspect | Ingress | Egress |
|---|---|---|
| Direction | Into the network or system | Out of the network or system |
| Initiated by | An external user or system | An internal user or system |
| Typical examples | Web requests, API calls, VPN connections, email received | Web responses, updates, DNS lookups, email sent |
| Main risk | Unauthorised access, exploitation, denial of service | Data exfiltration, malware command and control, shadow IT |
| Main controls | Firewalls, WAF, authentication, rate limiting | Egress filtering, proxy, DLP, DNS filtering |
| Cloud cost | Usually free or cheap | Usually charged per gigabyte |
| Visibility | Well monitored (it is the “front door”) | Often poorly monitored |
A helpful way to remember the difference: ingress is the front door, egress is the back door. You lock the front door against intruders, but you also need to know what is leaving through the back — because that is where your data goes.
Ingress vs Egress in Networking
In traditional networking, ingress and egress are defined at every interface. A firewall rule that allows inbound traffic on port 443 is an ingress rule; a rule that allows outbound traffic to the internet on port 443 is an egress rule. Stateful firewalls track connections so that return traffic — the server’s reply to a legitimate request — is allowed automatically, without a separate egress rule for every response.
Ingress filtering means checking incoming packets and dropping those that should not be there: packets with spoofed source addresses, traffic to closed ports, and traffic that does not match any allowed service. Egress filtering means checking outgoing packets and dropping those that should not leave: traffic to known malicious addresses, traffic on unusual ports, and traffic from systems that have no business talking to the internet at all.
Both matter for security, and both are defined by the principle of least privilege: allow only the traffic that has a business reason to exist, and deny everything else. That principle applies to every device on the path, from the perimeter firewall down to the host firewall on a single server. To understand the devices that carry this traffic, see our guide to what a network switch is and how it works.
Ingress and Egress in the Cloud
Cloud providers use the same terms, and they add a financial twist: ingress is usually free, while egress is charged. Amazon Web Services, Google Cloud and Microsoft Azure all charge for data transferred out of their clouds to the internet, and egress fees are a notorious surprise on cloud bills. Moving data between regions or out to users costs money; moving it in generally does not.
That pricing shapes architecture. Serving content from a content delivery network (CDN) reduces egress costs because the CDN caches data close to users. Keeping traffic inside one region, or inside a private network, avoids the most expensive egress paths. And a misconfigured backup that copies terabytes out of the cloud every night can cost more than the storage itself.
Cloud security groups and network ACLs also use ingress and egress rules. A security group for a web server might allow ingress on ports 80 and 443 from anywhere, allow egress only to the database and to specific update servers, and deny everything else. The same least-privilege thinking applies — but the rules are now code, and they should be reviewed like code.
Ingress in Kubernetes
In Kubernetes, “Ingress” is also the name of a specific object: a resource that manages external access to services inside a cluster. A Kubernetes Ingress defines which hostnames and paths route to which services, and an ingress controller (such as NGINX or Traefik) implements those rules. It is the front door of the cluster — the single point where outside traffic enters — and it is where TLS termination, authentication and rate limiting usually happen.
Network policies in Kubernetes control both directions: they can restrict which pods can receive traffic (ingress) and which pods can send traffic (egress). A well-designed policy allows a front-end pod to talk to a back-end pod, allows the back-end to talk to the database, and blocks everything else — including a compromised pod phoning home to an attacker’s server.
Network Security Examples: Ingress and Egress Attacks
Real attacks exploit both directions. Here are the examples security teams plan for:
- Ingress: unauthorised access. An attacker scans for an exposed database or an unpatched web server and walks in through a service that should never have been public. The fix is ingress filtering, patching, and closing unnecessary ports.
- Ingress: denial of service. A flood of traffic overwhelms a service so legitimate users cannot reach it. The fix is rate limiting, a WAF, and a CDN that absorbs the flood before it reaches your servers.
- Egress: data exfiltration. Malware, or a malicious insider, copies sensitive data out to an external server. The fix is egress filtering, data-loss prevention, and monitoring for unusual outbound volumes.
- Egress: command and control. A compromised machine contacts the attacker’s server for instructions. The fix is DNS filtering and egress rules that block connections to unknown or newly registered domains.
- Egress: DNS tunnelling. Data is smuggled out inside DNS queries, which are usually allowed through firewalls. The fix is DNS monitoring and blocking DNS traffic that does not go through the organisation’s resolvers.
The pattern is clear: ingress attacks get in, egress attacks get data out. A defence that only watches the front door will miss the second half of the attack.

How to Secure Ingress and Egress: Best Practices
- Default deny both ways. Block all traffic by default, then allow only the specific flows the business needs. Apply this to firewalls, security groups and host firewalls alike.
- Segment the network. Divide the network into zones so that traffic between zones is controlled. A compromised web server should not be able to reach the finance database. For the wider picture, see our guide to what a metropolitan area network (MAN) is, which explains how networks are organised across a city.
- Filter egress as strictly as ingress. List the external services each system needs — update servers, APIs, DNS resolvers — and block the rest. Servers that never need the internet should have no outbound route at all.
- Use a proxy for outbound traffic. Route egress through a proxy that inspects, logs and filters it. A proxy sees what a firewall cannot, including the content of web requests.
- Monitor DNS. Almost every attack uses DNS. Log DNS queries, block queries to newly registered or known-malicious domains, and alert on unusual query volumes.
- Watch for anomalies. A server that suddenly sends ten times its normal outbound volume, or a workstation that connects to a country it has never contacted, is worth investigating — even if no rule was broken.
- Prioritise traffic. Not all traffic is equal: voice and video need low latency, while backups can wait. Our guide to quality of service (QoS) explains how to prioritise network traffic so that critical flows get the bandwidth they need.
- Test the rules. Regularly test that blocked traffic is actually blocked, from both directions. A rule that looks right in a console but does not work on the wire is a false sense of security.
Ingress vs Egress: Practical Examples
| Scenario | Ingress | Egress |
|---|---|---|
| Visiting a website | Your browser’s request reaches the web server | The server sends the page back to your browser |
| Sending an email | The recipient’s mail server receives your message | Your mail server sends the message out |
| Software update | The update server receives your request | Your device downloads the update |
| Video call | Other participants’ audio and video arrive | Your audio and video leave your device |
| Cloud backup | The cloud receives your backup data | Your systems upload the backup data |
| Attack | Attacker scans and exploits a public service | Stolen data leaves, or malware calls home |
Frequently Asked Questions
What is the difference between ingress and egress?
Ingress is traffic entering a network, system or application; egress is traffic leaving it. Ingress is the front door — requests arriving from outside. Egress is the back door — responses and outbound connections leaving from inside.
Is ingress inbound and egress outbound?
Yes. Ingress means inbound traffic and egress means outbound traffic. The terms are used in networking, firewalls, cloud computing and Kubernetes, always with the same directional meaning.
What is an example of egress traffic?
A web server sending a page to a visitor, a computer downloading a software update, a server querying an external API, and an employee sending an email are all egress traffic. Malicious egress includes stolen data leaving the network and malware contacting its operator.
Why is egress filtering important?
Because most successful attacks need an egress path. Even if an attacker gets in, they still need to steal data or receive instructions, and both require outbound traffic. Egress filtering blocks those paths and makes intrusions far easier to detect.
What is ingress in Kubernetes?
In Kubernetes, Ingress is a resource that manages external access to services in a cluster, defining which hostnames and paths route to which services. An ingress controller implements those rules and usually handles TLS, authentication and rate limiting.
Is cloud egress really charged?
Yes. The major cloud providers charge for data transferred out of their clouds to the internet, while ingress is usually free. Egress fees are a significant and often underestimated part of cloud costs, especially for data-heavy applications.
Conclusion
Ingress and egress are two directions of the same traffic, and security needs both. Ingress controls decide who can reach you; egress controls decide what can leave. Most organisations are good at the first and weak at the second — and that gap is where data breaches happen. Apply default-deny rules in both directions, segment the network, filter egress through a proxy, monitor DNS, and watch for unusual outbound volumes. Do that, and you control not just who comes in, but what goes out — which is the part of network security that actually protects your data.


