What are the principles of security
When we think of security, it is easy to picture one clever piece of encryption. But however sturdy a lock is, it is useless if the door is left wide open. A truly safe house is not made with a single lock. Safety comes from a set of design promises: who gets which key, what stops an intruder when one layer is breached, whether unknown guests are let in or kept out, and whether the structure is simple or complex. The encryption, authentication, firewalls, and human habits from earlier lessons only show their full strength when they sit on top of these promises. And these promises outlive changes in technology.
Only as much as needed: least privilege
In the lessons on operating systems, we saw access being divided up and taken back for each program and user. Let's widen that idea into security design. When you grant someone access, give only as much as their task truly needs. There is no reason to give the power to change things to someone who only needs to look for a moment.
And when the task is done, take that access back. The less access an account holds, the smaller the range that damage can spread to if the account is stolen or a mistake happens. The advice to use an ordinary account day to day and bring out administrator rights only when needed comes from the same principle.
Pick the access to give one person. Giving only what is needed keeps the risk range small; giving too much makes the potential loss large.
Giving only what was needed was the cleanest. Excess access may look convenient day to day, but the moment something goes wrong, it makes the damage bigger. Least privilege does not apply only to people. It applies the same way to programs and machines: this part does only this job, this program sees only this folder. The fence of access is drawn tight.
But however well access is divided, the day comes when that one layer is breached. That is why the next principle is needed.
Even if one fails: defense in depth
No defense can be guaranteed never to be breached. So instead of betting everything on one layer, several blocking layers are stacked. If the outer door opens, there is an inner door; if the inner door opens, there is a safe.
Even if one layer fails, the layer behind it holds. Where an attacker once only had to break through one spot, now they have to break through every layer, and the more layers there are, the harder it is to reach the end. This area showed the same thing: a second verification step on top of the password, a firewall in front of that, encryption on the contents in transit, and, at the very front, the habits of a person who checks.
Break through the layers one by one. Even if one opens, the next one blocks, so reaching the end means getting through every layer.
Opening one layer was not the end; the next layer blocked the way again. There is one trick to using several layers: make each layer different in kind. If every layer were the same lock, the way to open one would be the way to open them all.
So the more varied the layers, the stronger they are. But to have several layers, you need a clear rule for where to let things in and where to start blocking. The starting point for that rule is the next principle.
Block what you do not know: deny by default
When designing a door, there are two possible starting points. One is to let everything in at first and block only the bad things; the other is to block everything at first and let in only what is allowed. As we saw in the firewall lesson, starting by blocking is the safer of the two.
If you start by letting everything in, you can only block the bad things if you know every one of them, and no such list can be made. Dangers you never thought of come straight in. If you start by blocking, only what you clearly allowed passes, and anything unknown is blocked automatically. If it is not on the list, it does not get in.
Compare the two starting points. Letting everything in and blocking only the bad lets unknown dangers leak in; blocking everything and letting in only what is allowed blocks the unknown automatically.
On the let-everything-in side, an unexpected guest quietly slipped in, while the block-first side stopped everything unknown. With blocking as the default, even if you leave something off the allow list, the design leans toward the safe side, not the dangerous one.
Designing so that a mistake costs as little as possible is sometimes called making things fail safe, like a vault door that locks when it breaks. But adding device after device to keep every principle tends to make a design more and more complex, and that becomes a danger of its own. The last principle keeps the balance.
Complexity adds gaps; simpler is safer
What happens if you keep adding devices endlessly in the name of following the principles? The more complex a structure becomes, the more hidden gaps it gathers, because with many parts and tangled connections, you can no longer see at a glance where it is weak. In a structure people cannot fully check, the very spot they failed to check becomes the gap.
So good design protects simplicity. It keeps only what is truly needed and removes what it can do without. As we saw in the symmetric encryption lesson, a good cipher is trustworthy not because its method is hidden but because its method is public and holds up when many people examine it. The simpler and more open a design is, the easier it is to examine that way.
Add or remove parts from the structure. The more complex it gets, the more unchecked gaps appear; the simpler it is, the easier it is to check at a glance.
Removing parts left fewer places to check, while adding parts quietly increased the gaps. Simplicity is not laziness; it is the result of thinking all the way through what is truly needed.
The four principles do not work separately; they mesh and turn together. Least privilege narrows how far damage can spread, layers back each other up, blocking is the default, and the whole thing is kept simple. Now let's bring the four principles together.
Wrapping up
Put together, it goes like this. Good security comes not from a single technology but from design principles. Least privilege means giving only what is needed and taking it back when the task is done. Defense in depth means that if one layer is breached, a different kind of layer behind it holds. Deny by default means blocking everything except what is allowed, and simplicity means reducing the gaps nobody checked.
The four principles mesh and work together, and they last longer than any individual technology. So when you meet a new technology, weighing it by these principles first keeps you steady.
Tap the four principles in order to review: least privilege, defense in depth, deny by default, and simpler is safer.
Now you hold the four principles for designing safety. Whenever you meet other security topics, these principles will guide you. Just ask: does this give only what is needed, is it one layer or several, does it let in the unknown or block it, is it simple or needlessly complex?
But push the principles all the way and a moment comes when they get inconvenient. The more layers you add, the more tedious logging in becomes, and default deny makes you ask permission every time you do something new. Next lesson, the last in this area, we look at how to weigh safety against convenience.