Interview Prep/DevSecOps/Cloud identity: IRSA, Workload Identity and CI OIDC

An IRSA role has `s3:GetObject` on the bucket, the policy simulator says allowed, yet the pod gets `AccessDenied`

AdvancedTroubleshootingCloud identity: IRSA, Workload Identity and CI OIDC
Answer

Likely causes → A deny or a missing grant in another policy layer. The bucket policy may deny unless aws:SourceVpce matches, the object may be SSE-KMS encrypted and the role lacks kms:Decrypt, a VPC endpoint policy may restrict buckets, or the object may be owned by another account with ACLs.

Diagnose →

aws s3api get-bucket-policy --bucket data-prod | jq -r .Policy | jq .
aws s3api head-object --bucket data-prod --key path/file   # ServerSideEncryption, SSEKMSKeyId
aws ec2 describe-vpc-endpoints --filters Name=service-name,Values=com.amazonaws.ap-south-1.s3 --query 'VpcEndpoints[].PolicyDocument'

CloudTrail's errorMessage for the call often names the layer.

Fix → Grant kms:Decrypt on the key (and add the role to the key policy if needed). Align the bucket and endpoint policies, and set Object Ownership to BucketOwnerEnforced.

Prevent → Test access paths end to end from inside the cluster in CI, not just in the simulator, which does not evaluate every layer.

All DevSecOps questions Roadmap: Supply chain, secrets & identity

More on Cloud identity: IRSA, Workload Identity and CI OIDC