liveBook · Manning

Non-root user

As explained in Google Anthos in Action

A nonroot user is an operating-system identity that does not have the unrestricted administrative privileges of root.

A non-root user is an operating-system identity without root’s unrestricted administrative privileges. Running containers with the least required permissions limits host exposure after a container breakout. section 13.6.1

Use a non-root identity to:

  • Avoid inheriting root as the default user from common container images such as busybox. section 13.6.1
  • Set the container user, primary group, and filesystem group through a Kubernetes security context. section 13.6.1
  • Reduce the impact of configurations that combine root execution with privileged access to host devices. section 13.4

Kubernetes deployment identity

Configure a Pod with runAsUser 1500, runAsGroup 1000, and fsGroup 1200. Confirm the effective identity and memberships with whoami and groups. IDs absent from a pulled image may produce unknown-ID warnings. section 13.6.1

spec:
 securityContext:
   runAsUser: 1500
   runAsGroup: 1000
   fsGroup: 1200

View the compact Pod securityContext manifest for assigning the non-root user and group identities. section 13.6.1

How Google Anthos in Action covers it

How deep it goes
Explains deployment-time identity configuration and verification, but defers image construction and broader privileged-container controls.
Examples
Uses busybox, Pod fields runAsUser 1500, runAsGroup 1000, fsGroup 1200, and whoami and groups verification.
What it assumes
Assumes familiarity with container images and Kubernetes Pods; teaches deployment-time user and group assignment.
What you can do after
Operate/configure Kubernetes Pods with a specified user and group, then verify their effective identity.
How it connects
Connects non-root users with containers, Kubernetes security contexts, privileged containers, filesystem groups, and Gatekeeper policies.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Google Anthos in Action. The section links point to the parts of the book it draws on.