All articles

BLOG / INGRESS VS EGRESS TRAFFIC

Ingress vs Egress Traffic: A Practical Guide for Web Apps

Learn the real difference between ingress vs egress traffic, why the directions matter for security and cost, and where to verify browser requests

A checkout starts failing after a traffic spike. The team sees requests arriving at the CDN, adds stricter inbound limits, and expects the problem to stop. It doesn't. A compromised worker is still sending data outward, while legitimate customers now receive blocked responses. The team has confused ingress vs egress traffic, and the control is protecting the wrong side of the boundary.

Ingress is traffic entering a defined boundary. That boundary might be a network interface, a CDN point of presence, a load balancer, a Kubernetes cluster, or an individual service. Egress is traffic leaving that same boundary. The terms describe direction from a chosen vantage point, not a permanent property of a packet.

For a web app behind a CDN, a browser request is ingress to the CDN and usually ingress to the origin when the CDN forwards it. The origin's response is egress from the origin and egress from the CDN toward the browser. At another boundary, the same response can be ingress to a client network.

This distinction affects rate limits, firewall rules, observability, cloud costs, and browser verification. A rule that only examines inbound requests won't detect a workload sending customer records to an unfamiliar host. A rule that only limits outbound traffic won't stop credential stuffing aimed at a login endpoint. Teams protecting high-value actions need both decision surfaces, with each control placed where it can see the signals it requires.

Table of Contents

What the Two Traffic Directions Actually Mean

A team labels large browser uploads as “download traffic” because users start the transaction on a webpage. The label reaches a dashboard, the wrong bandwidth category gets reviewed, and an outbound policy remains open while the exposure sits in the upload path. The mistake isn't semantic. It changes which logs, budgets, and enforcement points the team examines.

Start with the boundary

Define the boundary before defining the direction.

  • Ingress is traffic crossing into the boundary.
  • Egress is traffic crossing out of the boundary.
  • The boundary can be a device, service, cluster, region, provider, or application component.

A browser sending a signup request creates ingress at the CDN. The CDN forwarding that request creates ingress at the load balancer. The load balancer forwarding it creates ingress at the application service. The response reverses direction at each boundary.

A diagram comparing ingress versus egress network traffic with a real-world scenario of potential cost implications.

That relative viewpoint is why cloud dashboards and network devices expose separate inbound and outbound counters. AWS documents direction-specific network performance measurements, while Juniper and VMware use separate ingress and egress operational categories in their networking documentation. The practical value is comparison. A service with modest inbound traffic can still generate substantial outbound responses, replication, or third-party API calls.

Apply the terms to web actions

For a login endpoint, the username, password, and browser proof enter your application, so they're ingress at the application boundary. A response containing a session cookie leaves the application, making it egress there. If the application calls an identity provider, that call is egress from the application and ingress to the provider.

Use the boundary to choose the control. Edge verification for web applications can inspect requests before they consume origin resources, while origin controls can evaluate application state after routing and authentication context are available.

Practical rule: Never write “block ingress” or “allow egress” without naming the boundary, the source, the destination, and the asset being protected.

Confusing the terms usually produces one of two failures. The team rate-limits the wrong interface and leaves an abuse path open, or it permits outbound communication because inbound requests look clean. Direction is the first label in a policy, not the whole policy.

Why Direction Matters in Routers, CDNs, and Clusters

Network components don't maintain one universal traffic bucket. Routers, firewalls, CDNs, and cluster networking layers observe traffic from their own position and expose counters and policies for each direction. A router's inbound access rule can reject a connection entering an interface, but it doesn't automatically constrain a workload making an outbound connection.

Routers enforce from an interface viewpoint

Suppose a firewall permits HTTPS into a public load balancer. That decision says nothing about whether an application server may connect to an external analytics endpoint, object store, or payment provider. The inbound rule protects the receiving interface. An outbound policy must govern the connection leaving the server or its network segment.

This separation is useful because the threats differ. Inbound controls can address scanning, abusive login attempts, and malicious request payloads. Outbound controls can restrict destinations, reduce exfiltration paths, and expose unexpected service behavior. Combining both into a single “web traffic” rule hides those differences.

CDNs split client traffic from origin traffic

A CDN edge sees a client request arrive as ingress. When the edge fetches content from the origin, that request becomes egress from the edge and ingress to the origin. An edge rule that blocks suspicious browser traffic may protect the CDN-facing side without controlling what the edge is permitted to request upstream.

