EKS
Rbac

πŸ” EKS Authentication & Authorization β€” Design Patterns (Interview Level)

First β€” say this in interview to sound senior:

β€œIn EKS I separate identity into three planes β€” human access, workload access, and deployment automation β€” and design each differently.”

That’s a strong opener.


🧩 Layer 1 β€” How EKS Authentication Works (Foundation)

EKS does not use Kubernetes native users. EKS uses AWS IAM for authentication to the control plane.

Flow:

IAM identity β†’ aws-iam-authenticator β†’ Kubernetes RBAC mapping β†’ permission granted

So:

  • IAM = authentication
  • RBAC = authorization

Interviewers want this sentence.


πŸ‘€ Pattern 1 β€” Human User Access to EKS (kubectl access)


βœ… Design Pattern β€” IAM + aws-auth + RBAC

Flow:

User β†’ AWS SSO/IAM Role β†’ mapped in aws-auth ConfigMap β†’ Kubernetes RBAC role β†’ namespace access

Design:

  • No IAM users with keys
  • Use AWS SSO / federated login
  • Users assume role
  • Role mapped to K8s group
  • Group bound to RBAC role

βœ… Example Pattern β€” Team Namespace Access

Platform team role β†’ cluster-admin Team-A role β†’ namespace-a admin Team-B role β†’ namespace-b read/write

This prevents cross-team blast radius.


❌ Bad Pattern (interview red flag)

  • mapping everyone to system:masters
  • giving cluster-admin to all engineers
  • using static IAM users with access keys

πŸ§‘β€πŸ’» Pattern 2 β€” CI/CD Deployment to EKS

This is heavily asked.


βœ… Design Pattern β€” CI Role + Namespace RBAC

CI system (Jenkins/GitHub Actions) assumes dedicated IAM role β†’ mapped in aws-auth β†’ mapped to limited K8s RBAC β†’ deploy only allowed namespaces.

Why:

  • no personal creds in pipeline
  • auditable
  • revocable
  • least privilege

βœ… Production Guardrail

Separate roles:

ci-dev-deployer ci-stage-deployer ci-prod-deployer

Each mapped to env namespace only.


πŸ“¦ Pattern 3 β€” Pod β†’ AWS Resource Access (Very Important)

This is NOT kubectl auth β€” this is runtime auth.


βœ… Best Practice β€” IRSA (IAM Roles for Service Accounts)

ServiceAccount ↔ IAM Role binding via OIDC.

Pod uses service account β†’ gets IAM role β†’ calls AWS APIs.

Why this is best:

  • pod-level least privilege
  • no node-role overpermission
  • no static keys
  • audit trail per workload

❌ Bad Pattern

Using node instance role for all pods. One pod compromise β†’ full node IAM permissions.

Interviewers expect you to call this out.


🏒 Pattern 4 β€” Multi-Team Cluster Access Model

Senior-level answer:


βœ… Namespace + IAM Role + RBAC Binding Model

Per team:

IAM role per team mapped β†’ k8s group group β†’ namespace rolebinding namespace quotas + network policies enforced


βœ… Add Guardrails

  • OPA/Kyverno policies
  • resource quotas
  • limit ranges
  • network policies
  • PodSecurity standards

Auth without guardrails is incomplete design.


πŸ” Pattern 5 β€” Fine-Grained Authorization Inside Cluster


βœ… RBAC Levels You Should Mention

ClusterRole β€” cluster scope Role β€” namespace scope RoleBinding β€” attach to subject ClusterRoleBinding β€” global attach

Best practice β†’ namespace RoleBindings for teams.


🌍 Pattern 6 β€” External Identity Provider Integration


βœ… OIDC / SSO Integration Pattern

Enterprise fintech pattern:

IdP (Okta/Azure AD) β†’ AWS SSO β†’ IAM roles β†’ EKS RBAC mapping

Benefits:

  • central offboarding
  • MFA enforced
  • audit trail
  • no local IAM users

🚦 Pattern 7 β€” Read-Only Access for Auditors / Support

Create IAM role β†’ mapped to k8s read-only cluster role β†’ view-only access.

Important for fintech audits.


🧠 Pattern 8 β€” Break-Glass Admin Access

Have emergency admin role:

  • MFA required
  • session logged
  • approval workflow
  • not used daily

Interview gold answer.


⚠️ Limits & Gotchas Interviewers Like


aws-auth ConfigMap is critical

  • misconfig β†’ lockout
  • must be version controlled
  • GitOps manage it
  • backup mapping roles

Token lifetime

kubectl tokens are short-lived (STS). Good for security β€” may surprise users.


🧱 Full Secure EKS Access Architecture (What to Say)

Say this in interview:

Human users authenticate via SSO β†’ assume IAM roles β†’ mapped to RBAC groups. CI/CD uses dedicated deployer roles with namespace-scoped RBAC. Workloads use IRSA for AWS access. Guardrails enforced via policy engine and quotas. No static credentials, no shared admin, and access is namespace-isolated.


πŸ’¬ Need a Quick Summary?

Hey! Don't have time to read everything? I get it. 😊
Click below and I'll give you the main points and what matters most on this page.
Takes about 5 seconds β€’ Uses Perplexity AI