SDSystem DesignConcepts to case studies
System DesignDSA
x
0/311
Part 1: Foundations
Part 2: APIs and Communication
Part 3: Caching
Part 4: Data and Storage
Part 5: Architecture
Part 6: Distributed Systems
Part 7: Advanced Data Topics
Part 8: Operations and Security
  • SSL/TLS
  • Encryption at Rest
  • Secrets Management
  • Password Management
  • RBAC
  • SAML
  • OWASP Top 10 and Common Attacks
  • DDoS Attacks and Defenses
  • Web Application Firewall (WAF)
  • Certificates and PKI
  • Multi-Factor Authentication (MFA)
  • Zero Trust
  • Key Management (KMS)
  • Data Privacy and GDPR Basics
Part 9: Estimation and Interview Method
Part 10: Case Studies
System Design/Operations and Security/Advanced Security

Zero Trust

Never trust a request because of where it comes from. Verify every user, device and call, every time.

⏱ 13 min readAdvancedInterview FavouriteHas visualizer
SummaryConceptReal-Life ExampleWhy?Where?How It WorksStepsKey TermsPros & ConsMistakesReal WorldRead NextInterview Q&ACheat-Sheet

01Quick Summary

Zero trust is a security approach with one rule: never trust a request because of where it comes from. Always verify. Being on the office network or the company VPN is not proof of anything.

  • Old model (perimeter): a strong wall around the network. Inside the wall, almost everything is trusted.
  • Zero trust: every user, device and service call is checked each time: who is it, is the device healthy, is this allowed right now?
  • Assume breach: design as if an attacker is already inside, so one stolen laptop cannot become a whole-company breach.

02Concept: What is it?

For many years companies built a castle and moat: firewalls and a VPN make a hard outside, and a soft inside. Once you are in (a laptop on the office network, or a VPN login), you can reach many systems. The weakness is plain: one phished password or one infected laptop gives an attacker the same freedom, and they can move from machine to machine. This is called lateral movement.

Zero trust removes the idea of a trusted inside. Every request is treated as if it came from the open internet. Each one must show a strong identity (with MFA), come from a healthy, known device, and be allowed by a policy for that exact resource. Access is the least that is needed, often for a short time only. Everything is logged.

It is not one product. It is a set of habits and building blocks: identity, device checks, a policy engine, small network segments, encrypted service-to-service calls, short-lived credentials and good logs. Google's BeyondCorp is a well-known early example of moving staff access off the VPN and onto per-request checks.

Perimeter vs zero trust
Perimeter
🧱One strong wallfirewall + VPN
πŸ›‹οΈSoft insideeverything trusts everything
Zero trust
πŸͺͺCheck every requestidentity + device + context
πŸ”’Small allowed pathsleast privilege
The question changes from 'are you inside?' to 'are you allowed this, right now?'
🧠Zero trust is not "trust no one"
It means trust is earned on each request from evidence (identity, device, behaviour), instead of being given once for the whole network. People still get their work done, usually with fewer VPN steps.

03Real-Life Example

🍡The Office Badge vs the Hotel Key Card
In an old office, the guard checks your badge once at the front door. After that you can walk into the server room, the finance office and the archive. In a hotel, your key card opens only your room, only for your stay, and each door records the attempt. Zero trust makes company systems work like the hotel: every door checks, and a lost card opens one room, not the whole building.
Hotel
Zero trust
Key card opens only your room
Least privilege: access to one app, not the whole network
Card stops working at checkout
Short-lived credentials and just-in-time access
Desk checks your ID when you get a card
Strong identity and MFA
Doors log every attempt
Audit logs and continuous monitoring
Locked doors between floors
Micro-segmentation
Staff checks a card is not reported stolen
Device health and continuous evaluation
A stolen card opens one room
Assume breach: limited blast radius

04Why Do We Need It?

πŸ•΅οΈAttackers get in anyway
Phishing, stolen laptops and leaked passwords are common. Design for the day one of them works.
🧭No more inside
Staff work from home, from cafΓ©s and from cloud apps. The office network is no longer the place where work happens.
πŸ’₯Smaller blast radius
If each service can only reach what it needs, one breach stays small.
☁️Cloud and microservices
Hundreds of services call each other. A single wall around them does not protect any of those calls.
πŸ“œClear evidence
Every request is checked and logged, which helps with investigations and audits.
πŸ§‘β€πŸ’»Better user access
Apps can be used safely without a full VPN, using identity and device checks instead.
Zero trust accepts that a breach will happen, and makes sure it cannot spread.

05Where Do We Use It?

