A third-party vendor needs access to your AWS account to run their monitoring tool. How do you grant it?

BeginnerScenarioSecurity incidents
Answer

Situation read → Never create an IAM user with keys for a vendor. Use a cross-account role they assume, with an external ID and least privilege.

What I'd do →

  1. Create a role trusting the vendor's AWS account, requiring an external ID (protects against the confused deputy problem).
{
  "Effect": "Allow",
  "Principal": { "AWS": "arn:aws:iam::999988887777:root" },
  "Action": "sts:AssumeRole",
  "Condition": { "StringEquals": { "sts:ExternalId": "acme-7f3e9c" } }
}
  1. Attach only the permissions they need (often a read-only managed policy such as ReadOnlyAccess scoped down, or SecurityAudit).
  2. Monitor their usage in CloudTrail and review it quarterly.
  3. Document an off-boarding step: delete the role when the contract ends.

Why → Role assumption gives short-lived credentials you can revoke instantly, with no secret to leak.

Interview tip → Explain the external ID; it stops another customer of the same vendor from tricking them into accessing your account.

All Real-World Interview questions Roadmap: Interview readiness

More on Security incidents