Principle of Least Privilege
On this page
Least Privilege as an Operations Practice
- Grant only what is needed for the task, for the shortest time.
- Prefer role-based access and group membership over individual grants.
- Make privilege reduction measurable (who/what still has admin?).
Access Review Checklist
- List all admin and cluster-admin bindings.
- Identify stale users and service accounts.
- Replace broad roles with scoped roles per namespace.
- Introduce break-glass admin with approvals and audit.
RBAC Discovery Commands
# Who has cluster-admin? kubectl get clusterrolebinding -o json | jq -r '.items[] | select(.roleRef.name=="cluster-admin") | .metadata.name + " " + (.subjects|tostring)' # What can I do? (impersonation) kubectl auth can-i create pods --as system:serviceaccount:ns:sa # List permissions for a subject (helpful for audits) kubectl auth can-i --list --as user@example.com
Failure Modes
- Permanent admin for "temporary" tasks.
- No break-glass path: operators create unsafe workarounds.
- Privilege creep: adding permissions without periodic removal.