πŸ§‘β€πŸ’ΌStaff access
Apps are reached through an identity-aware proxy that checks the user and device on every request, not through a flat VPN.
πŸ•ΈοΈService-to-service calls
Microservices prove who they are with mTLS and short-lived certificates, often through a service mesh.
☁️Cloud accounts
Least-privilege roles, temporary credentials and separate accounts for separate duties.
🧰Admin and break-glass access
Just-in-time elevation with approval and a full audit trail, instead of permanent admin rights.
πŸ—„οΈData stores
Databases accept only named services, not any machine on the network.
🏭Remote and partner access
Contractors get one app for a limited time, not a network login.

06Types / Parts / How It Works

The three core principles

PrincipleIn plain wordsExample
Verify explicitlyUse every signal: identity, device health, location, behaviour, the resource asked forSign-in with MFA from a patched, managed laptop
Use least privilegeGive the smallest access, for the shortest timeA support agent can read one customer record for 30 minutes
Assume breachPlan as if the attacker is already in. Limit spread and log everythingSegment networks, encrypt internal traffic, alert on odd access

The building blocks

How a request is decided
πŸ§‘β€πŸ’»User + deviceidentity, MFA, health
→↓request
πŸšͺPolicy enforcement pointproxy or sidecar
→↓ask
🧠Policy engineallow or deny
→↓if allowed
πŸ—„οΈResource
A policy enforcement point asks a policy engine, which looks at the signals.
BlockWhat it doesRelated topic
Strong identity + MFAProves who the user or service isMulti-Factor Authentication (MFA), Single Sign-On (SSO)
Device postureChecks the device is managed, patched and not compromisedOften an endpoint management tool
Policy engineDecides allow or deny from the signalsRBAC, attribute-based rules
Micro-segmentationSplits the network into tiny zones with strict rules between themFirewalls and VPN
mTLS between servicesBoth sides show a certificate, so calls are authenticated and encryptedmTLS and Request Signing (HMAC), Service Mesh
Short-lived credentialsTokens and certificates that expire in minutes or hoursSecrets Management
Logging and analyticsRecords each decision and spots strange patternsAudit Logs
Who is asking Where it is enforced Where it is decided
VisualizerHow far can one stolen machine go?An attacker lands on the Intranet wiki. In the perimeter model, count how many services they reach. Then turn on segmentation, per-request authentication and a device check one by one, or switch to zero trust, and watch the count fall.
Security model
The attacker starts on the Intranet wiki (red outline). Green dot = reached.
πŸ“š
Intranet wiki
foothold
🌐
Web app
reached
🧩
Orders API
reached
πŸ’³
Payments API
reached
πŸ—„οΈ
Customer DB
reached
πŸ“
File server
reached
πŸ—οΈ
Build server
reached
πŸ”
Key service
reached
Cyan = web tier Β· Pink = app tier Β· Amber = data Β· Blue = admin. Red dot = attacker can reach it, green dot = safe.
Services reached
7 / 7
lateral movement
Crown jewels hit
3 / 3
DB, payments, keys
Controls on
0 / 3
The attacker reached 7 of 7 other services, including 3 of the 3 crown jewels (customer DB, payments, key service). Inside the wall everything trusted everything, so one stolen laptop became a whole-company breach.

A simplified, fixed model of eight services. The rules are the same every time (no random numbers). Real zero trust is a long programme of identity, device, policy and logging work, not three switches.

07How to Use It / Steps / Implementation

Moving toward zero trust, step by step

  1. 1
    Know what you protect
    List your users, devices, apps, services and data. You cannot set rules for things you cannot see.
  2. 2
    Fix identity first
    One identity provider, single sign-on and MFA for everyone. Phishing-resistant methods for admins.
  3. 3
    Know your devices
    Inventory managed devices and check their health before access.
  4. 4
    Protect one important app
    Put it behind an identity-aware proxy. Measure what breaks. Learn before you spread.
  5. 5
    Segment the network
    Start with the crown jewels (databases, key services). Allow only the paths that are really needed.
  6. 6
    Authenticate service calls
    Use mTLS and short-lived certificates between services, for example through a service mesh.
  7. 7
    Shorten every credential
    Replace long-lived keys with tokens that expire, and use just-in-time admin access.
  8. 8
    Log and watch
    Send every decision to a central place. Alert on strange patterns. Review rules often.
πŸ’‘Start in report-only mode
Run new policies in monitor mode first. See what would be blocked, fix the legitimate cases, then switch on enforcement.
⚠️Keep a way back in
If the policy engine or identity provider is down, nobody can log in. Plan for high availability and a tested emergency (break-glass) path.

08Key Terms to Know

