Network Security and Defense Questions
Securing networks at the infrastructure layer. Covers firewalls, ACLs and rule design, network device hardening and secure configuration, intrusion detection and prevention systems, VPN and remote-access encryption, network protocols and their security properties, and packet-level traffic analysis. The hands-on network-defense layer, distinct from zero-trust architecture strategy.
Explain the difference between signature-based detection and anomaly-based (behavioral) detection used in IDS/IPS. Discuss typical advantages and disadvantages of each approach, expected false-positive/false-negative behaviors, data requirements (training/baselining), and when combining both approaches provides stronger defense.
Sample Answer
Signature-based detection matches traffic or behavior against a database of known-bad patterns, similar to antivirus definitions. Anomaly-based, or behavioral, detection instead first learns what "normal" looks like for an environment and then flags deviations from that baseline, which means it can catch attacks it has never seen a specific signature for.
Signature-based detection
- Advantages: a very low false-positive rate for known threats, since a match is a strong, specific indicator; fast and computationally cheap; easy to tune per signature.
- Disadvantages: blind to novel or zero-day attacks and to any variant that does not exactly match a known pattern; needs a constantly updated signature feed; evasion is relatively easy since a slight change to an attack's payload can dodge an exact-match rule.
- Data requirements: a maintained, current threat-intelligence or signature feed; no training period is needed, it works from day one.
Anomaly-based detection
- Advantages: can detect previously unseen attacks and behavioral shifts that have no signature at all, for example a legitimate account suddenly accessing systems it never has before.
- Disadvantages: prone to false positives, especially early on or in dynamic environments, since unusual-but-legitimate business activity can look anomalous; requires ongoing tuning as normal behavior genuinely drifts over time.
- Data requirements: a training or baselining period against real traffic to establish what "normal" looks like, and periodic re-baselining whenever the environment changes meaningfully.
Combining both
Signatures catch known threats cheaply and confidently, freeing an anomaly engine's alert budget, and analyst attention, to focus on genuinely unusual, novel activity that signatures cannot see. A security operations center (SOC) team typically routes signature matches as high-confidence, lower-effort tickets, since a signature hit rarely needs much investigation to confirm, while anomaly-based alerts go to a triage queue with more context attached, since those need a human judgment call on whether the activity is actually bad or just unusual. Budgeting analyst time differently for the two alert types, rather than treating every alert identically, is what makes the hybrid approach operationally sustainable rather than just theoretically better.
Worked example
A known exploit against a specific web-server vulnerability has an exact byte-pattern signature. That traffic hits the signature engine and is blocked or alerted with near-zero false-positive risk within milliseconds. Separately, an account that has only ever queried a customer database during business hours starts running large export queries at 3am. There is no signature for that, since it uses entirely legitimate credentials and a legitimate query interface. Only an anomaly engine that had baselined this account's normal access pattern, business hours and small result sets, would flag the deviation, off-hours timing and unusually large exports, as suspicious.
Trade-offs and pitfalls
Treating anomaly-based alerts with the same automatic-block posture as signature matches causes real business disruption from false positives. Relying on signatures alone leaves an organization systematically blind to exactly the class of attack, novel or targeted, that matters most against a determined adversary.
Explain the main types of VPNs (site-to-site vs remote-access) and compare IPsec-based VPNs with TLS-based VPNs (for example, OpenVPN). Discuss split-tunneling vs full-tunneling trade-offs and security implications for remote employees. As an analyst, what logs and telemetry would you collect to detect compromised VPN credentials or excessive VPN usage?
Sample Answer
VPNs (virtual private networks) come in two deployment shapes and are commonly built on two different protocol families. Site-to-site VPNs connect two networks, such as a branch office and headquarters, transparently to the users behind them; remote-access VPNs connect one individual's device into a network, requiring client software and per-user authentication. IPsec (Internet Protocol Security) operates at the network layer, encrypting IP packets directly; TLS-based VPNs like OpenVPN tunnel over a TLS/SSL connection instead.
IPsec vs TLS-based VPN
| Aspect | IPsec | TLS-based (for example, OpenVPN) |
|---|---|---|
| Layer | Network layer, encrypts IP packets directly | Runs over TLS, typically carried in TCP or UDP |
| Setup | More complex key negotiation (the IKE, or Internet Key Exchange, phases), but often hardware-accelerated and built into network gear | Simpler to get through NAT (Network Address Translation) and restrictive firewalls, since it can look like ordinary TLS traffic on a standard port |
| Typical use | Site-to-site, network-to-network tunnels | Remote-access, especially where firewall or NAT traversal is a concern |
| Performance | Can be offloaded to dedicated hardware | Software-based, generally more CPU overhead per client |
Split-tunneling vs full-tunneling
Full-tunneling routes all of a remote user's traffic, including general internet browsing, through the corporate VPN, so every byte is inspectable by corporate controls, at the cost of extra bandwidth and latency for non-corporate traffic. Split-tunneling routes only corporate-destined traffic through the tunnel and lets everything else go direct, which improves performance and reduces corporate bandwidth cost, but the security implication is real: the device now has a live path to the untrusted internet at the same time it is trusted enough to be on the corporate network. If that device is compromised through an internet-facing app, an attacker can pivot straight into corporate resources without the traffic ever crossing a corporate-monitored path.
Telemetry to detect compromised credentials or excessive usage
- Impossible travel: the same account authenticating from geographically distant locations within a short window.
- Concurrent sessions for one account from different addresses or devices.
- Off-hours logins, or session durations far outside the account's normal pattern.
- Data-volume anomalies: an account that normally transfers a small amount suddenly moving a large amount.
- Repeated authentication failures immediately followed by a success, a credential-stuffing signature.
Worked example
Account "jdoe" normally connects from Chicago on weekdays, sessions averaging 45 minutes and 200 megabytes transferred. An analyst sees a login from Chicago at 9:03am, then, 40 minutes later, a second concurrent session for the same account from an address geolocating to a different country, transferring 15 gigabytes over two hours. Impossible travel, a concurrent session, and roughly 75 times the normal data volume together are a strong compromised-credential signal, worth an immediate forced session termination and a credential and multi-factor authentication (MFA) reset, rather than waiting to see if any single indicator looks worse on its own.
Trade-offs and pitfalls
Full-tunneling's cost and latency overhead makes split-tunneling attractive, but split-tunneling needs endpoint controls to compensate, since the device itself becomes the bridge between the internet and the corporate network. And relying on IP geolocation alone for "impossible travel" produces false positives whenever a user is themselves behind a VPN or proxy service.
What is network segmentation and why is it important for security? Name at least three segmentation methods and explain how segmentation limits blast radius and supports compliance requirements such as PCI. Provide a simple example policy for isolating a development environment from production.
Sample Answer
Network segmentation means dividing a network into smaller, isolated zones so that a compromise or failure in one zone does not automatically give an attacker, or a fault, reach into every other zone. It directly limits blast radius, the scope of what is reachable or damaged starting from a single compromised host.
Segmentation methods
- VLANs (Virtual LANs): logically separate broadcast domains on shared physical switching infrastructure, for example putting user workstations, servers, and IoT devices on distinct VLANs even though they share the same switches.
- VRFs (Virtual Routing and Forwarding instances): separate routing tables on the same physical router or network, so traffic in one VRF cannot route into another without an explicit, controlled connection point, stronger isolation than VLANs alone since it separates the routing decision itself, not just the layer-2 domain.
- Host-based microsegmentation: enforcing policy per workload, for example firewall rules on the host or hypervisor itself, so even two workloads on the same subnet can be prevented from talking to each other directly.
- A demilitarized zone (DMZ): a dedicated zone for public-facing services, isolated from both the internet and the internal network by firewalls on both sides, so a compromised public-facing server has no direct path into internal systems.
Limiting blast radius and supporting compliance
If an attacker compromises one host in a segment, the segmentation boundary, a VLAN access control list, VRF isolation, a host firewall, or a DMZ firewall, is what stands between that host and the rest of the environment. Instead of "one compromised host means the whole network is at risk," it becomes "one compromised host puts that segment at risk, and reaching further requires defeating another independent control."
The Payment Card Industry Data Security Standard (PCI DSS) explicitly scopes its requirements to systems that store, process, or transmit cardholder data. Proper network segmentation isolating that cardholder-data environment from the rest of the network is the standard way to shrink audit scope: systems fully outside a properly segmented cardholder-data environment fall outside PCI scope entirely, which is a major practical reduction in audit cost and effort, not just a security benefit on paper.
A simple example policy: isolating dev from prod
Place development and production environments in separate VLANs or subnets with a default-deny firewall between them, allow only the specific, named flows required, for example a deployment pipeline pushing artifacts to production over a specific port from a specific jump host, and explicitly deny any direct path from developer workstations to the production database, even though both sit under the same company network.
Worked example
A company's flat network has development, production, and corporate laptops all on one large shared subnet. After segmentation, production database servers move to a dedicated subnet with a default-deny firewall in front of them, allowing only the application tier's specific addresses on the specific database port. Developers on the corporate VLAN can reach a separate development environment freely but have zero network route to the production subnet at all. Malware on a developer's laptop can now, at most, reach the development environment that laptop already had access to. It has no network path to even attempt a login against the production database, because that path does not exist at the network layer, regardless of what credentials the malware might have stolen.
Trade-offs and pitfalls
Segmentation adds operational complexity: more firewall rules and routing instances to manage, and more places a legitimate flow can accidentally be blocked. It is also only as strong as its boundary controls; a segmented network with one overly permissive rule between zones, or a forgotten flat management VLAN that touches everything, provides a false sense of isolation rather than a real one.
Explain the difference between an Intrusion Detection System (IDS) and an Intrusion Prevention System (IPS). In your answer describe deployment modes (inline vs passive), typical system responses to detections (alert/log vs block), performance and reliability implications (latency, fail-open/fail-closed), and give two concrete scenarios where you would prefer IDS over IPS and vice versa.
Sample Answer
An intrusion detection system (IDS) monitors traffic and raises alerts on suspicious activity without touching the traffic itself. An intrusion prevention system (IPS) sits inline and can actively block or drop traffic it judges malicious, in real time. The core difference is detection versus active enforcement.
Deployment modes
An IDS is typically deployed passively, out-of-band, receiving a copy of traffic through a network tap or a mirrored switch port, so it observes without ever being in the actual data path. An IPS is deployed inline, directly in the path of live traffic, so every packet physically passes through it before continuing on.
Response to detections
An IDS alerts and logs only; a human or a downstream system decides what to do next. An IPS can automatically block, drop, or reset the offending connection in real time, with no human in the loop for that specific decision.
Performance and reliability implications
Because an IDS is out-of-band, it adds zero latency to production traffic, and a false positive costs nothing but an unnecessary alert. Because an IPS is inline, every packet's processing adds some latency, and a false positive can actively break legitimate traffic. Being inline also forces a deliberate fail-open versus fail-closed design decision: if the IPS device itself fails or is overwhelmed, "fail open" lets traffic pass through uninspected, prioritizing availability, while "fail closed" blocks all traffic through that path, prioritizing security. This choice has to be made explicitly for each deployment rather than left to whatever the device defaults to.
Two scenarios
Prefer IDS when evaluating a brand-new detection ruleset that is not yet fully trusted. Running it in alert-only mode first lets a team see what it would have blocked and tune out false positives before ever risking dropping legitimate production traffic. Prefer IPS when protecting a public-facing service against a known, high-confidence attack signature for a critical, unpatched vulnerability, where the cost of failing to block a real attack clearly outweighs the small risk of a false-positive block, and where an automatic response matters because a human alert-and-respond loop would be too slow.
Worked example
A company rolling out a new IPS ruleset first mirrors production traffic to the device configured in alert-only mode for two weeks and reviews every alert, discovering that 30% of alerts were false positives caused by an internal vulnerability scanner's own traffic being misclassified as an attack. After tuning that source out, they cut the same ruleset over to true inline enforcement with confidence that legitimate scanner traffic will not be auto-blocked mid-scan.
Trade-offs and pitfalls
Deploying an unvetted, out-of-the-box IPS ruleset inline risks blocking legitimate traffic, a self-inflicted denial of service, and is a common real-world mistake. Deploying detection-only for a well-understood, high-confidence threat wastes the opportunity for automatic containment and relies entirely on someone reading the alert in time, which especially at 3am is not guaranteed.
Design an anycast-based scrubbing architecture to protect a global web application with a sustained 100 Gbps baseline and potential spikes. Describe points of presence (POPs), traffic steering (BGP), health checks, how scrubbing capacity scales, and how failover behaves when a POP becomes overwhelmed. Address stateful services and latency trade-offs.
Sample Answer
Direct answer
Anycast scrubbing advertises the same IP prefix from multiple geographically distributed points of presence (POPs) via the Border Gateway Protocol (BGP), so ordinary internet routing automatically steers each client to its topologically nearest POP. That same property is the defense mechanism: an attack's traffic naturally splits across every POP announcing the prefix instead of concentrating on one path, and any POP that becomes overwhelmed can withdraw its announcement so BGP reconverges traffic to the remaining POPs.
Structured elaboration
flowchart TB
C[Clients worldwide] --> POPA[POP A scrubbing]
C --> POPB[POP B scrubbing]
C --> POPC[POP C scrubbing]
POPA --> ORIGIN[Origin application]
POPB --> ORIGIN
POPC --> ORIGIN
POPB -. overloaded withdraws route .-> C
- Points of presence and traffic steering. Deploy scrubbing POPs at multiple internet exchange points, each announcing the same anycast prefix. BGP routes each client to the lowest-cost path under normal conditions, minimizing latency for clean traffic, and under attack spreads the attacker's traffic across every announcing POP, since an attacker generally can't choose which POP their own packets land on either.
- Health checks and failover. Each POP monitors its own scrubbing throughput utilization, upstream link saturation and control-plane responsiveness. When utilization crosses a threshold, the POP withdraws (or de-prefers) its BGP announcement, and convergence redistributes its traffic to neighboring POPs, at the cost of a brief black hole for sessions mid-flight and a step increase in round-trip time for clients remapped to the next-nearest POP. If the design targets a specific availability goal, say 99.99% uptime (about 52 minutes of allowed downtime a year), that number becomes a direct constraint on how fast convergence and headroom need to be, not just a marketing figure: a black hole longer than a few seconds during failover eats into that budget quickly.
- Capacity scaling. Size each POP for more than its expected steady-state share of the 100 Gbps baseline, plus enough headroom that when a neighboring POP fails over, the remaining POPs absorb the redistributed load without cascading, that is, N+1 redundancy at the POP level, not just within one POP.
- Integrating the rest of the perimeter. Anycast scrubbing is one layer, not the whole defense. A layered posture keeps a stateful perimeter firewall behind the scrubbing layer for policy enforcement that needs connection state, coordinates with the upstream internet service provider (ISP) for scrubbing that needs to happen before traffic even reaches your POPs (relevant for the largest volumetric floods, where dropping traffic close to its source matters most), and integrates with cloud-edge services such as a CDN or reverse proxy that absorb application-layer load and cache static content so the scrubbing layer only handles what actually needs to reach the origin.
- Fine-grained mitigation once an attack is identified. Two BGP-based tools sit below POP-level failover, at different granularity. Remotely-triggered black hole (RTBH) routing advertises a narrow prefix for the specific victim address with a community that tells upstream routers to drop all traffic to it; it's coarse, since it takes the destination offline entirely (a controlled denial of service instead of an uncontrolled one), but fast and simple to roll out on any router with standard BGP support. BGP FlowSpec (originally RFC 5575, since obsoleted by RFC 8955) instead distributes a match-and-action rule, for example "drop UDP traffic to this destination on source port 123" to suppress a specific reflection technique, so only the attack's actual signature is dropped while the rest of that destination's traffic keeps flowing. FlowSpec is more surgical but requires FlowSpec support on the routers in the path, which isn't universal, and upstream providers vary in whether they'll accept a customer's FlowSpec rules; it's also slower to design correctly under time pressure than "just black-hole it."
- Stateful services and latency. Anycast works cleanly for stateless or short-lived request and response traffic, but a long-lived connection, a WebSocket or a persistent API session, can break if BGP reconverges mid-session and the client's packets start arriving at a POP with no record of that connection's state. A design serving stateful traffic either needs session affinity engineered on top of anycast (routing back to the POP holding the session, or replicating session state across POPs) or has to accept that a POP failover drops those specific sessions and the client must reconnect gracefully.
Worked example
Across 5 POPs, a 100 Gbps baseline splits evenly to 20 Gbps per POP. Sizing for N+1 within the group, so that any one POP's traffic can be absorbed by the remaining four, means the 20 Gbps carried by a POP that goes fully dark is what gets redistributed, split evenly across the 4 remaining POPs:
420 Gbps=5 Gbps extra per remaining POP
so each remaining POP then carries its own 20 Gbps share plus 5 Gbps of failover load, or 25 Gbps total (equivalently, the 100 Gbps baseline spread over the 4 remaining POPs is 100 / 4 = 25 Gbps each, which is the total per remaining POP, not the increment). Each POP should therefore be provisioned for roughly 25 Gbps, not just its steady-state 20 Gbps. That 5 Gbps of otherwise-idle headroom per POP is the concrete cost of the redundancy the availability target demands.
Trade-offs and pitfalls
BGP reconvergence is not instantaneous, ranging from sub-second to tens of seconds depending on the path, so a design that assumes zero-impact failover is wrong. RTBH's simplicity comes at the cost of completing the attacker's goal for them, the target genuinely goes offline, just on your terms, so it should trigger escalation to a more surgical mitigation like FlowSpec rather than being left in place. Provisioning every POP for full N+1 headroom against the simultaneous loss of every other POP gets expensive fast as POP count grows; real deployments typically target resilience against losing one POP, not several at once.
Unlock Full Question Bank
Get access to all 49 Network Security and Defense interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.