Hedronite · Cert Lesson · Cert-Prep / CNCF · Mon 2026-09-21

CKS ServiceAccount hardening — with EKS Pod Identity associations

CKS Cluster Hardening still wants automount off and short-lived tokens. On EKS, the same ServiceAccount can bind AWS IAM through an association instead of an IRSA annotation.

Lesson Class: Cert-Prep (CKS · Cluster Hardening)
Cert Target: CKS (CNCF)
Paired Ops: EKS Pod Identity versus IRSA
Paired Dev: Python boto3 association census
Grounding: Kubestronaut CKS SA · Q03 · Q30 · KUR Ch.14
Automount
false on dedicated SA; no default for apps.
Projected
serviceAccountToken + audience + expiration.
EKS bind
Association path; annotation is the older IRSA path.
Harden the SA on Kubernetes first. Then pick one IAM bind.

<!-- hal:authoritative:yaml -->

CKS Cluster Hardening still wants automount off and short-lived tokens. On EKS, the same ServiceAccount can bind AWS IAM through an association instead of an IRSA annotation.

§I — Frame

CKS blueprint weight for Cluster Hardening is about 15%. Kubestronaut opens Service Accounts with three moves: disable default automount, minimize permissions, issue tokens deliberately. Bootcamp question 03 drills automount false plus an explicit token path. Bootcamp question 30 drills projected serviceAccountToken with expirationSeconds and audience.

Kubernetes Up and Running, Chapter 14, Service Account Management, is the conceptual spine: the ServiceAccount is how the Pod authenticates to the API server.

Today's Ops lesson adds the cloud medium update after 09-06 IRSA: EKS Pod Identity associations bind IAM to namespace + ServiceAccount without eks.amazonaws.com/role-arn. CKS does not grade AWS console clicks. The transferable instinct is one dedicated ServiceAccount, no default SA for app Pods, no lasting token unless asked, and cloud IAM least privilege on a separate trust document.

§II — Objective map

NeedMechanism
Stop default API token mountsautomountServiceAccountToken: false on SA and/or Pod
Issue a deliberate short-lived tokenProjected volume serviceAccountToken with audience + expiration (Q30)
Minimize K8s permissionsRole/RoleBinding only for that SA (not default)
Cloud IAM on EKS (ops adjacency)Pod Identity association (preferred new path) or IRSA annotation (09-06)
ProveDescribe SA/Pod mounts; show association or annotation; no default SA on the workload

§III — Q03 / Q30 drill pattern (exam core)

  1. Create a dedicated ServiceAccount (never reuse default for the app).
  2. Set automountServiceAccountToken: false on the SA (and confirm Pod does not override to true carelessly).
  3. For Q30-style stems: add a projected volume:
volumes:
- name: api-token
  projected:
    sources:
    - serviceAccountToken:
        path: token
        expirationSeconds: 3600
        audience: api
  1. Mount only where the process needs the API. Confirm no auto-mounted secret under /var/run/secrets/kubernetes.io/serviceaccount when automount is false (unless you mounted deliberately).
  2. RBAC: bind a Role with the verbs the stem requires. Watch for ClusterRole overreach.

PSA (09-12) and Gateway (09-18) do not satisfy these stems.

§IV — EKS Pod Identity adjacency (not an exam click path)

On a real EKS cluster paired with Ops:

Compare to 09-06: IRSA put the role ARN in an annotation and trusted the OIDC issuer. Same SA shelf, different bind object.

§V — Exam discriminators

§VI — Practice cards

Question 1
A Deployment must call the Kubernetes API for 30 minutes max per token and must not automount the default token. Which two settings do you apply?
tap to reveal
Dedicated ServiceAccount with automountServiceAccountToken false, plus a projected serviceAccountToken volume with expirationSeconds (and audience if specified).
Question 2
On EKS, which bind removes the need for eks.amazonaws.com/role-arn on the ServiceAccount while still granting an IAM role to Pods using that SA?
tap to reveal
An EKS Pod Identity association for that cluster/namespace/ServiceAccount (agent must be running).
Question 3
Why is using the default ServiceAccount for a payment Pod a CKS Cluster Hardening failure mode even if RBAC looks empty today?
tap to reveal
default is shared; future bindings and mounts accumulate blast radius. Dedicated SA keeps permissions and cloud associations scoped.

§VII — Closing

Harden the ServiceAccount on the Kubernetes side first (automount, projected tokens, RBAC). On EKS, prefer one IAM bind style per SA. Pod Identity associations are the Ops update to the 09-06 IRSA story, not a substitute for CKS token discipline.

Related