TermMeaning in easy words
Zero trustNever trust by network location. Verify each request
Perimeter securityA strong outer wall with trust inside it
Lateral movementAn attacker moving from one machine to others inside a network
Blast radiusHow much damage one breach can cause
Micro-segmentationTiny network zones with strict rules between them
Least privilegeOnly the access that is needed, no more
Just-in-time accessAccess that is granted for a short time, when needed
Policy engine (PDP)The part that decides allow or deny
Policy enforcement point (PEP)The gate that applies the decision, such as a proxy
Device postureA measure of how healthy and trusted a device is
Identity-aware proxyA gateway that checks identity and device before it lets a request through
BeyondCorpGoogle's zero trust model for staff access
Break-glass accountAn emergency account with strong controls and full logging

09Pros, Cons and Trade-offs

βœ… Pros
  • Limits the damage of a stolen password or device
  • Works for remote staff and cloud services
  • Every access is logged and explainable
  • Reduces dependence on one big VPN
  • Fits microservices and service meshes
⚠️ Cons
  • Takes a long time to roll out
  • Needs good identity, device and inventory data
  • The policy engine becomes a critical dependency
  • More rules to write and to debug
  • Can annoy users if checks are clumsy

Trade-offs

ChoiceWe gainWe lose
Check every requestStronger security, better evidenceExtra latency and a new dependency
Short-lived credentialsA stolen one is soon uselessMore renewal traffic and tooling
Fine-grained segmentsSmall blast radiusMore rules to manage
Device checksBlocks unhealthy devicesFriction for personal or unmanaged devices
Big-bang rolloutFast on paperOutages and angry users. Go app by app.

10Common Problems and Mistakes

Common mistakes

  1. Buying a product and calling it done. Zero trust is a way of working, not one tool.
  2. Skipping identity. Without strong identity and MFA, the rest has nothing to stand on.
  3. Trust after the first check. Checking only at login, and never again, is just a new perimeter.
  4. Policy engine as a single point of failure. If it is down, everything is down. Make it highly available.
  5. Over-broad rules. "Allow all from the corporate segment" brings the old flat network back.
  6. Ignoring service accounts. Long-lived keys for machines are an easy target. Give them short-lived identities too.
  7. No logs review. Decisions are recorded but nobody looks. Alert on anomalies.

Things to watch

πŸ§‘β€πŸ€β€πŸ§‘User friction
Too many prompts make people find workarounds. Use risk-based checks.
🧱Legacy systems
Old apps cannot do modern identity. Put a proxy in front, and plan to replace them.
⏱️Latency
A policy call on every request adds time. Cache decisions briefly and keep the engine close.
πŸ†˜Outage plan
Test the break-glass path before you need it.

11Real-World Examples

πŸ”Google BeyondCorp
Moved staff access from the corporate network to per-request checks of user and device. The best-known origin of the idea.
☁️Cloud identity-aware proxies
Cloud providers and security vendors offer proxies that check user and device before an app is reached.
πŸ•ΈοΈService meshes
Istio and Linkerd give every service a short-lived certificate and enforce mTLS and call rules.
☸️Kubernetes network policies
Pods may only talk to the pods they are allowed to, a form of micro-segmentation.
πŸ›οΈGovernment guidance
Public bodies such as the US government and NIST publish zero trust architecture guidance for agencies.
πŸ”Passkeys and hardware keys
Phishing-resistant sign-in is used to strengthen the identity part.
Mini case: stolen laptop
Perimeter
πŸ’»Laptop stolenVPN already connected
↓flat network
πŸ’₯DB, keys, files reached
Zero trust
πŸ’»Laptop stolendevice flagged, session revoked
↓each hop checked
πŸ›‘οΈStopped at the first door
The same break-in, two outcomes.

12Related Topics to Read Next

Firewalls and VPN→

The perimeter tools that zero trust adds to, and sometimes replaces.

mTLS and Request Signing (HMAC)β†’

How services prove who they are to each other.

Service Mesh→

A common way to roll out mTLS and call rules.

RBAC→

A simple way to decide what each role may do.

Single Sign-On (SSO)β†’

One strong identity for many apps.

Multi-Factor Authentication (MFA)β†’

The first proof that a person is who they say.

Audit Logs→

The record of every decision, needed to trust the system.

Secrets Management→

Short-lived credentials for machines and services.

13Interview Questions with Short Answers

14Quick Revision Cheat-Sheet

  • βœ”Rule: never trust by location, always verify.
  • βœ”Principles: verify explicitly, least privilege, assume breach.
  • βœ”Enemy: lateral movement after one foothold.
  • βœ”Blocks: identity + MFA, device posture, policy engine, segmentation, mTLS.
  • βœ”Credentials: short-lived and scoped, not permanent keys.
  • βœ”Rollout: identity first, one app at a time, monitor mode before enforce.
  • βœ”Watch: policy engine availability, user friction, legacy apps.
  • βœ”One line: β€œThe hotel key card, not the office badge.”
← Previous
Multi-Factor Authentication (MFA)
Next β†’
Key Management (KMS)