Enforce least-privilege access in Kubernetes

8 steps · about 2 h 43 min · Intermediate

  1. Map the Kubernetes security boundaries (guide, Kubernetes, 20 min)

    Cluster, control-plane, node, workload and user boundaries clarify where identity and policy must apply.

  2. Give workloads explicit identities (guide, Kubernetes, 20 min)

    Dedicated service accounts avoid sharing the namespace default identity across unrelated workloads.

  3. Model permissions with RBAC (guide, Kubernetes, 25 min)

    Roles, ClusterRoles and bindings express allowed verbs and resources at the narrowest useful scope.

  4. Understand an authorization decision (guide, Kubernetes, 18 min)

    The request attributes and authorizer chain explain why an authenticated request is allowed or denied.

  5. Separate human and workload authentication (guide, Kubernetes, 20 min)

    Authentication methods and token behaviour differ for users, automation and in-cluster workloads.

  6. Control service-account token mounting (guide, Kubernetes, 20 min)

    Disabling unnecessary automounting and using projected tokens reduces credential exposure inside pods.

  7. Apply workload security standards (guide, Kubernetes, 22 min)

    The baseline and restricted profiles add pod-level controls that identity permissions alone cannot provide.

  8. Prove effective permissions with can-i (reference, Kubernetes, 18 min)

    Impersonated permission checks verify both intended access and important denials before rollout.