Skip to content
Tech Interview Prep
Technical interview guide

IAM & Security Fundamentals

The principle of least privilege, and how roles/policies enforce it instead of relying on long-lived credentials.

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

Scope: Vendor-neutral IAM fundamentals with AWS IAM, STS, Access Analyzer, CloudTrail, and KMS references accessed 2026-08-30..

Curated: · Written: · Reviewed:

25 questions

MCQ-9A role's identity policy grants `rds:DescribeDBInstances` and `rds:DeleteDBInstance`. Its permissions boundary grants `rds:DescribeDBInstances` and `rds:CreateDBInstance`. Which `rds` calls does the role allow?
MCQ-10An AWS Organizations OU has one SCP attached: `{"Effect":"Allow","Action":"dynamodb:*","Resource":"*"}`. In member account 111122223333, the role `app-writer` has one identity policy granting `dynamodb:GetItem` and `dynamodb:Query` on `arn:aws:dynamodb:us-east-1:111122223333:table/orders`. The role has no permissions boundary and no session policy. The application assumes the role and calls `dynamodb:PutItem` on that table, and the call returns `AccessDeniedException`. What is the correct diagnosis?
MCQ-7Account 111122223333 runs a Lambda function that assumes the role `report-reader` with no session policy. The role has one identity-based policy: - Allow `s3:GetObject` on `arn:aws:s3:::reports/*` - Allow `s3:GetObject` on `arn:aws:s3:::archive/*` The role also has a permissions boundary policy: - Allow `s3:GetObject` on `arn:aws:s3:::reports/*` The account's SCP is the default `FullAWSAccess`. The `archive` bucket is in the same account and has no bucket policy. The function calls `s3:GetObject` on `arn:aws:s3:::archive/2023/q4.csv`. What is the result?
MCQ-8Account 111122223333 sits in an OU whose SCP contains two statements: Allow s3:* on Resource *, and Deny s3:PutObject on Resource arn:aws:s3:::reports/archive/*. The role report-writer has an identity policy allowing s3:PutObject on arn:aws:s3:::reports/* and a permissions boundary allowing s3:PutObject on arn:aws:s3:::reports/*. The role calls PutObject on arn:aws:s3:::reports/finance/q3.csv. What is the effective decision for this call?
MCQ-4A nightly job runs on an EC2 instance with an instance profile. The role's policy allows s3:GetObject on arn:aws:s3:::analytics/raw/*. The job reads known keys fine, but its first call, ListObjectsV2 on prefix raw/, returns AccessDenied. What explains the failure?
MCQ-6A service reads tenant objects from `s3://acme-data/tenants/<tenantId>/...`. Tenant IDs are numeric strings, and `7`, `70` and `700` are all live. The role's only statement is: ```json {"Effect": "Allow", "Action": "s3:GetObject", "Resource": "arn:aws:s3:::acme-data/tenants/7*"} ``` A test using tenant 70's session returns 200 for `tenants/70/report.csv`. Which edit restricts the statement to tenant 7's objects?
MCQ-1DELETE /orders/42 reaches the orders service. The gateway log reads jwt_verified=true exp_ok=true scope=[orders:write] decision=forward. The service then authorizes with one ABAC engine, evaluated as deny-overrides: every rule runs, and any matching deny beats every allow. R1 allow if sub == resource.owner_id R2 allow if orders:admin in token.scope R3 deny if now - resource.created_at > 86400 s Token: sub=u_17, scope=[orders:read, orders:write]. Order 42: owner_id=u_17, created_at=now-90000 s. The response is 403. Which control produced the 403?
MCQ-12Account 111122223333 runs a CI job as the role `arn:aws:iam::111122223333:role/ci-runner`. The job calls `sts:AssumeRole` on `arn:aws:iam::444455556666:role/DeployRole` and gets AccessDenied. The ci-runner role's identity policy already allows `sts:AssumeRole` on that role ARN, and DeployRole's trust policy lists `arn:aws:iam::111122223333:user/ci-deploy` as its principal. Which change makes the call succeed?
MCQ-11A build job in account 444455556666 assumes the role ci-deployer in account 111122223333. The AssumeRole call succeeds and sts:GetCallerIdentity returns arn:aws:sts::111122223333:assumed-role/ci-deployer/build. The next call, s3:PutObject on the deploy bucket in account 111122223333, returns AccessDenied. The ci-deployer trust policy names arn:aws:iam::444455556666:root as its principal with no conditions. Where does the change belong?
MCQ-13A monitoring vendor's service assumes a role in each customer's AWS account to read metrics; every customer's trust policy names the same vendor role as Principal. A bug in the vendor's scheduler occasionally runs customer A's job with customer B's assumed-role session, and the role's permissions let it read B's data. Which control most directly prevents that mix-up?
MCQ-25GitHub Actions issues OIDC tokens from one shared issuer (`token.actions.githubusercontent.com`) for every repository on GitHub, and each workflow can request any audience. Your org has 400 repositories, but only `acme/payments-api` may assume the production deploy role, and only from a push to `main`. The deploy job declares no GitHub Environment. Which trust policy should the role use?
MCQ-2A company runs 45 AWS accounts under AWS Organizations. Engineers hold no IAM users; they sign in through IAM Identity Center, and each permission set issues an 8-hour session. An engineer signs in at 08:30, and the AWS CLI caches the resulting role credentials on their laptop. At 10:00 the laptop is compromised and only that cached credential file is copied off. The attacker has no identity-provider login and no MFA device. When do those credentials stop working?
MCQ-5A payments service on EC2 calls S3 and DynamoDB using credentials from `sts:AssumeRole` with `DurationSeconds=3600`. The role's identity policy grants `s3:*` and `dynamodb:*` on `*`; the role has no permissions boundary and no session policy is passed at `AssumeRole` time. A developer commits the current session's credentials to a public repository. Which statement describes the security benefit the team actually gets from those credentials being temporary?
MCQ-24An IAM user for CI holds a single access key. At 09:00 that key is pushed to a public repository. CloudTrail shows the key called sts:AssumeRole at 09:05 against a role whose MaxSessionDuration is 43200 seconds, and called iam:CreateAccessKey at 09:07, which returned a second active key on the same user. At 09:20 the on-call engineer deactivates the original key. Which access still works after 09:20?
MCQ-21An alert fires on an unexpected sts:AssumeRole into a production admin role. The role's trust policy does not require sts:SourceIdentity, and the review must establish both who assumed the role and what the resulting session did. Which audit fields should the investigation start from?
MCQ-17A payments service opens a pool of 40 Postgres connections at startup and reads its database password once from Vault into memory. Ops rotates the password in Vault and immediately reconfigures the database to accept only the new value. Requests keep succeeding for a few minutes, then every request fails with 'password authentication failed for user payments'. Which explanation fits?
MCQ-16A service reads its database password from a managed secret store once at process start and caches it for the life of the process. Rotation runs every 12 hours: it sets a new password on the database user, and the previous password stops authenticating 60 seconds later. The service runs 30 pods, each with a pool of 10 connections, and pods restart only on the weekly deploy. What happens at the first rotation after a deploy?
MCQ-14An incident review covers the takeover of one of a company's 45 privileged admin accounts. The company requires FIDO2 security keys for those accounts, but the IdP still lists TOTP as a second-factor option so an admin who has lost a key can sign in. Last week an attacker signed in as one admin from an unfamiliar host and spent 40 minutes in the admin console. The sign-in log records the second factor as a one-time code, and the admin's key was in her desk drawer the whole time. Which change closes the path the attacker used?
MCQ-15A platform team is writing the access policy for a cloud account's root identity. The account must stay recoverable if an IAM policy locks everyone out, and the auditor requires that every use of root be attributable to a named person. Which arrangement should the policy specify?
MCQ-22During a 40-minute Okta outage last month, the on-call SRE used the break-glass IAM user `bg-1` to reach the production AWS account and fixed the incident in 22 minutes. `bg-1` has `AdministratorAccess`, its password sits in a sealed envelope in the office safe, and no CloudTrail alerting is configured on it. The post-incident review's top finding was that the security team learned of the use 3 days later from a manual log review, not that the access itself was wrong. Which change best addresses that finding while keeping the path usable during the next Okta outage?
MCQ-19A developer's IAM user has no permissions on the production S3 bucket, but holds iam:PassRole on * and lambda:UpdateFunctionConfiguration on a reporting function. They repoint the function at a role that can read the bucket. What have they gained?
MCQ-20An external-access analyzer is configured at the organization level for organization `o-abc`, which contains accounts `111111111111`, `222222222222`, and `333333333333`. Account `444444444444` is not in the organization. The analyzer scans four S3 bucket policies: - Bucket `a` (account `111111111111`): `Allow s3:GetObject` to `arn:aws:iam::222222222222:root` - Bucket `b` (account `111111111111`): `Allow s3:GetObject` to `arn:aws:iam::444444444444:root` - Bucket `c` (account `222222222222`): `Allow s3:GetObject` to `arn:aws:iam::111111111111:role/App` - Bucket `d` (account `333333333333`): `Allow s3:GetObject` to `*` Which buckets produce an Active finding?
MCQ-3A team ships an internet-facing service whose task role grants Action:* on Resource:*, with a ticket to narrow it 'after launch, once we see what it calls.' No follow-up date is set. What is the strongest objection to shipping this way?
MCQ-18A document platform's RBAC has grown to 380 roles, one per customer-project pair, and every new project adds another. All access rules have the same shape: a user may read a document when the user's department matches the document's owning department and the user's clearance is at least the document's classification. The identity provider already maintains department and clearance for every employee, and documents are tagged with the same taxonomy at upload. Which change should the team make?
MCQ-23A service writes 40 million 8 KB objects a day, each of which must be encrypted under a KMS-managed key. Which design should the team adopt?