Managing Eks Access at Scale with Centralized Identity and Short-lived Credentials

Large organizations centralize EKS access using IAM federation, RBAC.

JR

2 minute read

Large organizations centralize EKS access using IAM federation, RBAC, and short-lived credentials to enforce least privilege and audit compliance.

Why This Matters

At scale, managing individual EKS access entries and long-lived IAM credentials becomes unmanageable. Manual updates, credential leakage, and audit gaps create operational debt and security risks. Centralized identity management with just-in-time (JIT) access reduces these risks while maintaining agility.

Actionable Workflow

  1. Federate IAM with Kubernetes

    • Use AWS IAM Identity Center (SSM Session Manager) or OIDC (e.g., Keycloak, Okta) to map IAM identities to Kubernetes users/groups.
    • Example: Configure IAM Identity Center to sync AWS IAM groups to Kubernetes RBAC.
  2. Define RBAC Policies

    • Create ClusterRoles and RoleBindings for least-privilege access (e.g., developers get get, list on pods, not create or delete).
    • Example:
      kind: ClusterRoleBinding
      apiVersion: rbac.authorization.k8s.io/v1
      metadata:
        name: dev-team-binding
      subjects:
      - kind: Group
        name: aws-iam-group:Developers
        apiGroup: rbac.authorization.k8s.io
      roleRef:
        kind: ClusterRole
        name: view
        apiGroup: rbac.authorization.k8s.io
      
  3. Implement JIT Access

    • Use tools like Akeyless or HashiCorp Vault to issue short-lived tokens or credentials.
    • Example: Akeyless JIT access workflow for EKS:
      # Request temporary credentials
      akeyless access-key-provision efs-access --duration 3600
      
  4. Enforce Audit Logging

    • Enable Kubernetes audit logs and forward to a centralized SIEM (e.g., Elasticsearch, CloudWatch).
    • Validate with:
      kubectl get events --field-selector involvedObject.kind=User
      

Policy Example

AWS IAM Policy for EKS Access:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": "eks:DescribeCluster",
      "Resource": "*"
    },
    {
      "Effect": "Deny",
      "Action": "eks:UpdateCluster",
      "Resource": "*"
    }
  ]
}

Tooling

  • AWS IAM Identity Center: Syncs IAM groups to Kubernetes RBAC.
  • Akeyless: Centralized secrets management with JIT access.
  • Keycloak: Open-source OIDC provider for federated identity.
  • Falco: Runtime security monitoring for anomalous access patterns.

Tradeoffs

  • JIT Latency: Short-lived credentials require client-side tooling (e.g., aws-cli caching) to avoid workflow friction.
  • Complexity: OIDC or IAM Identity Center setup adds initial config overhead but reduces long-term maintenance.
  • Single Points of Failure: Centralized identity services (e.g., Keycloak) require HA deployment and backup plans.

Troubleshooting

  • IAM Role Mismatch:
    • Check IAM policy permissions with:
      aws iam get-role --role-name <role-name>
      
    • Validate Kubernetes RBAC with:
      kubectl auth can-i list pods --as=system:serviceaccount:<namespace>:<serviceaccount>
      
  • Expired Credentials:
    • Rotate credentials via JIT tooling or update IAM roles in Kubernetes manifests.
  • Audit Log Gaps:
    • Ensure --audit-policy-file is configured in the API server args.

Final Notes

Centralized identity, RBAC, and short-lived credentials are non-negotiable at scale. Start small: federate IAM, enforce least privilege, then layer in JIT access. Avoid over-engineering—prioritize auditability and incremental automation.

Source thread: AWS EKS | EKS Access Entry - How large organizations handle EKS Access?

comments powered by Disqus