That distinction matters for cache misses, dynamic checkout pages, and API requests. You need to decide whether the edge can reach every origin path, whether the origin trusts only known edge traffic, and where browser verification runs. A controlled request rerouting layer can help place traffic on the intended path, but it doesn't replace direction-specific authorization.

Kubernetes makes the asymmetry explicit

Kubernetes Ingress is a resource for routing HTTP or HTTPS traffic into services. It isn't a general label for every inbound packet. Egress is usually managed through NetworkPolicy, often at the pod or namespace boundary. Dash0 notes that pods aren't isolated for egress by default, which means an application may reach destinations unless the team adds an outbound policy.

For pod A to call pod B successfully, the policy model can require egress permission from pod A and ingress permission at pod B. Red Hat describes these controls as directional, so allowing one side doesn't automatically authorize the other.

The operational lesson is simple. Read every control in the context of its enforcement point. A CDN rule, a load balancer ACL, a Kubernetes Ingress object, and a pod egress policy may all describe the same business request while governing different hops.

Ingress vs Egress at a Glance

Ingress and egress have different threat models, cost behavior, and evidence trails. The comparison below is a starting point, not a substitute for mapping the actual boundaries in your architecture.

Dimension Ingress Egress
Direction Traffic entering a network, service, interface, or cluster Traffic leaving a network, service, interface, or cluster
Typical web threats Credential stuffing, scanning, SQL injection, XSS, and DDoS Data exfiltration, command-and-control callbacks, unauthorized exports, and abusive response generation
Common control points CDN, WAF, load balancer, API gateway, and service ingress Host firewall, NAT gateway, cloud firewall, service mesh, NetworkPolicy, and destination allowlist
Useful telemetry WAF events, load balancer access logs, request metadata, and authentication failures Flow logs, DNS logs, NAT gateway metrics, destination records, and transfer reports
Cost behavior Incoming traffic is often free or less costly than outbound transfer, depending on the provider and path Traffic leaving cloud boundaries is commonly metered, including movement to the internet, on-premises networks, regions, or zones, as described in Oracle's cloud egress documentation
Default posture Often exposed to the public internet and controlled with filtering and rate limits Frequently open until a security, compliance, or cost review forces tighter policy
Example failure A login endpoint accepts automated attempts until application capacity is exhausted A compromised worker sends tokens or customer data to an unapproved destination

Ingress telemetry often starts with request logs. Security teams can inspect paths, methods, headers, authentication outcomes, and client patterns at the WAF or load balancer. Egress analysis needs a wider view because the application may not log every connection in the same place. DNS, flow, NAT, proxy, and provider billing records can reveal outbound behavior that application logs miss.

The default posture deserves attention. Public services must receive some ingress, but they can narrow which methods, paths, and clients proceed. Workloads often receive broad egress access just because developers need integrations to work. That convenience becomes a blind spot when an application begins contacting destinations nobody approved.

A direction label tells you where traffic crosses the boundary. It doesn't tell you whether the traffic is legitimate.

The Cost and Security Asymmetry of Egress

Egress carries two risks at once. It can become a cloud transfer cost, and it can become the channel through which an attacker removes data or maintains control. Ingress controls alone cannot address either problem.

Cloud providers commonly charge for data leaving a region, zone, on-premises network, or the internet, while ingress is generally free. Oracle describes this per-gigabyte egress model in its cloud guidance. The exact charge depends on provider, service, route, and agreement, so the safe engineering practice is to inspect the relevant transfer schedule rather than assume that all internal traffic is free.

Why architecture creates unexpected outbound volume

An application can have light user-facing traffic and still generate heavy egress. Cross-region replication, backup movement, analytics exports, image processing, and calls to third-party APIs all send bytes outside a local workload boundary. Multi-region and cross-cloud designs add more paths where traffic can leave a region or provider.

An attacker can exploit the same paths without stealing data first. They might trigger expensive responses, abuse bulk-download endpoints, or use a compromised service to send repeated requests to external destinations. The bill becomes an operational signal, but it may arrive after the workload has already consumed resources.

Treat outbound traffic as a security boundary

Outbound policy should answer three questions:

  1. Where may this workload connect? Use destination allowlists where the dependency set is stable, and make exceptions explicit.
  2. What may it send? Apply application-level authorization, secret handling, and data-loss controls to restrict sensitive payloads.
  3. Who reviews the evidence? Route flow, DNS, proxy, and transfer events to a place where security and platform teams can correlate them.
