Join our Newsletter — 33% off our NHI Course
Home› Guides› Ingress and Egress for Beginners: Traffic In, Traffic…
Guide Network Security

Ingress and Egress for Beginners: Traffic In, Traffic Out and Why Both Need Rules

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 2 December 2026 10 min read
On this page

Ingress is network traffic coming into a system, and egress is traffic going out of it.

This guide is for anyone who has met these two words in a cloud or network setting and wants a plain answer. You do not need to build networks to be affected: the apps your business uses send and receive data in both directions every day.

In short

  • Ingress means "in" and egress means "out". Each direction needs its own rules.
  • Many systems allow all outgoing traffic unless someone sets a rule to limit it.
  • Rules on the way in keep unwanted visitors out. Rules on the way out limit where data and stolen secrets can go.
  • In cloud systems, a front door service called an ingress controller decides how outside traffic reaches apps.

What you will learn

  • Explain ingress and egress in one sentence each.
  • Spot a rule that lets traffic go anywhere.
  • Ask whether a system has rules in both directions.
Traffic coming in (ingress)
connections and data arriving at a system from somewhere else.
Traffic going out (egress)
connections and data leaving a system for somewhere else.
Traffic rule (firewall rule)
a setting that allows or blocks traffic by where it comes from, where it goes and which way it moves.

What are ingress and egress?

Think of an office building. The reception desk checks visitors coming in. A guard at the loading bay checks boxes going out. Ingress is the reception desk. Egress is the loading bay.

On a network, traffic means the messages computers send each other. Ingress is traffic arriving at your system, such as a customer opening your website. Egress is traffic leaving it, such as your app sending a file to a supplier.

Each direction can have its own rules. A rule might say "let in web visitors" or "only let this app talk to the payment service".

Where the comparison stops working: a guard can see a box being carried out. Data leaving a network can look like normal traffic, so an outgoing rule has to say in advance where traffic may go.

Why does it matter?

Most people think about keeping intruders out. The way out matters too. If an attacker gets in, they usually need to send data or stolen secrets back out.

If you run a small business

What could happen: a stolen file leaves your network quietly, because nothing limits where outgoing traffic can go.

Check this: ask your IT supplier whether outgoing traffic is limited, or only incoming.

Next: Egress Filtering for Beginners

If you are new to cloud work

What could happen: you open a server to "anyone, anywhere" to test something, and forget to close it.

Check this: read both the inbound and outbound rules before you change either.

Next: Cloud Security Groups for Beginners

If your team uses AI agents or automation

What could happen: a tricked agent sends data or its own secret keys to a website it should never contact.

Check this: list the places each agent truly needs to reach.

Next: Non-Human Identities for Beginners

What does it look like?

Example only. All values are made up.

# traffic rules for a booking app (made up)
INBOUND  allow  web visitors      port 443   from anywhere          (1)
INBOUND  allow  admin access      port 22    from anywhere          (2)
OUTBOUND allow  all traffic       all ports  to anywhere            (3)
OUTBOUND allow  payment service   port 443   to pay.example.com     (4)
  1. Lets customers reach the website. This is the job of the app.
  2. In a real file, this line would let anyone on the internet try to reach the admin door.
  3. Lets the app send anything to anywhere. This rule makes line 4 pointless.
  4. A narrow rule: one place, one purpose.

Why this is risky: the admin door faces the whole internet, and the "all traffic out" rule means stolen data can go anywhere.

The safer way: admin access only from a known place, and outgoing traffic only to the services the app needs.

How does it work?

  1. Traffic always has a direction. A rule for traffic coming in is an inbound rule. A rule for traffic going out is an outbound rule. In the cloud, an inbound rule names where traffic may come from. An outbound rule names where it may go[1].
  2. Defaults are often open on the way out. In one large cloud, the default rules allow all outgoing traffic[2]. Kubernetes is a popular system for running apps. In it, all traffic in and out is allowed until a rule says otherwise[3].
  3. Replies are usually allowed back. Some firewalls remember each conversation. The answer to an allowed request can then come back without its own rule[1].
  4. Cloud apps often have a front door. In Kubernetes, a setting called "Ingress" sends web traffic to the right app. It does nothing on its own. A separate program, an ingress controller, does the work[4]. The project now suggests a newer option called Gateway, and has stopped adding to Ingress[4].
  5. Outgoing rules limit what an intruder can take. Stealing data from a network is a known stage of an attack. It is called exfiltration[5].
Diagram titled Ingress and egress: two directions, two sets of rules. In the middle is a box labelled Your app. On the left, an arrow labelled Ingress, traffic coming in, runs from Internet visitors through a checkpoint labelled Inbound rules: who may come in, and on which door, to the app. On the right, an arrow labelled Egress, traffic going out, runs from the app through a checkpoint labelled Outbound rules: where the app may send data, to two destinations. One, Payment service, is marked allowed in green. The other, Unknown website, is marked blocked. A note says many systems allow all outgoing traffic until someone adds a rule.
Figure 1. Ingress rules guard the way in. Egress rules limit where the app can send data.

A worked example

