open atlas
↑ Back to track
Security Foundations SECF · 04 · 04

DNS security and zero-trust networking

DNS resolves trust before TLS ever proves it, which makes the lookup an attack surface most teams forget. This lesson covers cache poisoning, DNSSEC and DoH, and why the industry traded the network perimeter for per-request identity.

SECF Senior ◷ 18 min
Level
FoundationsJuniorMiddleSenior

Your service makes one outbound call: https://payments.internal/charge. You pinned the TLS cert, you rotated the key, you enabled HSTS. You feel safe. But before any of that runs, your resolver asks “what IP is payments.internal?” over UDP port 53 — a plaintext request, no authentication, no integrity check, that any on-path device or a poisoned cache can answer with an attacker’s address. TLS then dutifully establishes an encrypted, authenticated channel to that host. The crypto worked perfectly; it just protected a conversation with the wrong server. DNS is the trust decision that happens before your security stack wakes up, and for most of the internet’s history it was unauthenticated by design.

By the end of this lesson you’ll know why DNS is an attack surface that sits underneath TLS, what DNSSEC and DoH actually protect (and don’t), and why the industry abandoned the network perimeter for a zero-trust model built on per-request identity.

DNS is a trust decision, not a lookup

Treat DNS as plumbing and you’ll defend the wrong layer. The name-to-address resolution is the moment your system chooses who to trust, and classic DNS makes that choice over an unauthenticated, plaintext UDP exchange. Two failure modes dominate in production.

Cache poisoning. A resolver that caches answers can be tricked into caching a forged one. The 2008 Kaminsky attack made this brutal: by spraying forged responses for many random subdomains, an attacker only needs to win one race against the legitimate reply, and because the early DNS protocol had just a 16-bit transaction ID (65,536 values) and a known source port, that race was winnable in seconds on a fast link. The poisoned record then serves every downstream client until the TTL expires. The patch — randomizing the source port to add ~16 more bits of entropy — turned a seconds-long attack into a statistically impractical one, but it was a mitigation, not a fix: nothing in the protocol authenticated the answer.

On-path and the resolver’s privilege. Anyone between you and your resolver — a malicious Wi-Fi AP, a compromised router, a hostile ISP — can read every name you look up (a privacy leak) and rewrite the answer (an integrity attack). Your resolver is one of the most privileged hosts in your stack: it silently decides the destination of every connection you make.

DNSSEC and DoH protect different things

These two get conflated constantly, and conflating them produces a false sense of safety. They solve orthogonal problems.

DNSSEC signs DNS records with public-key cryptography, building a chain of trust from the root zone down to the answer. It guarantees integrity and authenticity: the record you got is the record the zone owner published, unmodified. It does not encrypt anything — a DNSSEC query and its signed reply are still visible on the wire — and it solves cache poisoning at the root, since a forged answer fails signature validation. Its cost is real: deployment is operationally heavy (key rollovers, chain-of-trust breakage takes a zone offline), and adoption has stalled for years well under half of zones, so you usually can’t rely on it end-to-end.

DoH / DoT (DNS over HTTPS / over TLS) wrap the query in an encrypted transport. They guarantee confidentiality and transport integrity against an on-path observer: the coffee-shop attacker can no longer see or rewrite your lookups. They do not authenticate the record itself — your resolver could still return a poisoned or censored answer; you’ve simply moved your trust to whoever runs the resolver. DoH’s tunnelling DNS inside ordinary HTTPS (port 443) is also why it’s contentious: it bypasses the network-level DNS monitoring that enterprises and parental filters rely on.

MechanismProtectsDoes NOT protectReal cost / catch
DNSSECIntegrity + authenticity of the record (kills cache poisoning)Confidentiality — query and answer are still in cleartextHeavy ops (key rollover, chain breakage); <50% zone adoption
DoH / DoTConfidentiality vs on-path; transport integrityAuthenticity of the record — resolver can still lieTrust shifts to the resolver operator; DoH bypasses network filtering
Source-port randomizationRaises poisoning difficulty (~+16 bits entropy)Anything an authenticated channel would — it’s a probability taxMitigation, not a fix; assumes a non-on-path attacker

The senior reading: DNSSEC + an encrypted transport is the complete answer — sign the record so it can’t be forged, encrypt the query so it can’t be read or rewritten in flight. Either alone leaves a real gap. And neither answers the deeper question this lesson is really about: even with a perfectly resolved, perfectly encrypted connection to the right host, should this caller be allowed to reach it at all? That’s where the perimeter model breaks.

Why the perimeter died: zero-trust

The classic model was a castle: a hard network perimeter (firewall, VPN) around a soft, trusted interior. Get inside the VPN and you were “on the corporate network,” which implicitly meant trusted — flat east-west access to internal services. That model has a single catastrophic failure mode: once an attacker is inside, they own everything. A phished laptop, a compromised contractor VPN credential, one exploited edge device, and the flat interior becomes a free-roaming lateral-movement playground. The 2020 SolarWinds intrusion is the canonical example — trusted internal position turned one supply-chain foothold into wide reach.

