Skip to main content

More Info:

Default service accounts should not be used by workloads and should not auto-mount tokens. Explicit, purpose-built service accounts should be created for workloads needing API access.

Risk Level

Medium

Address

Security

Compliance Standards

  • CIS GKE

Triage and Remediation

Remediation

Manual Steps

  1. Disable token automount on all default ServiceAccounts
    • Run on: any machine with kubectl access
  2. Identify pods using the default ServiceAccount
    • Run on: any machine with kubectl access
  3. For each affected workload, create a dedicated ServiceAccount
    • Run on: any machine with kubectl access
    • Example for namespace my-namespace and app my-app (repeat per app/namespace as needed):
  4. Update workloads to use the new ServiceAccount
    • Run on: any machine with kubectl access
    • Example for a Deployment (repeat for DaemonSets/StatefulSets/Jobs, etc.):
    Set:
    Save and exit to trigger a rolling update.
  5. Recreate or roll pods that were using the default ServiceAccount directly
    • Run on: any machine with kubectl access
    • For pods managed by a controller, the edit in step 4 is enough.
    • For bare pods (no controller), delete and recreate them with an explicit serviceAccountName:
  6. Verify remediation
    • Run on: any machine with kubectl access