Juno Yeboah looks after IT for a small online bookshop. The shop's app runs on a cloud server. A friend asks her a simple question: "Who can reach your server, and where can it send data?"

Juno opens the server's traffic rules. The inbound side looks fine. Web visitors can reach the shop. But the admin door is open to the whole internet, from a test last spring.

The outbound side has one rule: everything, to anywhere. She had never looked at it. It was the default.

She writes down what the app really needs. It talks to the payment service, the email service and the software update server. Nothing else.

Juno changes the admin rule so it only accepts connections from the office address. She asks her cloud supplier's support pages how to add outbound rules, then allows only the three services on her list. Before she switches, she saves a copy of the old rules so she can roll back.

The next morning an order email fails. The email service uses a second address she had missed. She adds it and records why.

A week later she checks the logs. The app has tried to reach no places outside her list in the records available to her. If a stolen key is ever used inside the app, the outbound rules should make it harder to send data out.

Myths and mistakes

What people thinkWhat is true
A firewall only needs to stop things coming in.Rules for traffic going out limit where stolen data and secrets can be sent.
Outgoing traffic is blocked unless I allow it.Many defaults allow all outgoing traffic. Check, do not assume.
Ingress means the Kubernetes Ingress object.Ingress is the general word for traffic coming in. The Kubernetes object is one way to handle it.
A temporary "open to anyone" rule is fine.Temporary rules are easy to forget. Give each one an owner and an end date.
Locking down outgoing traffic will break everything.Start by listing what each app needs. Then add rules in small steps and watch the logs.

What can I do this week?

  • Ask whoever runs your systems to show you both the inbound and outbound rules.
  • Look for any rule that says "anyone" or "anywhere", and ask why it is there.
  • List the outside services one important app needs to reach.
  • Close admin doors that face the whole internet, or limit them to known places.
  • Note an owner and a date beside every temporary rule.

Checklist

  • I can explain ingress and egress in plain words.
  • Our systems have inbound rules that allow only what is needed.
  • Someone has checked the outbound rules, not just the inbound ones.
  • No admin access is open to the whole internet without a recorded reason.
  • Each important app has a written list of places it needs to reach.
  • Temporary rules have an owner and an end date.
  • Rule changes are saved, so they can be rolled back.

Common questions

How do I remember which is which?

Ingress is "in" and egress is "exit": both start like the word they mean. In cloud settings you will often see "inbound" and "outbound" used for the same ideas, so treat the two pairs of words as the same.

Is egress the same as egress filtering?

No. Egress is the outgoing traffic itself. Egress filtering is the practice of limiting it with rules, so systems can only reach approved places. Our egress filtering beginner guide covers that practice in more depth than this page does.

What is an ingress controller?

It is a program that handles web traffic coming into a Kubernetes cluster and sends it to the right app. Because it sits at the edge, facing outside visitors, it needs updates and careful settings like any other front door service.

Why would anyone block outgoing traffic?

To limit damage. If malware or an attacker gets inside, they usually need to send data out or contact their own servers. Outgoing rules make that harder. They also limit where a misused app or AI agent can send secrets.

Do I need different rules for apps and for people?

Often, yes. A person's laptop may need to visit many websites. A server app usually needs only a few fixed services. That makes apps a good place to start with tight outgoing rules.

Where next?

Ready for the detail? Read the practitioner guide: Kubernetes Network Policy Guide. It goes further into writing ingress and egress rules for apps, default-deny settings and testing rules before they go live.

Also useful:

Related NHI Mgmt Group resources: Network Ports and Protocols for Beginners, Data Exfiltration for Beginners and Non-Human Identities for Beginners.

Key terms

Ingress
Network traffic coming into a system from somewhere else.
Egress
Network traffic leaving a system for somewhere else.
Firewall rule
A setting that allows or blocks traffic by source, destination, port and direction.
Security group
A set of cloud firewall rules that controls traffic in and out of a server.
Ingress controller
A Kubernetes program that manages how outside traffic reaches apps in the cluster.
Egress filtering
Limiting which outbound connections a system or workload may make.
Data egress
The movement of information out of a controlled environment to somewhere else.

Sources and further reading

  1. Amazon Web Services, "Control traffic to your AWS resources using security groups", Amazon VPC User Guide. https://docs.aws.amazon.com/vpc/latest/userguide/vpc-security-groups.html (accessed 2 Dec 2026).
  2. Amazon Web Services, "Default security groups for your VPCs", Amazon VPC User Guide. https://docs.aws.amazon.com/vpc/latest/userguide/default-security-group.html (accessed 2 Dec 2026).
  3. The Kubernetes Authors, "Network Policies", Kubernetes Documentation. https://kubernetes.io/docs/concepts/services-networking/network-policies/ (accessed 2 Dec 2026).
  4. The Kubernetes Authors, "Ingress", Kubernetes Documentation. https://kubernetes.io/docs/concepts/services-networking/ingress/ (accessed 2 Dec 2026).
  5. MITRE, "Exfiltration (TA0010)", MITRE ATT&CK. https://attack.mitre.org/tactics/TA0010/ (accessed 2 Dec 2026).

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick both boxes to continue.