Key Concepts
Security is not a feature you add at the end. It's an architectural property you design in from day 1.
Core Security Concepts
Asset, exposure, vulnerability, attack, threat, control — the vocabulary of security engineering.
Security Design Principles
Defense in depth, least privilege, fail securely, minimize attack surface, security by default.
OWASP Top 10
Top 10 most critical web application security risks. Required knowledge for all developers.
Cryptographic Failures
Storing/transmitting sensitive data without proper encryption. OWASP #2 and one of the most common.
Concept Deep Dives
Click each concept to expand — real examples, diagrams, pros & cons.
Core Security Concepts
When to Use
Always — you need the right language before you can design security.
Real-World Example
Asset = user passwords. Vulnerability = storing plain text. Attack = SQL injection. Control = bcrypt hashing.
✓ Advantages
- Common language across teams
- Framework for threat modeling
⚠ Watch Out
- Easy to underestimate 'assets' — everything is an asset
Security Design Principles
When to Use
Always — these are design-time decisions that are cheap to get right and expensive to retrofit.
Real-World Example
Least privilege: database user account for your web app should only have SELECT/INSERT — not DROP TABLE.
✓ Advantages
- Reduces blast radius of breaches
- Systematic approach
⚠ Watch Out
- Can conflict with usability
- Requires upfront discipline
OWASP Top 10
When to Use
Before building any web application — these are the most exploited vulnerabilities.
Real-World Example
Equifax breach: injection via Apache Struts. 147M records. $700M settlement. OWASP #1 would have prevented it.
✓ Advantages
- Industry-standard checklist
- Free resource
- Covers 95% of real-world attacks
⚠ Watch Out
- Not exhaustive
- Top 10 changes over time — check latest version
Cryptographic Failures
When to Use
Any time you handle passwords, tokens, PII, financial data.
Real-World Example
LinkedIn 2012: 6.5M password hashes leaked. Stored as unsalted SHA1 — cracked in hours. Should have used bcrypt.
✓ Advantages
- Easy to fix if caught early
- Clear best practices exist
⚠ Watch Out
- Hard to retrofit if architecture is wrong
- Developers often underestimate what's 'sensitive'
MD5(password)SHA1(password)AES-ECBfor data
bcrypt/argon2for passwordsAES-256-GCMfor data at restTLS 1.3for data in transit
Quick Reference
- 1Security is an architectural property — must be designed in, not added later.
- 2Core concepts: asset, vulnerability, attack, threat, control, exposure.
- 3Security design: defense in depth, least privilege, fail secure, minimize attack surface.
- 4OWASP Top 10: the most critical web security risks. Study it.
- 5Injection attacks (SQL, LDAP): validate all input, use parameterized queries.
- 6Cryptographic failures: use bcrypt for passwords, AES-256 for data at rest, TLS for transit.
- 7Security misconfiguration: most common cause of breaches — default passwords, open ports, verbose errors.
From the Book & Beyond
Case Study — The Mentcare Blackmail Scenario
Sommerville's security story for the Mentcare mental-health system reads like a thriller. A criminal learns that a well-paid sports star is receiving treatment for mental health problems and wants illegal access to the records — for blackmail. Mentcare requires passwords of at least eight letters, but never checks their strength. So the attacker poses as a concerned relative, chats with clinic nurses, reads names off their badges, then systematically guesses passwords like the names of the nurses' children. The vulnerability isn't in the code; it's a weak password policy plus human trust. That's why this chapter derives security requirements from risk assessment and misuse cases, not gut feeling.
2026 Perspective — Supply Chains and Zero Trust
The chapter's layered stack (Figure 13.1) warns that your app inherits vulnerabilities from reusable components — and 2024 proved it spectacularly. In the xz-utils backdoor, an attacker spent years earning maintainer trust in an open-source compression library, then planted a backdoor that nearly shipped inside SSH on major Linux distributions. Modern practice answers with zero-trust architecture — authenticate every request, never assume the internal network is safe — while OWASP's Top 10 keeps evolving beyond injection bugs toward design flaws and supply-chain risk. Sommerville's risk-driven requirements process is exactly how you reason about threats you haven't seen yet.
Quiz — Test Yourself
Think through your answer first, then reveal.