Course contentsShow
← Security
Lesson 2628 of 3,05250. Secure Architecture and DesignFree lesson

Fail-Safe Defaults and Secure Defaults

Explore why systems should deny access by default and require explicit permission grants rather than the reverse.

Fail-Safe Defaults and Secure Defaults

What you'll learn: Why secure systems deny access by default and only grant permissions explicitly, rather than allowing everything unless blocked.

The Core Principle

Fail-safe defaults (also called secure defaults) mean that access decisions should start from "deny" rather than "allow." When a system encounters a situation it hasn't been explicitly configured to handle, it should fail closed—denying access—rather than fail open and grant it.

This is the opposite of permissive systems where everything is allowed unless specifically forbidden. In security architecture, the burden should be on proving you should have access, not proving you shouldn't.

Why This Matters

Imagine a gated community where the default position is "everyone can enter unless they're on a blocklist." That's dangerous—you'd need to know every potential threat in advance. Instead, secure design says "nobody enters unless they're on the approved list." A gap in your configuration means denial, not breach.

In practice:

  • File permissions: New files should be readable only by their owner, not world-readable
  • Firewall rules: Block all traffic except explicitly allowed connections
  • API endpoints: Require authentication unless specifically marked public
  • Database access: No permissions granted until explicitly assigned

This principle works hand-in-hand with Principle of Least Privilege (which you've learned). While least privilege limits how much access granted users receive, fail-safe defaults control who gets access in the first place.

Defense Against Misconfiguration

Secure defaults protect against human error. Administrators forget to configure things, documentation gets missed, and systems evolve. When the default state is "deny," forgotten configurations create availability issues (noticeable, fixable) rather than security breaches (silent, catastrophic).

Key Takeaway: Systems should deny access by default and require explicit permission grants—fail closed, not open—to ensure that configuration gaps result in denied access rather than unauthorized exposure.