A partner needs access to one S3 bucket in your account. How do you set up cross-account access safely?
IntermediateScenarioCloud IAM and Compliance
Answer
Situation read → Do not create IAM users for partners. Use a role with a trust policy and an external ID.
What I'd do →
- Create a role trusting the partner's account with an
sts:ExternalIdcondition:
"Condition": { "StringEquals": { "sts:ExternalId": "c2f1-partner-unique-id" } }
- Attach a policy allowing only the needed actions on that bucket and prefix.
- Optionally add a bucket policy limiting access to that role.
- Monitor
AssumeRoleevents from the partner account.
Why → The external ID prevents the confused deputy problem when a third party serves many customers.
Interview tip → Say "confused deputy" when you explain the external ID.
More on Cloud IAM and Compliance
You find an IAM policy with `"Action": "*", "Resource": "*"` attached to an application role. How do you right-size it?BeginnerYour company has 40 AWS accounts with no central controls. How do you set up preventive guardrails?IntermediateGuardDuty reports `UnauthorizedAccess:IAMUser/InstanceCredentialExfiltration.OutsideAWS`. What happened and what do you do?AdvancedYour company must pass SOC 2 Type II in six months. What does DevOps own, and how do you automate evidence?IntermediateSomeone logged in with the AWS root user last night. How do you react, and how should you have known?BeginnerHow do you collect logs from 40 accounts so an attacker in one account cannot delete them?Intermediate