Designsecuresoftwaredesignprinciples

Secure Software Design Principles

Secure defaults, deny by default, least privilege, complete mediation, separation of duties and explicit boundaries make the safe path the easy path.

▶ Run the labFollow the failure

Frame the problem

Security starts with a concrete asset, attacker capability and trust crossing.

Asset
Security invariants that must survive feature changes and operational pressure.
Attacker & capability
Any caller or compromised component that finds an alternate path.
Trust boundary
Design intent → every concrete execution path
AssetThreatAttack SurfaceTrust BoundaryVulnerabilityExploit PathImpactMitigationDefense in DepthResidual Risk

Why the system fails

Controls are optional calls, dangerous behavior is the default, or one trusted component accumulates unrelated authority.

The important question is not “what is Secure Software Design Principles?” but “which assumption let untrusted data or an over-scoped identity cross design intent → every concrete execution path?” Trace the decision at the boundary, then constrain what can happen after the first control fails.

Design the control in layers

Start with the control closest to the interpretation or privilege boundary: Make enforcement structural and complete Then add a control that reduces blast radius and telemetry that proves the decision was enforced.

The resulting design is not labelled secure. Record the identified controls, the known failure paths, the remaining exposure, and the evidence you would need during an incident.

PreventDetectRecover
Make enforcement structural and complete · Default to private, denied and minimally privileged · Separate high-risk duties and reduce the trusted computing baseInvariant-focused tests and review of privileged path changesContain the affected identity or component, scope impact from audit evidence, and preserve a regression test.

Key points

  • Asset: Security invariants that must survive feature changes and operational pressure.
  • Boundary: Design intent → every concrete execution path
  • Primary control: Make enforcement structural and complete
  • Detection signal: Invariant-focused tests and review of privileged path changes
  • Always ask what limits damage when the primary control fails.

Boundary control exercise

This lesson uses the shared boundary-control exercise.

Boundary control check
Untrusted input / identity
Trust boundary
Privileged asset
Prevention may fail silently.

Follow the attack

Safe conceptual simulation: capability → missing control → crossed boundary → asset impact.

  1. 1
    Attacker starts with: Any caller or compromised component that finds an alternate path.
  2. 2
    Controls are optional calls, dangerous behavior is the default, or one trusted component accumulates unrelated authority.
  3. 3
    The weak or missing boundary control is crossed: Design intent → every concrete execution path
  4. 4
    Impact: A small defect bypasses the entire security model.
Blast radius
  • A small defect bypasses the entire security model.

Defend, detect, recover

One prevention is a single point of security failure. Layer it and make failure observable.

Prevent
  • • Make enforcement structural and complete
  • • Default to private, denied and minimally privileged
  • • Separate high-risk duties and reduce the trusted computing base
Detect
  • • Invariant-focused tests and review of privileged path changes
Respond & recover
  • • Contain the affected identity or component.
  • • Scope access from audit evidence.
  • • Fix the boundary and add a regression test.
Residual risk
  • • Misconfiguration and new access paths can bypass the intended control.
  • • A privileged insider or compromised control plane may still reach the asset.

Misconceptions

Claim
“A single make enforcement structural and complete control makes this safe.”
Reality
One control changes risk; it does not erase it. Design prevention, detection, recovery, and blast-radius limits together.