Skip to content
Tech Interview Prep
Technical interview guide

Cloud IAM Policy Design

Writing least-privilege access policies for cloud resources, and avoiding the common over-permissioning failure modes.

Read
44 min
Practice MCQs
25
Interview Q&A
25
Edition
v4
Editorial status
Reviewed

Scope: AWS IAM, Google Cloud IAM, Azure RBAC/managed identity, and NIST SP 800-207 guidance current 2026-08-31.

Curated: · Written: · Reviewed:

25 questions

MCQ-2A developer's IAM role has an identity policy that allows s3:DeleteObject on a bucket. The account is in an OU with an SCP that explicitly denies s3:DeleteObject on all resources. The developer calls DeleteObject and receives AccessDenied. Which explanation is correct?
MCQ-16An OU's SCP contains one statement (Effect: Allow, Action: ["s3:*", "dynamodb:*"], Resource: "*") and the default FullAWSAccess policy has been detached. A developer in a member account of that OU holds an IAM policy granting ec2:DescribeInstances and nothing else, and calls DescribeInstances. What happens, and why?
MCQ-13A company's AWS Organizations root has an SCP with a Deny statement for all actions where `aws:RequestedRegion` is not `us-east-1` or `us-west-2`. A Lambda function in member account 444455556666 runs in `eu-west-1`; its execution role has an IAM policy allowing `s3:PutObject` on `arn:aws:s3:::app-bucket/*`. Its `PutObject` calls fail with AccessDenied. What is the most likely cause and the correct fix?
MCQ-3An IAM role `media-reader` has one identity-based policy `MediaAccess` that allows `s3:GetObject`, `s3:PutObject`, and `s3:DeleteObject` on `arn:aws:s3:::media/*`. A permissions boundary `MediaBoundary` is attached that allows `s3:GetObject` and `s3:DeleteObject` on `arn:aws:s3:::media/*`. No other policies apply. The role calls all three actions on `arn:aws:s3:::media/clip.mp4`. Which calls succeed?
MCQ-25A workload calls sts:AssumeRole and passes a session policy that allows only s3:GetObject on one bucket, while the role's identity-based policy allows s3:* on every bucket in the account. How does the session policy affect the permissions of the resulting session?
MCQ-4A Lambda function runs under an execution role in account 111122223333. The role has one identity policy: Allow s3:GetObject on arn:aws:s3:::reports/*. A permissions boundary attached to the role allows s3:GetObject on arn:aws:s3:::reports/2024/*. The account's SCP allows s3:GetObject on arn:aws:s3:::reports/* and contains no denies. The reports bucket policy grants nothing to this role. The function calls GetObject for reports/2023/annual.csv. What is the effective result?
MCQ-17A nightly job fails with `AccessDenied` for `s3:PutObject` on `arn:aws:s3:::reports/2024/q3.csv`. The role's identity policy is a legacy `s3:*` on `*`; its permission boundary allows only `s3:GetObject` on `arn:aws:s3:::reports/*`; the account SCP has no S3 statements; the bucket policy already allows the role. The release window closes in 20 minutes. Which change should be rejected?
MCQ-7A nightly batch job lists and reads objects under the 2024/ prefix of the reports-bucket S3 bucket. After a least-privilege review, its IAM role policy has exactly two statements: Allow s3:GetObject on arn:aws:s3:::reports-bucket/2024/*, and Allow s3:ListBucket on arn:aws:s3:::reports-bucket/2024/*. The job now fails with AccessDenied on the ListObjectsV2 call, while GetObject calls for keys it already knows still succeed. What change fixes the listing failure?
MCQ-1A Lambda function `invoice-render` runs under the IAM role `invoice-render-role` in account 111122223333, region eu-west-1. On each run it calls `ListObjectsV2` on `s3://acme-invoices/incoming/`, calls `GetObject` on every key it lists, and calls `PutItem` once per invoice into the DynamoDB table `acme-invoices`. The team's rule is that the grant must let the function run and must not allow any action or resource the function does not use. Which grant should the team write?
MCQ-24A nightly job runs as a CronJob in the EKS namespace media on the prod-eu cluster under the Kubernetes service account media-processor, and the cluster has IRSA configured. The code makes exactly three AWS calls: s3:GetObject on objects under s3://acme-media/incoming/, s3:PutObject on objects under s3://acme-media/outgoing/, and dynamodb:PutItem on the table media-jobs in eu-west-1. Security's rule is that the pod's role must not be able to use any action, or reach any resource, outside those three calls. Which role setup satisfies the rule?
MCQ-23An external CI account assumes a role in your account with `sts:AssumeRole`. The trust policy already lists the CI role ARN as the principal, permits `sts:AssumeRole` and `sts:TagSession`, and its effect is `Allow`. A new requirement: the call must fail unless the caller attaches the session tag `project=payments` and sets a source identity. Which element of the trust policy enforces that?
MCQ-18A team runs three services in one EKS cluster (`checkout`, `reporting` and `ledger`, all in namespace `apps`) each with its own ServiceAccount and its own IAM role created by `eksctl`. The `ledger` role's trust policy is: ```json { "Version": "2012-10-17", "Statement": [{ "Effect": "Allow", "Principal": {"Federated": "arn:aws:iam::111122223333:oidc-provider/oidc.eks.us-east-1.amazonaws.com/id/EXAMPLED539D4633E53DE1B71EXAMPLE"}, "Action": "sts:AssumeRoleWithWebIdentity", "Condition": {"StringEquals": {"oidc.eks.us-east-1.amazonaws.com/id/EXAMPLED539D4633E53DE1B71EXAMPLE:aud": "sts.amazonaws.com"}} }] } ``` A compromised dependency inside the `reporting` pod reads its projected token at `/var/run/secrets/eks.amazonaws.com/serviceaccount/token` and calls `sts:AssumeRoleWithWebIdentity` with the `ledger` role's ARN. What happens?
MCQ-8A monitoring vendor runs one IAM role in its own account and asks each customer to trust that role so it can assume a role in the customer's account and read metrics. The vendor's service reads the target role ARN from a per-tenant config record. During onboarding, a new customer pastes a role ARN that belongs to an existing customer; the vendor's service assumes it and starts pulling the existing customer's metrics. Which change prevents this specific failure?
MCQ-19A CI job in account B assumes arn:aws:iam::111122223333:role/DeployRole in account A. The role's trust policy names account B's root as principal, the role's permissions policy allows s3:PutObject on the artifacts bucket, and the deploy-bot's identity policy in account B allows sts:AssumeRole on that role ARN. The job needs a four-hour session, calls AssumeRole with DurationSeconds=14400, and gets ValidationError: The requested DurationSeconds exceeds the MaxSessionDuration set for this role. The role's MaxSessionDuration is still at its default. Which change makes the call succeed?
MCQ-5A Python batch job (boto3) runs for 90 minutes. At startup it calls sts.assume_role with DurationSeconds=3600, takes resp['Credentials'], and passes those keys explicitly to every client it builds. At about minute 60 the job starts failing with ExpiredToken errors. The role's MaxSessionDuration is the AWS default. Which change fixes the failure?
MCQ-10An engineer requests just-in-time elevation at 09:00; a peer approves it and the grant expires 60 minutes later. The JIT system implements elevation by adding the engineer to the `prod-admin` group in the identity provider, and the engineer's CLI obtains an OIDC token at 09:00 with a 12-hour lifetime that embeds the group claims. At 16:30, in the same shell, an admin command succeeds. The group membership was removed at 10:00 as scheduled. What is the correct explanation?
MCQ-9A company federates AWS console access through its identity provider; permission sets use 1-hour sessions, and offboarding disables the directory account on the engineer's last day. Three weeks after an engineer leaves, CloudTrail shows `GetObject` calls on an internal S3 bucket made with the AWS CLI and signed by that engineer's credentials, from an IP outside the corporate range. The engineer's laptop and MFA device were returned on the last day. What most likely explains the calls?
MCQ-11A bucket policy grants s3:GetObject only when aws:ResourceTag/Project equals aws:PrincipalTag/Project. The bucket holds objects tagged Project=falcon and Project=heron. The dev-falcon role carries the session tag Project=falcon, and its identity policy also grants s3:PutObjectTagging on the bucket's objects. An engineer in that role retags a heron object to Project=falcon, then calls GetObject on it. What happens?
MCQ-22A principal holds `iam.serviceAccounts.actAs` on SA-A (`roles/editor`) and `iam.serviceAccounts.getAccessToken` on SA-B (`roles/viewer`), and can redeploy a Cloud Run service. Which action gives it editor-level access?
MCQ-6Project `prod-42` has service account `deployer@prod-42.iam.gserviceaccount.com` with `roles/editor` at project level. Engineer Ana holds no project-level roles. Twelve minutes after Ana is granted `roles/iam.serviceAccountTokenCreator` on `deployer@prod-42`, a firewall rule opening 0.0.0.0/0 to port 22 appears, and the audit entry's principal is `deployer@prod-42.iam.gserviceaccount.com`. Which explanation of the firewall change is correct?
MCQ-12A platform team adds a deny rule to a project's IAM deny policy that denies `storage.objects.delete` for all principals. The rule's CEL condition references an attribute that some API calls do not populate, so for those calls the expression cannot be evaluated. How does IAM treat the rule on those requests?
MCQ-14A platform team's nightly pipeline creates 240 role assignments across 12 subscriptions. It resolves each role by display name: it lists the subscription's role definitions and matches on `roleName`. A custom role was renamed from `Billing Reader` to `Billing Viewer` last week. Since then the apply still exits 0, but 40 assignments in the plan are never created: the name lookup returns an empty list and the loop skips those entries. The tenant's naming committee renames custom roles about every quarter, so the team wants a fix that keeps creating the intended assignments across future renames, without changing which principals get which role. What should they change?
MCQ-15A quarterly access review is cutting standing permissions in one AWS account that holds 500 IAM roles. Their only telemetry is CloudTrail Event History, which tracks the trailing 90 days of management events. A query for last-accessed data returns 190 roles with no events recorded in that window. Of those, 60 are driven by a batch job that runs every 120 days; 90 are used only to read and write S3 objects; the remaining 40 have no owner tag and no runbook entry. How many of the 190 are in use but absent from Event History because the retention window is shorter than their usage period?
MCQ-21A payments company's internal admin API has one access control: a source-IP allowlist for 10.20.0.0/16. Any request from that range runs with full admin scope and is logged with the principal "internal"; no credential is examined, and no admin API credential is stored on employee laptops. An engineer's laptop at 10.20.7.44 was compromised while its owner's VPN session was live, and over 26 days the attacker's process on that laptop issued 4,000 calls to the API, pulling 120,000 rows across all tenants. Which change removes the mechanism that authorized those calls, rather than making them rarer or noisier?
MCQ-20A payments company runs all production access through one SSO provider. During a 3-hour SSO outage, the on-call engineer could not retrieve the break-glass database credential: it lives in a vault whose login page failed for the whole outage. The credential is a shared static password, rotated quarterly, and retrieval sends no alert. Security policy allows only one identity provider. Which change fixes the outage failure while keeping the emergency path accountable?