Security Principles
62. Zero Trust Principle
Definition. Never automatically trust a user, device, or network; verify every request regardless of origin.
Rationale. Perimeter-based trust fails once an attacker is inside. Verifying every request limits lateral movement and reduces reliance on network boundaries.
Example. Require authentication and authorization for internal service calls, not just external ones.
Anti-pattern / failure mode. “Trusted internal network” assumptions; skipping auth for service-to-service calls. Review signal: a compromised internal host can reach everything.
Related. Defense in Depth (#63), Complete Mediation (#65), guarded access (Proxy).
63. Defense in Depth
Definition. Apply multiple independent security layers; no single control should be the only barrier.
Rationale. Any single control can fail or be bypassed. Layered controls ensure that a failure in one does not compromise the whole system.
Example. Combine input validation, parameterized queries, and least-privilege DB accounts to prevent SQL injection.
Anti-pattern / failure mode. Relying on one control (e.g., a WAF) as the only protection. Review signal: a single bypass grants full access.
Related. Zero Trust (#62), Fail Securely (#66), bulkhead isolation (Bulkhead).
64. Secure by Default
Definition. Default configurations should favor security; require explicit opt-in to weaken protections.
Rationale. Defaults are what most deployments use. Secure defaults protect the majority and reduce accidental exposure.
Example. Disable debug endpoints and require TLS by default; allow disabling only with explicit flags.
Anti-pattern / failure mode. Insecure defaults (open ports, default passwords) that users must remember to fix. Review signal: production systems running with default credentials.
Related. Economy of Mechanism (#67), Least Privilege (#18), minimal attack surface (Facade).
65. Complete Mediation
Definition. Check authorization on every access to protected resources; do not cache authorization decisions unsafely.
Rationale. Authorization must be evaluated at the point of access, not assumed from an earlier check. Caching or skipping checks creates bypass opportunities.
Example. Verify permissions on each API request rather than trusting a session flag set at login.
Anti-pattern / failure mode. Checking auth once and trusting subsequent calls; “admin mode” flags. Review signal: privilege escalation via stale sessions.
Related. Fail Securely (#66), Zero Trust (#62), request interception (Chain of Responsibility).
66. Fail Securely
Definition. Failure should not expose protected information or privileges; default to denial on error.
Rationale. Error paths are often less tested and can leak data or grant access. Failing closed keeps security posture intact under faults.
Example. If an authorization check throws, deny access rather than allow it.
Anti-pattern / failure mode. Fail-open logic that grants access on exceptions or missing config. Review signal: “allow by default” error handlers.
Related. Fail Fast (#16), Complete Mediation (#65), safe defaults (Secure by Default).
67. Economy of Mechanism
Definition. Keep security mechanisms as simple as possible; complexity breeds vulnerabilities.
Rationale. Complex security code is hard to audit and more likely to contain flaws. Simple, well-understood mechanisms are easier to verify and maintain.
Example. Use a standard, vetted auth library instead of a custom token scheme.
Anti-pattern / failure mode. Custom cryptography or bespoke auth protocols. Review signal: security code that only one person understands.
Related. KISS (#7), Defense in Depth (#63), vetted building blocks (Flyweight).
68. Least Common Mechanism
Shared-infrastructure scope (minimize shared paths) — for per-identity permissions see Least Privilege (#18).
Definition. Minimize shared mechanisms and resources between users; shared paths can leak information or amplify impact.
Rationale. Shared components create covert channels and single points of compromise. Isolating mechanisms per user or tenant limits cross-user impact.
Example. Separate caches or queues per tenant rather than one shared pool.
Anti-pattern / failure mode. Global caches keyed only by resource id, leaking data across users. Review signal: cross-tenant data exposure.
Related. Least Privilege (#18), Separation of Privilege (#69), per-tenant isolation (Multi-Tenant SaaS).
69. Separation of Privilege
Definition. Require multiple independent conditions for sensitive operations; avoid single points of control for critical actions.
Rationale. A single compromised credential or person should not be able to perform a high-impact action. Multiple independent conditions raise the bar for abuse.
Example. Require two-person approval for production deployments or large refunds.
Anti-pattern / failure mode. One admin account able to do everything; single-approval for destructive operations. Review signal: a single account compromise is catastrophic.
Related. Least Privilege (#18), Defense in Depth (#63).