Notes
1 · Least privilege
First, least privilege. Every person and every program gets only the access its job needs, and nothing more. The shop's web application can read and write orders, but it cannot drop tables. Support staff can look up one customer at a time, not export them all. Access is removed when the need ends. In episode three, one cloud role that could read every bucket turned a small break-in into a large one. Least privilege limits the blast radius.
- the web app can read and write orders: not drop tables
- support staff see one customer at a time, not an export
- a build job can push to one registry, nothing else
- access is removed when the need ends
- limits the blast radius
2 · Defense in depth
Second, defense in depth. Never rely on one wall. The shop has rate limits at the edge, a database that is not reachable from the internet, strong logins, an application that checks every input, encrypted data and alerts on unusual reads. The layers must be independent. Two locks that open with the same key are really one lock. Each layer assumes the one before it has already failed.
- edge: WAF and rate limits
- network: database is private
- identity: MFA, least privilege
- application: input checked
- data: encrypted at rest
- monitoring: alerts on odd reads
- layers must be independent: two locks, two different keys
3 · Zero trust
Third, zero trust. The old model was a castle: a hard shell and a soft inside. Once you were past the firewall or the VPN, everything trusted you, which is exactly what an attacker with one stolen laptop wants. Zero trust removes the idea of a trusted inside. Every request is checked: who are you, is your device healthy, and are you allowed to do this, right now? The slogan is never trust, always verify.
- old model: a hard shell, a soft inside. Past the VPN, everything trusts you
- zero trust: every request is checked. Who are you? Is the device healthy? Are you allowed this, right now?
- never trust, always verify
4 · Secure by default
Fourth, secure by default. The safe setting is the one you get without doing anything. A new storage bucket is private. A new account requires a second factor. A new service has no open ports until someone asks for one. Debug mode is off in production. People are busy and accept defaults, so the default has to be the safe choice, and an insecure choice should need an explicit, visible decision.
- a new bucket is private
- a new account needs MFA
- a new service has no open ports until you ask
- debug mode is off in production
- insecure choices need an explicit, visible decision
5 · Separation of duties
Fifth, separation of duties. No single person can complete a dangerous action alone. Code needs a second person's review before it merges. Whoever requests a refund cannot also approve it. Nobody can both change the audit logs and be audited by them. This stops honest mistakes and fraud, and it also means an attacker with one stolen account still cannot finish the job without a second.
- code needs a second person's review before it merges
- the person who requests a refund cannot approve it
- no one both changes the logs and is audited by them
- stops mistakes and fraud, and a single stolen account
6 · Fail safe
Sixth, fail safe, also called fail closed. When something breaks, the answer is no. If the permission check throws an error, the request is denied. If the login service cannot be reached, nobody gets in. The last rule in a firewall list denies everything not already allowed. Attackers deliberately cause errors to see what happens, so a bug should lock the door, never open it.
- permission check throws an error: deny the request
- cannot reach the login service: nobody gets in default rule at the end of a firewall list: deny all
- a bug should lock the door, not open it
7 and 8
Seventh, keep it simple. Every feature, open port and extra setting is more attack surface and more to get wrong, so remove what you do not need. Eighth, open design. Assume attackers know exactly how your system works. Its safety must rest on secret keys, never on a secret method. That is why engineers use published, widely tested cryptography, and never invent their own. Security through obscurity fails the day someone looks.
- keep it simple: every feature, port and setting is more attack surface. Remove what you do not need
- open design: assume attackers know how it works. Safety rests on keys, not secrecy
- no home-made cryptography
AAA
These principles sit on three questions, known as AAA. Authentication: who are you? Authorization: what are you allowed to do? Accounting: what did you do, recorded in logs that cannot be quietly changed. People confuse the first two all the time. Logging in is authentication. Being blocked from another customer's order is authorization. A fourth idea, non-repudiation, means there is proof of an action that its author cannot later deny, such as a digital signature.
- authentication: who are you? password, passkey, MFA
- authorization: what may you do? roles and permissions
- accounting: what did you do? logs that cannot be changed
- non-repudiation: proof you cannot later deny it
Using them
Here is how to use them. Turn each principle into a question and ask it of any design. Who can reach this, and do they all need to? If this layer fails, what stops the attacker next? What does this component trust without checking? What happens on an error? What does a new user or resource get by default? Can one account do the whole dangerous thing alone? Six questions, and you can review a system you met ten minutes ago.
- who can reach this, and do they all need to?
- if this layer fails, what stops the attacker next?
- what does it trust without checking?
- what happens on an error?
- what is the default?
- can one account do it all?
Common mistakes
Mistakes. Giving everyone admin for now, which becomes forever. Never removing access when people change roles. Trusting anything that comes from the internal network. Building layers that share one password. Writing error handling that lets the request through. Relying on a secret design instead of secret keys. And mixing up authentication with authorization, so a logged-in user can read data that belongs to someone else.
- admin for everyone, "for now"
- access that is never removed
- trusting the internal network
- layers that share one password
- errors that let requests in
- secret designs instead of keys
- mixing up authn and authz
Say it like this
In the interview: I start with least privilege to limit blast radius, and defense in depth so one failure is not a breach. Zero trust, so nothing is trusted just for being inside the network. Secure defaults, separation of duties for dangerous actions, and failing closed on errors. And I keep designs simple and open, relying on standard cryptography and protected keys rather than secrecy. Then give one example from something you built.
- "Least privilege to limit blast
- radius, defense in depth so one failure is not a breach, zero
- trust so nothing is trusted for being inside, secure defaults, separation of duties, and fail
- closed. Then simple, open
- designs with standard crypto."