Egress Driver Cost Impact Security Impact
Cross-region replication Transfer charges can apply when data leaves a region or zone Replication credentials and datasets become reachable across another trust boundary
Backups and analytics exports Large outbound datasets can increase transfer spend Copies may reach storage or tools outside the original governance model
Third-party API calls Response and request traffic can accumulate as billable outbound transfer Tokens, identifiers, and sensitive payloads may leave the controlled environment
Bulk downloads Large responses increase delivery and cloud transfer costs Attackers may use public endpoints to move data or amplify resource use
Compromised workload callbacks Persistent outbound communication can consume network resources Command-and-control traffic can blend into ordinary HTTPS destinations

A deny-by-default outbound posture can reduce exposure, but it needs a workable exception process. Blocking every destination breaks payment, identity, email, and observability integrations. The better approach is to start with visibility, inventory legitimate dependencies, then enforce rules at the NAT, workload, service-mesh, or policy layer that owns the connection.

Where to Verify Browser Requests at the Edge vs Origin

Browser verification can sit at the edge, at the origin, or at both locations. The decision depends on the signal required and the cost of allowing a suspicious request to reach application infrastructure.

Use the edge for volume and early rejection

The edge is a strong placement for coarse filtering. It can inspect request metadata, TLS-related signals, automation indicators, and route information before a request consumes origin workers. That makes edge controls useful for public signup, login, and checkout paths exposed to automated abuse.

The trade-off is context. The edge may not know the user's account history, transaction state, entitlement, or final business decision. A rule that blocks solely on a narrow edge signal can create false positives, especially for shared networks, privacy tools, or unusual but legitimate browsers.

Use the origin for stateful decisions

The origin can combine browser verification with session validation, account history, authorization, inventory, payment state, and transaction risk. That context is valuable when the action is already authenticated or when a false positive could interrupt a legitimate purchase.

The cost is that the request has already crossed more infrastructure. Even if the origin rejects it, the CDN, load balancer, application middleware, and possibly authentication services may have processed part of the path. Origin checks also need careful failure handling so that verification outages don't turn into permissive access by default.

A diagram illustrating verification methods at the edge versus the origin server within a request flow.

A practical design uses both placements for different decisions. Apply high-volume, low-context filtering at the edge. Reserve deeper checks for the origin when the request reaches a business action that depends on session or account state. The underlying rationale is covered in why browser proof needs server state.

Placement test: Put a control as close as possible to the traffic source, unless the decision requires state that only the origin can see.

Verification must also be observable before enforcement. Run new criteria in a review or observe mode, compare decisions with legitimate request outcomes, and record which boundary made the decision. A filter that works in front of a static page may behave differently on a checkout endpoint because the request carries different cookies, headers, and session context.

How the Same Request Changes Direction Across Layers

A single HTTP call changes direction labels as it crosses components. That's why a policy written from the CDN's viewpoint may be wrong for the load balancer, even though both teams describe the traffic as “the browser request.”

A diagram illustrating HTTP request flow from a browser through a CDN and load balancer to an origin server.

Consider a browser calling api.example.com. The request is ingress at the CDN edge. The CDN then sends it out toward the regional load balancer, so it's egress from the CDN and ingress to the load balancer. The load balancer sends it to the application service, making it egress from the load balancer and ingress to the service.

The response follows the opposite direction at every hop. It's egress from the service, ingress to the load balancer, egress from the load balancer, and ingress to the CDN. The accounting and policy labels flip because the boundary changes.

Service mesh calls need two viewpoints

A frontend pod calling an authentication pod emits egress traffic from the frontend's perspective. The authentication service receives ingress traffic. Sidecars can enforce policy on both sides, but each policy must identify its own source and destination viewpoint.

Vague rules cause trouble here. “Allow traffic from the frontend” may be correct for the authentication service's ingress policy, but it doesn't prove that the frontend's egress policy permits the destination. Both sides need compatible authorization.

Webhooks reverse the familiar browser model

A payment provider sends a POST to your webhook endpoint. That call is egress from the provider, ingress at your CDN or gateway, and ingress at your webhook service after forwarding. If your webhook handler then calls a database or queue, that follow-on action is egress from the handler.

The trust decision belongs to your receiving boundary. Validate the provider's authentication scheme, restrict accepted paths and methods, protect replay-sensitive events, and isolate the handler's outbound permissions. A webhook that arrives through a trusted provider can still trigger an unsafe egress action if the handler has broad access.

Name the boundary in dashboards, runbooks, and policy reviews. “Ingress at the API gateway” is actionable. “Inbound traffic” is incomplete.

Matching Controls to High-Value Actions

