A kubeconfig with a static cluster-admin ServiceAccount token is found committed in a public repo
AdvancedTroubleshootingCloud identity: IRSA, Workload Identity and CI OIDC
Answer
Likely causes → A long-lived SA token secret was created for CI and copied into a file for convenience.
Diagnose →
echo "$TOKEN" | cut -d. -f2 | base64 -d 2>/dev/null | jq # SA name, namespace, secret name
kubectl get clusterrolebinding -o wide | grep <sa>
Search the audit logs for that SA's username (system:serviceaccount:<ns>:<sa>) since the commit date.
Fix → Delete the token Secret (this invalidates the token at once), remove the cluster-admin binding, review audit logs for actions taken, and rotate any secrets the SA could read. Also purge the file from Git history, though rotation is what actually protects you. If the API endpoint is public, restrict it.
Prevent → No long-lived tokens. Use OIDC-based CI auth, a private API endpoint or an authorized network list, and secret scanning with push protection.
More on Cloud identity: IRSA, Workload Identity and CI OIDC
A pod configured for IRSA runs `aws sts get-caller-identity` and gets the node role (`eks-node-group-role`) instead of its own roleBeginner`An error occurred (AccessDenied) when calling the AssumeRoleWithWebIdentity operation: Not authorized to perform sts:AssumeRoleWithWebIdentity` from an IRSA podIntermediate`InvalidIdentityToken: No OpenIDConnect provider found in your account for https://oidc.eks.ap-south-1.amazonaws.com/id/ABC123`BeginnerIRSA env vars are present in the pod, but one legacy service still uses the node roleIntermediatePods without IRSA can still call AWS with the node's permissions through `169.254.169.254`IntermediateWith EKS Pod Identity, the pod gets `Unable to locate credentials` even though a pod identity association existsIntermediate