Infrastructureprivilegeseparation

Privilege Separation

A web server should run as a restricted user; administrative setup and runtime request handling should not share one authority.

Follow the failure

Frame the problem

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

Asset
Root-owned host resources and other service data.
Attacker & capability
A remote caller who compromises the web process.
Trust boundary
Restricted runtime identity → host administration
AssetThreatAttack SurfaceTrust BoundaryVulnerabilityExploit PathImpactMitigationDefense in DepthResidual Risk

Why the system fails

The process runs as root or retains setup privileges during normal request handling.

The important question is not “what is Privilege Separation?” but “which assumption let untrusted data or an over-scoped identity cross restricted runtime identity → host administration?” 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: Drop privileges before accepting requests 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
Drop privileges before accepting requests · Split privileged helpers behind narrow interfaces · Remove unused OS capabilitiesRuntime privilege changes and privileged syscallsContain the affected identity or component, scope impact from audit evidence, and preserve a regression test.

Key points

  • Asset: Root-owned host resources and other service data.
  • Boundary: Restricted runtime identity → host administration
  • Primary control: Drop privileges before accepting requests
  • Detection signal: Runtime privilege changes and privileged syscalls
  • Always ask what limits damage when the primary control fails.

Follow the attack

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

  1. 1
    Attacker starts with: A remote caller who compromises the web process.
  2. 2
    The process runs as root or retains setup privileges during normal request handling.
  3. 3
    The weak or missing boundary control is crossed: Restricted runtime identity → host administration
  4. 4
    Impact: An application compromise becomes a host compromise.
Blast radius
  • An application compromise becomes a host compromise.

Defend, detect, recover

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

Prevent
  • • Drop privileges before accepting requests
  • • Split privileged helpers behind narrow interfaces
  • • Remove unused OS capabilities
Detect
  • • Runtime privilege changes and privileged syscalls
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 drop privileges before accepting requests control makes this safe.”
Reality
One control changes risk; it does not erase it. Design prevention, detection, recovery, and blast-radius limits together.