Privilege Separation
A web server should run as a restricted user; administrative setup and runtime request handling should not share one authority.
Frame the problem
Security starts with a concrete asset, attacker capability and trust crossing.
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.
| Prevent | Detect | Recover |
|---|---|---|
| Drop privileges before accepting requests · Split privileged helpers behind narrow interfaces · Remove unused OS capabilities | Runtime privilege changes and privileged syscalls | Contain 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.
- 1Attacker starts with: A remote caller who compromises the web process.
- 2The process runs as root or retains setup privileges during normal request handling.
- 3The weak or missing boundary control is crossed: Restricted runtime identity → host administration
- 4Impact: An application compromise becomes a host compromise.
- 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.
- • Drop privileges before accepting requests
- • Split privileged helpers behind narrow interfaces
- • Remove unused OS capabilities
- • Runtime privilege changes and privileged syscalls
- • Contain the affected identity or component.
- • Scope access from audit evidence.
- • Fix the boundary and add a regression test.
- • Misconfiguration and new access paths can bypass the intended control.
- • A privileged insider or compromised control plane may still reach the asset.