Zero-trust, codified in NIST SP 800-207, inverts the assumption: never trust, always verify. There is no trusted network. The location of a request — inside the VPN or on hotel Wi-Fi — confers zero implicit authorization. Every single request to a resource is authenticated and authorized on its own merits, evaluated against the identity of the user and the device, not the IP it came from. Trust is never granted by network position and is continuously re-evaluated, not handed out once at login.

Why this works

Why does “the network is the perimeter” stop working specifically now? Two structural shifts. First, the perimeter dissolved: SaaS, public-cloud workloads, and remote work mean your users and your services are no longer inside any single network you control — there’s nothing left to draw a wall around. Second, the assumption that “inside = safe” was always a latent bug; it just used to be survivable. As breaches got bigger and lateral movement became the dominant post-compromise tactic, the cost of the implicit-trust assumption finally exceeded the cost of authenticating every request. Zero-trust isn’t a new product you buy — it’s removing an assumption you can no longer afford.

What zero-trust looks like in practice: BeyondCorp and the IAP

Google’s BeyondCorp is the reference implementation, born from the 2009 Aurora attack that walked straight through their perimeter. The keystone component is the identity-aware proxy (IAP): instead of a VPN that drops you onto the network, every request to an internal app passes through a proxy that, per request, checks the authenticated user identity, the device’s posture (is it managed, patched, healthy?), and an authorization policy for that specific resource — then allows or denies. There is no network to be “on.” An engineer reaches an internal dashboard from a café exactly the way they reach it from the office: through the proxy, proving who they are and what device they’re on, every time.

This collapses the attack surface in a way the VPN never could. A stolen session or a phished credential no longer yields the network; it yields, at most, the narrow set of resources that one identity-plus-device is authorized for, re-checked on every request — and device posture can revoke access the moment a machine falls out of compliance. The TLS 1.3 handshake (RFC 8446) that authenticates each of these connections is the cryptographic floor zero-trust stands on: mutual identity, forward secrecy, and a faster handshake make per-request verification cheap enough to do everywhere.

Pick the best fit

A remote engineer needs access to an internal admin dashboard. Your VPN-based access has just had a credential phished. Pick the design that follows zero-trust.

Quiz

You enable DoH (DNS over HTTPS) for all clients and assume DNS spoofing is now solved. What's still exposed?

Quiz

In a zero-trust architecture (NIST SP 800-207), an engineer is connected to the corporate VPN. What does that fact grant them?

Order the steps

Order what happens in a zero-trust (IAP) request to an internal app, from the client's call to the allow/deny decision:

  1. 1 Client requests the internal app; the request hits the identity-aware proxy (no VPN, no trusted network)
  2. 2 Proxy authenticates the user identity (SSO / mutual TLS)
  3. 3 Proxy checks device posture — is it managed, patched, healthy?
  4. 4 Proxy evaluates the authorization policy for this specific resource
  5. 5 Allow or deny — re-evaluated on the next request, not cached as 'trusted'
Recall before you leave
  1. 01
    Why is DNS an attack surface that sits underneath TLS, and what do DNSSEC and DoH each protect?
  2. 02
    What does zero-trust (NIST SP 800-207) replace, and how does an identity-aware proxy enforce it?
Recap

DNS is the trust decision that runs before your security stack wakes up: classic resolution happens over unauthenticated plaintext UDP/53, so cache poisoning (Kaminsky) or an on-path attacker can redirect you to a malicious host that your perfectly configured TLS then connects to flawlessly — protecting a conversation with the wrong server. DNSSEC and DoH fix orthogonal halves: DNSSEC signs records for integrity and authenticity (killing poisoning, but leaving queries in cleartext and stuck under 50% adoption), while DoH/DoT encrypt the query for confidentiality against on-path observers (but can’t stop a lying resolver) — so the complete answer is both. Above resolution sits the deeper shift: the network perimeter died because SaaS, cloud, and remote work dissolved the wall, and “inside = trusted” turned every foothold into flat lateral movement. Zero-trust (NIST SP 800-207) removes network location as a trust signal entirely — never trust, always verify — and BeyondCorp’s identity-aware proxy enforces it by authenticating user identity, device posture, and a per-resource policy on every single request, riding on TLS 1.3. Now when you see a system that grants access because a request came “from inside the VPN,” your first question is: what’s actually being authenticated here — the identity and device, or just the IP?

Practice

Start at the top. Tasks go easiest → hardest: recall a fact, apply it to a case, then a senior-level stretch. Open one, attempt it, then reveal.

recallapplystretch0 of 7 done

Something unclear?

Ask a question about this lesson. Questions are anonymous and go straight to the author to make the lesson better.

Apply this

Put this lesson to work on a real build.

shortcuts expand
search
K
prev piece
k
next piece
j
cycle tier
t
this menu
?
sources2
expand
  1. 01
  2. 02

Trademarks belong to their respective owners. Editorial reference only.