Different web actions need different control placement. A landing page, an authenticated API, a webhook, and an internal service call may all use HTTP, but they don't expose the same trust boundary or carry the same consequence when abuse succeeds.

Public marketing and landing pages

The dominant traffic is ingress from many clients. The main concern is automated fetching, scraping, and volumetric pressure rather than account state. Edge filtering is usually the sensible first layer because it can reject obvious automation before requests reach origin rendering or content services.

Avoid applying expensive, session-aware checks to every static asset. Protect forms and conversion endpoints more carefully than ordinary page retrieval, and keep a fallback path for legitimate crawlers or users whose browsers produce unusual signals.

Authenticated APIs

The request carrying identity enters the API, while the API's responses and downstream calls leave it. Credential stuffing and session abuse target ingress, but the server must also control egress when the endpoint can retrieve sensitive records or call privileged services.

Use session-aware verification near the business decision. An edge signal can reduce volume, but the origin should confirm authorization, session validity, and resource ownership before changing account data, placing an order, or exposing private records.

Third-party webhooks

The provider's call is ingress to your service. The webhook handler's calls to queues, databases, or fulfillment systems are egress. Verify the incoming event, make processing idempotent, and restrict what the handler can reach outbound.

A valid webhook signature proves something about the sender, not that every downstream action is safe. Separate receipt from processing so an inbound event can't automatically inherit broad internal permissions.

Internal service-to-service calls

These calls are egress from the caller and ingress to the receiving service. Browser verification isn't the primary control. Use workload identity, mutual TLS, service authorization, and network policies that state both source and destination expectations.

Action type Dominant traffic direction Primary threat Recommended control placement
Public landing page and signup form Ingress to the edge and origin Automated fetching and signup abuse Edge filtering for volume, origin checks for signup state
Authenticated login and account API Ingress carrying identity, followed by application egress Credential abuse and unauthorized data access Edge screening plus origin session and authorization checks
Payment or checkout action Ingress to the transaction service, egress to payment dependencies Scripted transactions, replay, and unsafe downstream calls Edge screening, origin verification, and tightly scoped outbound integration policy
Third-party webhook Ingress to the webhook endpoint, then egress to internal services Forged or replayed events and overprivileged handlers Gateway authentication, handler validation, and restricted egress
Service-to-service request Egress from caller and ingress to receiver Lateral movement and confused-deputy access mTLS, workload identity, service authorization, and NetworkPolicy

The strongest design doesn't force one control across every action. It assigns a decision to the layer that has the necessary evidence, then limits the traffic in the other direction so a successful request can't obtain more access than the business action requires.

Questions to Ask Before Adding a Direction-Based Control

A new firewall rule or verification filter can look correct in a diagram and still miss actual traffic. Before deploying it, answer the following questions in writing.

Diagnose the boundary

  1. What exact asset am I protecting? Name the signup endpoint, login route, checkout operation, webhook handler, queue, or database. “The application” is too broad to test.
  2. Which boundary does the traffic cross? Identify the CDN, load balancer, cluster, pod, namespace, service mesh, NAT gateway, or provider boundary.
  3. From whose viewpoint is this ingress or egress? Write the source and destination for that specific hop, not the whole request journey.
  4. Does the request cross another policy boundary before reaching the asset? A CDN-to-origin hop, sidecar-to-service hop, or webhook-to-database call may need its own rule.
  5. Which side owns the decision? Edge infrastructure may own volume filtering, while the application owns session and transaction authorization.
  6. What happens when the control blocks a legitimate user? Define logging, fallback, support handling, and rollback before enforcement.
  7. What evidence will prove a direction mismatch? Capture enough request, flow, DNS, and decision context to distinguish an inbound abuse event from an outbound dependency failure.

The last question is often skipped. Without direction-aware logs, a blocked checkout can look like an application outage, and an outbound data transfer can look like an ordinary API call. Record the enforcement boundary and decision reason alongside the request or flow identity.

A checklist titled Pre-Deployment Diagnostic with five steps for testing network rules and traffic filtering configurations.

Test controls at the edge and origin, then test the response and any downstream calls. A browser request may pass the ingress filter but trigger an unsafe egress path. Conversely, an outbound deny rule may break a legitimate payment or identity dependency even though inbound protection appears healthy.

The safest policy review starts with a named boundary and ends with an observed decision.

For teams protecting important website actions, MANDATE provides invisible browser verification, server-side proof validation, and enforcement options that can allow, flag, or block automated abuse without CAPTCHAs. Review the request path, test decisions in Observe mode, and visit MANDATE to see how edge and application integrations can fit into your ingress controls.