Secure Design & Hardening
The cheapest vulnerability is the one the design never allows. Build on timeless principles, then harden away the easy wins attackers count on.
Secure design principles
Decades old and still unbeaten. Most breaches are one of these, ignored. Each shows what violating it looks like.
Least privilege
Give every user, service, and process the minimum access it needs — and nothing more.
An app role with full admin turns one bug into total compromise.
Defense in depth
Stack independent layers so no single failure exposes the asset.
A flat network where one foothold reaches everything.
Fail secure
When something breaks, deny by default — never fall open.
An auth service times out and the gateway lets requests through.
Secure defaults
The out-of-the-box state is the safe state; security isn’t opt-in.
A database that ships open to the internet with no password.
Complete mediation
Check authorization on every access, every time — not just at login.
IDOR: the UI hides a record but the API serves it to anyone who asks.
Separation of duties
No single person or component can complete a sensitive action alone.
The same engineer writes, approves, and deploys to production.
Minimize attack surface
Every open port, feature, and dependency is something to defend — remove what you don’t need.
A debug endpoint left enabled in production.
Open design
Security must not depend on secrecy of the design — only on secret keys.
A “secret” hardcoded algorithm that anyone can read from the binary.
Zero trust
Never trust by location; verify identity and device on every request.
“Inside the VPN = trusted” — one phished cred owns the LAN.
Hardening fundamentals
The baseline controls that close the doors attackers walk through first. Each one maps to a breach that skipped it.
MFA on all access
Require a second factor — ideally phishing-resistant — for every human login.
Colonial Pipeline: one leaked VPN password, no MFA, fuel offline.
Patch on an SLA
Track every asset and patch by severity within a defined window.
Equifax: an unpatched Struts CVE exposed 147M people.
Segment & deny egress
Break the network into zones; default-deny outbound traffic.
Stops lateral movement and data exfil after the first foothold.
Remove the unused
Disable dormant accounts, default creds, legacy services, debug ports.
Shrinks the attack surface to what you actually run and watch.
Central immutable logs
Ship logs off-box to append-only storage you can’t edit after the fact.
Without them you can’t detect, investigate, or prove what happened.
Tested backups (3-2-1)
3 copies, 2 media, 1 offsite/offline — and actually rehearse the restore.
A backup you never restored is a guess, not a recovery plan.
Manage secrets
No secrets in code — vault them, scope them, rotate them, log access.
A key in a repo is a breach waiting for a `git clone`.
Baseline to a benchmark
Harden hosts and cloud to a known standard (CIS) and detect drift.
Consistent, auditable config instead of per-server snowflakes.
See it all on real systems
Principles and controls click when you watch them applied. Next: eight systems modeled end to end, threats and defenses in context.