Network Security Fundamentals
OSI model, TCP vs UDP, ICMP, traceroute, port-scanning techniques and network segmentation.
21 questions
JuniorTheoryVery commonWhat does a client actually check when it validates a server certificate?
What does a client actually check when it validates a server certificate?
It builds a chain from the certificate up to a locally trusted root, verifies every signature, checks the validity dates, matches the hostname against the subject alternative name, and consults revocation status. It never checks whether the owner is honest.
Common mistakes
- ✗Forgetting that the hostname must match the subject alternative name
- ✗Treating a valid chain as a statement about the owner's honesty
- ✗Ignoring revocation status once the dates and signature check out
Follow-up questions
- →Why is a hostname mismatch a hard failure rather than a warning?
- →How does adding a private root to a device change what validation proves?
JuniorTheoryVery commonWhat conditions make a man-in-the-middle position possible, and what removes them?
What conditions make a man-in-the-middle position possible, and what removes them?
It needs traffic that is unauthenticated or downgradeable plus a path the attacker already sits on — a shared local network, a rogue gateway, a poisoned name resolution. Authenticated encryption with strict certificate validation and HSTS removes it.
Common mistakes
- ✗Treating interception as unpreventable rather than an authentication failure
- ✗Ignoring the plaintext first request that HSTS is there to remove
- ✗Assuming any network position is enough without a trust failure
Follow-up questions
- →Why do ARP and DNS spoofing count as local-network trust failures?
- →What does the transport-security header
HSTSchange on the first visit?
JuniorTheoryVery commonWhat security properties does TLS actually guarantee, and which does it not?
What security properties does TLS actually guarantee, and which does it not?
TLS protects data in transit — confidentiality, integrity, and authentication of the server through its certificate. It does not protect data at rest, does not hide who talks to whom, and gives nothing once one of the endpoints is compromised.
Common mistakes
- ✗Believing TLS protects data at rest or in backups
- ✗Reading a valid certificate as proof that the site is trustworthy
- ✗Assuming TLS still helps after an endpoint is compromised
Follow-up questions
- →Why does a valid certificate not make a site safe to trust?
- →What does an observer still see when traffic is protected by TLS?
JuniorTheoryCommonWhy is plain DNS a weak trust anchor, and what do DNSSEC and DoH/DoT each fix?
Why is plain DNS a weak trust anchor, and what do DNSSEC and DoH/DoT each fix?
Classic DNS answers are unauthenticated and unencrypted, so a resolver on the path can be fed a forged record. DNSSEC signs records so a client can verify authenticity, while DoH and DoT encrypt the query channel for confidentiality. They solve different halves and neither replaces the other.
Common mistakes
- ✗Swapping which mechanism gives authenticity and which gives confidentiality
- ✗Believing encrypted transport alone prevents a forged answer
- ✗Assuming plain DNS answers are authenticated by default
Follow-up questions
- →Why is DNS query logging valuable as a detection surface?
- →What does encrypted DNS hide from the network operator, and what not?
JuniorTheoryCommonHow does a stateful firewall differ from a stateless one, and why default-deny?
How does a stateful firewall differ from a stateless one, and why default-deny?
A stateless filter judges each packet alone against static rules, so return traffic needs its own permissive rule. A stateful firewall tracks connections and lets replies through automatically. Default-deny drops everything not explicitly allowed, so a forgotten service is closed rather than exposed.
Common mistakes
- ✗Swapping which kind tracks connection state
- ✗Reading default-deny as blocking only known-bad addresses
- ✗Confusing connection tracking with application payload inspection
Follow-up questions
- →Why does a stateless filter need an explicit rule for return traffic?
- →What operational risk does a default-allow rule set create over time?
JuniorTheoryCommonHow does the TLS handshake establish session keys, and what is forward secrecy?
How does the TLS handshake establish session keys, and what is forward secrecy?
Both sides agree a cipher suite, the server proves identity with a certificate, and an ephemeral key exchange derives the symmetric key that encrypts the session. Forward secrecy means stealing the long-term key later cannot decrypt recorded traffic.
Common mistakes
- ✗Thinking the session key is encrypted with the server's long-term key
- ✗Believing the whole session stays asymmetric after the handshake
- ✗Confusing forward secrecy with periodic key rotation
Follow-up questions
- →Why does an ephemeral key exchange protect previously recorded sessions?
- →What breaks if the server certificate is valid but the hostname differs?
JuniorDesignCommonHow do you place a classic client-server application on the network: DB, backend, and frontend?
How do you place a classic client-server application on the network: DB, backend, and frontend?
Segment by exposure. Internet-facing components (web/mobile entry, reverse proxy) go in a DMZ. The backend with business logic sits in an internal application segment, reachable only from the DMZ. The database goes in an isolated segment with no direct path from the internet — only the backend reaches it, so a breached DMZ host cannot touch the DB directly.
Common mistakes
- ✗Placing the DB in the DMZ or giving it a direct path from the internet
- ✗Using a flat network without splitting into segments
- ✗Allowing traffic between segments in both directions without restrictions
Follow-up questions
- →Why should the DB not have a direct network path from the internet?
- →How does segmentation limit lateral movement after a DMZ breach?
JuniorTheoryCommonHow does TCP differ from UDP and when do you choose each?
How does TCP differ from UDP and when do you choose each?
TCP is connection-oriented: a handshake sets it up, then it guarantees ordered, reliable delivery with retransmission and flow control — at the cost of latency. UDP is connectionless: it sends datagrams with no ordering or delivery guarantee, so it is faster and used for DNS, streaming and gaming where speed beats reliability.
Common mistakes
- ✗Attributing reliability and connection setup to UDP
- ✗Believing UDP encrypts data while TCP does not
- ✗Thinking the choice of protocol does not affect delivery semantics
Follow-up questions
- →What steps make up the TCP three-way handshake?
- →Why do DNS queries go over UDP by default?
MiddleTheoryCommonWhat does mutual TLS add for service-to-service traffic over ordinary TLS?
What does mutual TLS add for service-to-service traffic over ordinary TLS?
Ordinary TLS authenticates only the server, so the callee still has to trust a bearer token to know who called. Mutual TLS makes the client present its own certificate, binding identity to the connection itself, issued and rotated by an internal certificate authority rather than a shared secret.
Common mistakes
- ✗Thinking mutual TLS just adds a second layer of encryption
- ✗Assuming a shared API key gives the same identity guarantee
- ✗Treating everything inside the perimeter as implicitly trusted
Follow-up questions
- →Why does certificate rotation matter more once identity lives in the transport?
- →How does mutual TLS interact with a proxy that terminates the connection?
MiddleTheoryCommonWhy is perimeter trust a flawed assumption, and how does zero-trust access differ?
Why is perimeter trust a flawed assumption, and how does zero-trust access differ?
A VPN authenticates once and then drops the user onto the network, so a stolen laptop reaches everything routable — trust follows location. Zero-trust access authorises each application on identity and device posture, so a compromise yields one resource.
Common mistakes
- ✗Equating a VPN tunnel with per-request authorisation
- ✗Reading zero trust as no authentication rather than no implicit trust
- ✗Assuming a complete firewall rule set makes internal trust safe
Follow-up questions
- →What risk does split tunnelling introduce for egress inspection?
- →Why does device posture matter alongside user identity?
JuniorTheoryOccasionalHow do volumetric and application-layer denial of service differ in defence?
How do volumetric and application-layer denial of service differ in defence?
A volumetric flood saturates the link, so it must be absorbed upstream by a scrubbing provider or the transit carrier — nothing on your own server helps once the pipe is full. Application-layer floods look like valid requests, so they need rate limits, caching and per-client quotas.
Common mistakes
- ✗Thinking a host firewall can stop a flood that already fills the uplink
- ✗Applying the same control to both volumetric and application-layer floods
- ✗Assuming attack requests are always distinguishable from legitimate ones
Follow-up questions
- →Why must volumetric traffic be filtered upstream of your own link?
- →How do caching and per-client quotas reduce application-layer load?
JuniorTheoryOccasionalWhat is the ICMP protocol for, and which port do you close to block it?
What is the ICMP protocol for, and which port do you close to block it?
ICMP is a network-layer control protocol for error and diagnostic messages — Echo (ping), Destination Unreachable, Time Exceeded (used by traceroute). The trick: ICMP has no ports — it is neither TCP nor UDP, so you cannot close a port. You block it by protocol with a firewall rule (IP protocol number 1).
Common mistakes
- ✗Thinking ICMP has a port number
- ✗Considering ICMP a transport protocol over TCP/UDP
- ✗Assuming ICMP establishes a connection before exchanging data
Follow-up questions
- →How does traceroute use ICMP Time Exceeded messages?
- →Why is fully blocking ICMP dangerous for network operation?
JuniorTheoryOccasionalHow does an IDS differ from an IPS, and what does inline blocking cost you?
How does an IDS differ from an IPS, and what does inline blocking cost you?
An intrusion detection system watches a copy of the traffic and only raises alerts; an intrusion prevention system sits inline and can drop the connection. Inline blocking turns every false positive into an outage and adds latency and availability risk.
Common mistakes
- ✗Swapping which system sits inline and can drop traffic
- ✗Ignoring that a false positive on an inline device becomes an outage
- ✗Treating signature and anomaly detection as the IDS/IPS distinction
Follow-up questions
- →How do signature and anomaly detection differ in what they miss?
- →Why is an inline sensor usually run in alert-only mode first?
JuniorTheoryOccasionalWhat are the seven layers of the OSI model and what does each do?
What are the seven layers of the OSI model and what does each do?
Seven layers bottom-up: physical (bits on the medium), data link (frames, MAC, error control), network (routing, IP addresses), transport (TCP/UDP, end-to-end delivery), session (connections), presentation (encoding, encryption), application (HTTP, DNS). Each layer serves the one above it.
Common mistakes
- ✗Confusing the network (IP, routing) and data link (MAC, frames) layers
- ✗Placing encryption at the physical layer instead of the presentation layer
- ✗Considering the OSI model identical to the TCP/IP stack
Follow-up questions
- →At which layer does a packet-inspecting firewall operate?
- →How do the OSI layers map onto the TCP/IP stack?
JuniorTheoryOccasionalWhat does WPA2 or WPA3 actually protect on Wi-Fi, and why segment guest access?
What does WPA2 or WPA3 actually protect on Wi-Fi, and why segment guest access?
They authenticate the client to the access point and encrypt the radio link, so a listener nearby cannot read the frames. A shared passphrase authenticates the network, not the user, so enterprise credentials are per-user and guests get their own segment.
Common mistakes
- ✗Treating link-layer encryption as end-to-end protection
- ✗Believing a shared passphrase authenticates individual users
- ✗Putting guest devices on the same segment as internal systems
Follow-up questions
- →Why is transport security still needed on an encrypted wireless link?
- →What does per-user enterprise authentication give that a passphrase cannot?
MiddleTheoryOccasionalWhat does certificate pinning buy a client, and what does it cost in operation?
What does certificate pinning buy a client, and what does it cost in operation?
Pinning narrows trust from every public root to one specific key or issuer, so a certificate wrongly issued by any other authority is rejected. The cost is operational — a rotated or renewed key bricks every shipped client until it is updated, so teams pin a long-lived key and ship backup pins.
Common mistakes
- ✗Treating pinning as a replacement for normal certificate validation
- ✗Forgetting that a key rotation breaks every already-shipped client
- ✗Believing a pin can be refreshed from the connection it is protecting
Follow-up questions
- →Why do backup pins matter before a planned key rotation?
- →Where is pinning worth the cost, and where is it usually not?
MiddleDesignOccasionalA batch data-processing environment runs analytics jobs over customer records in a private subnet. Today every worker has an unrestricted route to the internet through a NAT gateway, ingress is closed, and the team argues that closed ingress is enough. Constraints — jobs must still pull dependencies from a package registry and write results to one managed object store; the platform team wants an incident to be visible even when a worker is fully compromised; no agent may be installed inside the job containers. How would you design egress controls for this environment, and what would you monitor to detect misuse?
A batch data-processing environment runs analytics jobs over customer records in a private subnet. Today every worker has an unrestricted route to the internet through a NAT gateway, ingress is closed, and the team argues that closed ingress is enough. Constraints — jobs must still pull dependencies from a package registry and write results to one managed object store; the platform team wants an incident to be visible even when a worker is fully compromised; no agent may be installed inside the job containers. How would you design egress controls for this environment, and what would you monitor to detect misuse?
Replace the open route with default-deny egress — reach the object store over a private endpoint, allow the registry through a proxy allowlist, drop everything else. Log denied flows and resolver DNS queries, since with egress narrow an outbound attempt is itself the alert.
Common mistakes
- ✗Believing closed ingress makes egress control unnecessary
- ✗Using a deny list of bad addresses instead of an allowlist
- ✗Leaving no logging of denied flows or DNS queries
Follow-up questions
- →How does a private endpoint to the object store differ from an allowlisted address?
- →Why is a denied egress flow a higher-quality signal than a permitted one?
MiddleTheoryOccasionalWhy is port scanning done, and how do SYN, TCP connect, and UDP scans differ in the traces a defender sees?
Why is port scanning done, and how do SYN, TCP connect, and UDP scans differ in the traces a defender sees?
Port scanning maps which services listen. A SYN (half-open) scan reads SYN-ACK as open, RST as closed and never completes the handshake, so it leaves no connection log and needs flow/IDS detection. TCP connect completes it — reliable but logged. UDP is ambiguous: silence means open or filtered, ICMP unreachable means closed.
Common mistakes
- ✗Confusing which scan completes the full handshake (connect, not SYN)
- ✗Expecting a closed UDP port to reply with RST instead of ICMP unreachable
- ✗Considering a SYN scan noisier than TCP connect
Follow-up questions
- →Why is UDP scanning slower and less reliable than TCP?
- →How do FIN and ACK scans reveal firewall rules, and how are they spotted?
MiddleTheoryOccasionalWhere does TLS termination leave plaintext, and when re-encrypt behind the edge?
Where does TLS termination leave plaintext, and when re-encrypt behind the edge?
Terminating at the edge means the balancer decrypts, so every hop behind it carries plaintext of the same sensitivity. That is acceptable only if the internal segment is genuinely isolated and monitored; otherwise re-encrypt to the backend host.
Common mistakes
- ✗Assuming traffic stays encrypted after the edge terminates the session
- ✗Ignoring that the internal segment inherits the data's sensitivity
- ✗Treating re-encryption as a protocol requirement rather than a trust decision
Follow-up questions
- →What logging or monitoring risk appears on the plaintext hop?
- →How does mutual TLS change the trust model behind the edge?
JuniorTheoryRareWhat is traceroute and how does it determine the route to a host?
What is traceroute and how does it determine the route to a host?
Traceroute maps the path packets take to a destination. It sends probes with the IP TTL starting at 1 and incrementing each round; each router that decrements TTL to zero drops the packet and returns an ICMP Time Exceeded, revealing that hop's address and round-trip time. It stops when the destination itself replies.
Common mistakes
- ✗Thinking traceroute reads routing tables directly
- ✗Not linking the TTL increment to ICMP Time Exceeded replies
- ✗Believing intermediate hops are derived from DNS rather than from replies
Follow-up questions
- →Why do some hops in the output show asterisks instead of an address?
- →How does ICMP-based traceroute differ from the UDP-based variant?
SeniorDebuggingRareA production security group is reviewed before launch — find and fix the exposure.
A production security group is reviewed before launch — find and fix the exposure.
Three rules face the whole internet that must not: management ports 22 and 3389, plus the database on 5432. Restrict administrative access to the bastion subnet, let only the application security group reach the database, keep 80 and 443 public, and replace the open egress with default-deny.
Open full question →Common mistakes
- ✗Treating a non-standard port as protection for an internet-facing service
- ✗Leaving management ports public because the accounts have strong passwords
- ✗Ignoring unrestricted egress as if it carried no risk
Follow-up questions
- →Why is a source security group a better rule source than an address range?
- →What would default-deny egress have to allow for this host to still work?