Security by Design: 10 Timeless Principles
OWASP's 10 security by design principles explained in plain language, with practical examples from two decades in the security industry.
Timeless principles are guiding rules that apply across time and human cultures. They give us a framework for making decisions, reaching goals and living our lives. They come from human nature and reflect our deepest values and aspirations. While trends and technologies come and go, timeless principles stay relevant.
Two decades into the security industry, I've seen countless vendors, tools and technologies, and many of them didn't last. Every seller offered a silver bullet. Every buyer wanted the shiny new toy. Budget after budget, from on-premises to the cloud, from prevention to "breaches are inevitable", the search for security nirvana consumed every organisation. Yet in most of those quests, I saw little appreciation for the basic security principles that have stood the test of time.
Thankfully, OWASP, the non-profit organisation dedicated to improving software security, captured these principles in its Security by Design Principles. Here is what each one means in practice.
- Minimise attack surface area
- Establish secure defaults
- Principle of least privilege
- Principle of separation of duties
- Principle of defence in depth
- Fail securely
- Don't trust services
- Avoid security by obscurity
- Fix security issues correctly
- Keep security simple
Minimise Attack Surface Area
This is probably the most underrated principle, and it applies as much to protecting your organisation as to building secure applications. Spend less effort on security tools and more on shrinking the attack surface. Consolidate your authentication schemes. Replace long-lived virtual machines with immutable, short-lived containers. Swap Windows machines for Chromebooks. Wherever you look, you'll find ways to shrink your footprint, and you'll save money on security software and subscriptions too.
Establish Secure Defaults
Most users and admins don't bother to change the settings a product ships with, so those default settings need to be safe. Turn on multi-factor authentication, keep admin consoles off the internet, make storage buckets private and switch off detailed error messages by default. Users can relax a setting when they have a good reason, but they should have to do it on purpose.
Principle of Least Privilege
Give every user, service and process only the access it needs, and only for as long as it needs it. An attacker who steals an account can do everything that account can do, so fewer permissions limit the damage. Privileges also tend to grow over time. Service accounts are often the worst cases, which is why overprivileged identities feature in the OWASP Non-Human Identities Top 10. Review access regularly, and prefer just-in-time access that expires on its own.
Principle of Separation of Duties
No single person should be able to complete a sensitive action alone. A developer's code goes through review before it reaches production. A payment request needs a second approver. This stops honest mistakes, and it makes fraud much harder because it now takes two people working together. Most tools you already use can enforce it. Code repositories support required reviews before a merge, cloud platforms let you separate the people who grant access from the people who use it, and finance systems support dual approval.
Principle of Defence in Depth
Layer your controls so that when one fails, another catches the attacker. A phishing email that gets past the mail filter should still run into multi-factor authentication, then endpoint detection, then network segmentation. The trap is what I call expense in depth: buying a new product for every layer without checking that each one works, or that they don't overlap. Map your layers to real attack paths, and test each one.
Fail Securely
Decide in advance how each part of your system behaves when it fails. If the authorisation service times out, deny the request. If a login check throws an error, the user stays logged out. Error messages should also give attackers nothing useful, such as stack traces, database names or a hint about whether the username or the password was wrong.
Don't Trust Services
Treat every third-party service as something that can break or turn hostile. Partners, SaaS tools, APIs and open-source packages all sit outside your control. Validate the data they send to you, limit what their credentials can reach, and watch what they do. Software supply chain attacks have shown how one compromised vendor can reach thousands of its customers. Zero trust applies the same idea inside your own network: a user or device doesn't get access just because it's on your network.
Avoid Security by Obscurity
Security by obscurity means relying on attackers not knowing how your system works. Moving SSH to an unusual port or leaving an API undocumented might cut down noise, but a determined attacker finds both quickly. Obscurity becomes a problem when it replaces real controls, and it often comes with security theatre: measures that look reassuring in an audit but stop nothing. Forcing password changes every 30 days or blocking USB ports while everyone has admin rights are classic examples. Your controls should still work when attackers know exactly how your system is built.
Fix Security Issues Correctly
When you find a vulnerability, find out why it happened before you patch it. If one endpoint had an injection flaw, other endpoints built the same way probably have it too, so search the whole codebase. Add a test so the bug can't quietly return. Then fix the process that let it through, whether that's a missing code review, a gap in your scanning or an unsafe library.
Keep Security Simple
Every extra component, exception and integration is one more thing to configure, monitor and patch, and one more place for mistakes to hide. Simple designs are easier to understand, review and defend. Choose fewer controls that your team understands well, and remove the ones you no longer need.
You can apply all of these principles without buying new tools, whether you're securing a startup's first cloud account or a large bank. For a practical starting point, see the top 5 cloud security risks for startups.