Interview Prep/DevSecOps/Cloud IAM and Compliance

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 →

  1. Create a role trusting the partner's account with an sts:ExternalId condition:
"Condition": { "StringEquals": { "sts:ExternalId": "c2f1-partner-unique-id" } }
  1. Attach a policy allowing only the needed actions on that bucket and prefix.
  2. Optionally add a bucket policy limiting access to that role.
  3. Monitor AssumeRole events 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.

All DevSecOps questions Roadmap: Policy as code

More on Cloud IAM and Compliance