GistPin uses AWS IRSA (IAM Roles for Service Accounts) to provide pod-level AWS credentials without storing static keys in Secrets.
Pod (ServiceAccount: backend)
|
| EKS OIDC Provider (sts:AssumeRoleWithWebIdentity)
|
AWS IAM Role (gistpin-backend-irsa)
|
IAM Policies (S3, DynamoDB, Secrets Manager)
| Component | File | Purpose |
|---|---|---|
| IAM Roles + Policies | infrastructure/terraform/irsa.tf |
AWS-side IRSA configuration |
| Service Accounts | infrastructure/k8s/service-accounts/backend-sa.yaml |
K8s-side annotations |
| Documentation | infrastructure/docs/workload-identity.md |
This document |
| Service Account | IAM Role | Permissions |
|---|---|---|
backend |
gistpin-backend-irsa |
S3 (read/write), DynamoDB (CRUD), Secrets Manager (read) |
frontend |
gistpin-frontend-irsa |
S3 (read), CloudFront (invalidation) |
tekton-worker |
gistpin-ci-irsa |
AdministratorAccess (CI only) |
- Create IAM role in
infrastructure/terraform/irsa.tfwith OIDC condition - Create ServiceAccount in
infrastructure/k8s/service-accounts/ - Annotate with
eks.amazonaws.com/role-arn - Update pods to use the new ServiceAccount
# Verify pod has the correct service account
kubectl get pod <pod-name> -n gistpin -o json | jq '.spec.serviceAccount'
# Verify IRSA is working (from within the pod)
aws sts get-caller-identity
# Check OIDC provider
aws iam list-open-id-connect-providersAll sts:AssumeRoleWithWebIdentity calls are logged to CloudTrail. Monitor for:
- AssumeRole calls from unexpected service accounts
- AssumeRole calls from unexpected namespaces
- Rate anomalies in AssumeRole calls