academy.security.krd

← Security Foundations

Users, permissions, and why root is a design decision

8 min

Operating systems do not have a concept of "safe". They have a concept of "permitted", and somebody decided what that means.

The model

On a Unix-like system every process runs as a user, and every file has an owner, a group and a set of bits saying what each may do. That is nearly the whole model. Its simplicity is why it has lasted and also why it is so often misconfigured.

a service account that owns nothingan ordinary usera member of the right groupa program that changes who it isrootthe kernel checks everythingthe kernel stops asking
Root is not the top of an administrator ladder. It is the point at which the checks stop happening, which is why “what runs as root, and why” is the first question to ask of any machine.

Where this goes wrong in practice

The common failure is not a clever exploit. It is a directory left world-writable so that an application "just works", and then something in that directory being executed later.

drwxrwxrwx  storage/

That is a finding, every time. It says any process on the machine can place a file there, and something will eventually run it.

What to take away

When you audit a machine, look at what runs as root and ask why. Most services do not need it, and most of the ones that do only need it to open a port below 1024.

Adapted from: Written for this course

Check yourself

1

Sign in to have your answers marked and your progress saved.

1

What does running a service as root actually mean?