Overview
Curated: · Written: · Reviewed:
Network Security Basics
In one line
A firewall decides which flows may cross a boundary, and segmentation, VPN scoping and identity-aware access decide what a compromised host can reach next. Reach for these when you design or review how zones, remote access and egress are allowed to talk.
Key definitions
- Stateful firewall: tracks each connection in a state table and admits return traffic that matches an established entry.
- Stateless filter: evaluates each packet alone, first match wins, with no memory of earlier packets.
- Default deny: anything without a named rule is dropped. Each rule names source identity or scoped network, destination, port, purpose, owner and expiry.
- Segmentation: limits reachability between zones so one compromise has a bounded blast radius.
- Split tunnel: only listed routes go through the VPN; everything else leaves the device directly.
- Policy decision point and enforcement point: the engine decides, and the gateway or host applies the scoped session.
Formulas and complexity
Connection-table arithmetic from the figures in the table-full scenario (assumes all 120,000 long-lived flows hold entries and each new flow takes one):
The counter that increments is table-full, by 3,928. CPU at 17% and link at 5% show that the limit is state, not throughput. Idle timeouts (7,200 s established, 45 s half-open) decide how long dead entries occupy the table.
How it works
- Packets are matched against the rule set top-down. A stateful device checks the first packet of a flow against the rules, creates a state entry, and admits matching return traffic.
- A stateless device checks every packet against the rules alone, so a misordered rule is final.
- Each service flow needs its own rule, including DNS and NTP. A rule for an IP address does not cover a hostname lookup.
- Enforcement happens at several points (cloud security group, host firewall, proxy, mesh). The effective path is the intersection of all of them.
When to use and when not to
| Control | Use when | Does not give you |
|---|---|---|
| Stateful firewall | Boundary with return traffic and connection-level policy | Inspection of malicious data inside allowed sessions |
| Stateless filter | Coarse, very high-rate filtering | Connection context or reply tracking |
| Segmentation | Zones with genuinely different blast radius | Containment if every zone can still reach every other |
| Full tunnel | Central policy and logging for all remote traffic | Latency and capacity headroom |
| Split tunnel | Capacity and latency for large fleets | Inspection of traffic that goes direct |
| Site-to-site IPsec | Two sites with known peers | Device health or user authorization |
Traps interviewers probe
- Allowing a destination IP and assuming the name works. Fix: permit DNS to the approved resolver and allow the 443 destination that the resolver returns, then test by name and by IP.
- Pushing a whole private network through the VPN. Fix: push only the routes users need and authorize per application.
- Treating a managed device or a source address as identity. Fix: require verified user or workload identity, current posture and an authorization decision for the specific action.
- Scoping a deny to one subnet or one IP family. Fix: enumerate every address the service holds, IPv4 and IPv6, and test from outside.
- Deploying default deny from the architecture diagram. Fix: observe real flows across a full cycle including batch jobs, generate rules, review them, and enforce one segment at a time.
Interview tips
Open with the boundary and the blast radius: "I would default-deny at each zone edge, scope every flow by identity and port, and verify with counters from both sides."
Follow-ups to expect: stateful versus stateless behavior; full versus split tunnel; what happens when the policy service is down (fail closed for writes, validate reads locally from the token); IPv6 parity; and drift after an emergency edit, which GitOps self-heal reverts within its reconciliation interval.
30-second outline: (1) name the zone and what it protects. (2) Default deny plus named, scoped flows. (3) Identity over IP address. (4) Enforcement points and the counters or logs that prove the path. (5) Failure behavior and the rule lifecycle with owners and expiry.
Feedback on this overview
Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.