Interview Prep/Linux/Users, groups and access control

You have to give a CI runner user the right to run Docker but you are worried about security. What do you do?

AdvancedScenarioUsers, groups and access control
Answer

Situation read → Membership in the docker group is root-equivalent.

What I'd do →

  1. Prefer rootless Docker or Podman for the runner user: dockerd-rootless-setuptool.sh install.
  2. If rootful Docker is required, run the runner on a dedicated, disposable VM that has no other secrets.
  3. Never mount /var/run/docker.sock into untrusted job containers.
  4. Consider building with BuildKit rootless or Kaniko/Buildah.

Why → Anyone in docker can run docker run -v /:/host --privileged and own the host.

Interview tip → Say clearly "docker group = root", interviewers look for that.

All Linux questions Roadmap: Linux

More on Users, groups and access control