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 →
- 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" } }
}
- Attach only the permissions they need (often a read-only managed policy such as
ReadOnlyAccessscoped down, orSecurityAudit). - Monitor their usage in CloudTrail and review it quarterly.
- 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.
More on Security incidents
An AWS access key for a production IAM user was pushed to a public GitHub repo 20 minutes ago. What do you do in the first 30 minutes?AdvancedYou find pods in your cluster running a crypto miner. What do you do?AdvancedA critical CVE is announced in a library you use. You have 200 images across 40 repos. How do you find and patch everything fast?IntermediateGuardDuty reports an EC2 instance talking to a known command-and-control IP. What do you do?AdvancedYou discover an S3 bucket with customer data has been public for three months. What now?IntermediateAn engineer left the company three weeks ago and you find their access key was used yesterday. How do you respond and fix the process?Beginner