AWS IAM & KMS Security Interview Questions
Reviewed by Mark Dickie · Last updated
6 questions on this page you can answer and see marked on the spot. Go to the first one
AWS IAM and KMS security are the access-control and encryption foundations of AWS: IAM decides who can do what, and KMS controls the customer-managed keys that protect data at rest. For an interview, you need to be sharp on three things: how IAM policies and resource-based policies combine (explicit deny wins, and a cross-account request needs permission on both sides), how KMS key policies differ from IAM policies (a KMS key policy must allow the caller either directly or by delegating to IAM through the root account statement), and when to use a KMS grant versus a key policy for short-lived delegation. The hardest questions blend both services: an EC2 instance whose IAM role allows kms:Decrypt still cannot decrypt an S3 object when the KMS key policy lists specific principals and does not delegate to IAM. With the default key policy, the role's IAM permission is enough.
How do IAM policies and KMS key policies interact?
A KMS customer-managed key has its own resource-based policy. For cross-account access, or when a key policy has no root delegation, use of the key requires permission in both the caller's IAM policy and the KMS key policy (or a grant). With the default key policy, the root statement lets IAM policies in the same account grant key use, so IAM alone is enough.
| Mechanism | Scope | Typical Use |
|---|---|---|
| IAM policy | Principal-centric | Grant an IAM user or role broad permissions across AWS |
| KMS key policy | Resource-centric | Define which principals can use a specific KMS key |
| KMS grant | Delegation | Give a service or user temporary, narrow key access without editing the key policy |
| KMS condition keys | Either | Restrict by encryption context, AWS service, or request source |
What should I study for an IAM + KMS interview?
- Policy evaluation logic — explicit deny, allow, and the interaction between identity-based and resource-based policies.
- KMS key types — AWS managed keys vs. customer managed keys vs. AWS owned keys, and when each applies.
- Encryption context — the non-secret key/value pairs that bind ciphertext to an application context and are evaluated during
Decrypt. - Grants — how they work, the
CreateGrantAPI, and why services like EBS and Lambda use them to decrypt on your behalf. - Cross-account access — the dual-permission requirement and the role of the key policy in allowing an external account.
- Least-privilege patterns — using condition keys like
kms:ViaService,kms:CallerAccount, andaws:SourceArnto tighten who can use a key.
The quiz below covers these areas with questions modeled on common interview topics.
Key facts
- Tarmac has 15 AWS interview questions on this topic, 10 of them on this page, at difficulty 1–5 of 5.
- Tarmac tracked 2,755 job postings asking for AWS in November 2026.
- Roles asking for AWS advertise a median base salary of £80,000, across 1,117 job postings as of November 2026.
- Tarmac last reviewed these AWS interview questions on 3 December 2026.
At a glance
| Questions | 10 shown · 15 in the bank |
|---|---|
| Difficulty | 1–5 of 5 |
| Formats | Multiple choice, True / false, Design exercise, Short answer, Flashcard, Ordering, Multiple answer, Fill in the blank |
What you'll review
- kms
Practice questions
Try one before you open the answer. Pick an option and press Check; it's marked on the spot.
What is the primary purpose of AWS Key Management Service (KMS)?#
Options
Show answer
AWS KMS (Key Management Service) is primarily used to create and manage cryptographic keys that encrypt and decrypt data across AWS services and custom applications. Secrets Manager handles credential storage, ACM manages TLS certificates, and Network Firewall or security groups handle traffic filtering.
AWS KMS is a managed service for creating and controlling customer master keys (CMKs / KMS keys) that encrypt and decrypt data. Storing database credentials and API tokens for runtime retrieval by applications describes AWS Secrets Manager, distributing SSL/TLS certificates to edge locations for HTTPS termination describes AWS Certificate Manager (ACM) with CloudFront, and blocking malicious network traffic at the VPC subnet boundary describes AWS Network Firewall or security groups.
True or false: The AWS KMS Encrypt API can directly encrypt a plaintext payload of up to 4 KB, so larger data is typically protected with envelope encryption using a data key generated by KMS.#
Options
Show answer
True. AWS KMS's Encrypt API accepts plaintext of up to 4 KB (4096 bytes) per call. Larger data is usually encrypted with envelope encryption: KMS generates a data key, the data is encrypted locally with that key, and only the encrypted data key is stored with the ciphertext.
The KMS Encrypt API has a plaintext size limit of 4096 bytes (4 KB). For anything larger, the standard pattern is envelope encryption: call GenerateDataKey, encrypt the data locally with the plaintext data key, and store the KMS-encrypted copy of that data key alongside the ciphertext. The statement is therefore true.
A small team stores customer invoices in an S3 bucket and wants them encrypted at rest with AWS KMS. Their security lead also asks for three things: being able to see who used the key, having the key's cryptographic material rotated automatically, and making sure that only the invoice-processing application's IAM role can decrypt the files. Sketch a basic design: which kind of KMS key to use, how S3 uses it, and how each of those three requirements is met.#
Show answer
Create a symmetric customer managed KMS key, for example alias/invoices. Use a customer managed key rather than the AWS managed aws/s3 key because the team needs to write its own key policy. On the bucket, set default encryption to SSE-KMS with this key's ARN, and turn on S3 Bucket Keys to reduce KMS request costs. When an object is uploaded, S3 asks KMS for a data key and stores the encrypted copy of that data key with the object. When the object is read, S3 calls KMS Decrypt on the caller's behalf. The key policy gives key administrators management rights only and allows kms:Decrypt and kms:GenerateDataKey only for the invoice-processor IAM role. Anyone else who has s3:GetObject still cannot read the files, because KMS refuses to decrypt for them. For auditing, CloudTrail records every KMS API call as an event containing the key ARN, the event name such as Decrypt or GenerateDataKey, the time, and the userIdentity of the calling principal, with the invokedBy field showing S3 when the call was made for a requester. The security lead filters CloudTrail events on the invoice key ARN and the Decrypt event name, then reads userIdentity to see which role or user used the key and when. Turn on automatic rotation so KMS creates new key material every year by default. KMS keeps the old key material, so invoices written before a rotation still decrypt without being re-encrypted.
The design uses a customer managed KMS key because only that kind lets the team write its own key policy. S3 default encryption set to SSE-KMS with the key's ARN makes S3 call KMS for data keys on writes and Decrypt on reads. The key policy grants kms:Decrypt only to the invoice-processor role, plus admin rights for key managers, so bucket readers without key permission cannot decrypt. CloudTrail is the audit source: each KMS call is logged with the key, event name, time, and caller identity, which the security lead can filter to see who used the key. Automatic rotation creates new key material yearly while KMS retains older material, so existing invoices remain readable.
An IAM role in account A needs to call kms:Decrypt on a customer-managed KMS key that belongs to account B. The role's IAM policy in account A already includes an Allow statement for kms:Decrypt on the key's ARN. Which additional condition must be met for the call to succeed?#
Options
Show answer
For a cross-account kms:Decrypt call, the KMS key policy in account B and the IAM policy in account A must both allow the action. The key policy has to name the account A role as a principal, because the key's policy is the root of trust for the key. An IAM Allow in account A alone is not enough, and the call is denied if either layer withholds permission.
KMS uses a dual-layer authorization model. The key policy attached to the KMS key in account B must explicitly permit the cross-account principal (the role in account A) to call kms:Decrypt. In addition, the caller's own IAM policy in account A must allow the action. Either layer can deny or withhold permission; both must allow for the call to succeed. The IAM policy alone is insufficient because the key policy is the root of trust for a KMS key — if it does not grant access to the external principal, the call is denied regardless of IAM.
Account A owns a customer managed KMS key. An IAM role in Account B must call kms:Decrypt on that key. Describe what must be configured in Account A and what must be configured in Account B for the call to succeed. Assume no grants are used.#
Show answer
In Account A, the key policy must allow Account B (the account root or the specific role) to use the key for kms:Decrypt. In Account B, an IAM policy attached to the role must allow kms:Decrypt on the key's ARN. Cross-account access needs both the key policy and the caller's IAM policy to allow the action; either one alone is insufficient.
For a KMS key in another account, the key policy is the resource-side control and must explicitly grant the external principal or account. The external caller also needs an identity-based IAM policy allowing kms:Decrypt on that key ARN, because access is only granted when both sides allow it. Granting only one side results in an AccessDeniedException, which is why a complete answer names both the key policy in Account A and the IAM policy in Account B.
In AWS KMS envelope encryption, what does the GenerateDataKey API return, and which copy of the data key encrypts the actual data?#
Show answer
GenerateDataKey returns two values: a plaintext data key and the same data key encrypted under the specified KMS key. The plaintext data key encrypts the data locally (for example, with AES-GCM), and then it is discarded from memory. The encrypted data key is stored alongside the ciphertext, and later it is sent to KMS Decrypt to recover the plaintext data key for decryption.
Envelope encryption avoids sending large payloads to KMS, which only encrypts small items up to 4 KB directly. GenerateDataKey gives the application a plaintext data key for fast local encryption, plus a wrapped copy that is safe to persist. Only the wrapped copy is stored with the ciphertext, so the plaintext key never needs to be kept at rest. Recovering the data requires calling KMS Decrypt on the wrapped key, which also enforces key policy and IAM access checks.
An application stores objects encrypted with envelope encryption: each object's payload is encrypted with a data key generated by AWS KMS, and the encrypted data key is stored alongside the ciphertext. Put the steps the client performs to decrypt one object into the correct order, from first to last.#
Put these in order
Show answer
To decrypt an envelope-encrypted object with AWS KMS, the client first reads the stored encrypted data key, then calls KMS Decrypt on it with the matching encryption context. It uses the returned plaintext data key to decrypt the payload locally, then discards that plaintext key from memory.
The client cannot ask KMS to decrypt anything until it has the encrypted data key, so it must first read that value from storage. It then calls KMS Decrypt with the matching encryption context to obtain the plaintext data key. Only after receiving that plaintext key can it decrypt the payload locally, since KMS is not used to decrypt the bulk object data. Finally, it should discard the plaintext data key from memory once decryption is complete, so the key is not left exposed.
You enable automatic key rotation on a symmetric encryption customer managed AWS KMS key. Over two years, it is used to encrypt data keys for millions of S3 objects. Which statements about what happens after rotation are correct? Select all that apply.#
Options
Pick every one that applies.
Show answer
AWS KMS automatic key rotation keeps the same key ID and ARN and keeps all earlier key material. Ciphertexts made before rotation still decrypt without re-encryption. Rotation does not re-encrypt existing data keys or data, and it does not create a new key or move an alias (that is manual rotation). Automatic rotation applies only to symmetric encryption keys, not asymmetric or HMAC keys.
Automatic rotation only creates new backing key material inside the same logical KMS key. New encrypt operations use the newest material. Each ciphertext records which material was used to make it, and KMS keeps every earlier version, so old ciphertexts still decrypt with no extra work. The key ID, ARN, aliases, and policies all stay the same. KMS does not re-encrypt data keys or data that already exist, so re-encrypting old envelopes is the application's job if it is needed. Automatic rotation is supported only for symmetric encryption keys, not for asymmetric or HMAC keys. A new key with a moved alias describes manual rotation, not automatic rotation.
An application running in AWS Account B (111111111111) uses IAM role AppRole to read objects from an S3 bucket in Account A (000000000000). Those objects were encrypted server-side using a customer-managed KMS key that resides in Account A. The application calls s3:GetObject, and S3 then calls kms:Decrypt on the caller's behalf using the key in Account A.#
Options
Pick every one that applies.
Show answer
Cross-account S3 reads of SSE-KMS objects need two permissions: a KMS key policy statement in the key's account that covers the caller, and an identity-based IAM policy on the caller allowing kms:Decrypt on the key ARN. Bucket policies and role assumption are not required, and KMS grants are not needed when the key policy already permits the principal.
For cross-account SSE-KMS, S3 makes the kms:Decrypt call using the caller's credentials, so KMS evaluates both the key policy in Account A and the caller's identity-based IAM policy in Account B. Both must allow the action: the key policy needs a statement that covers AppRole (either naming AppRole's ARN directly or naming Account B so that IAM delegation applies), and AppRole's IAM policy must allow kms:Decrypt on the key ARN. The option requiring an IAM policy on AppRole to allow kms:Decrypt is therefore required, and so is the key-policy grant. The option about assuming a cross-account role is wrong because AppRole calls S3 with its own credentials and no role assumption is needed. The option about bucket policies is wrong because bucket policies do not grant KMS permissions; KMS authorization comes only from the key policy and the caller's IAM policy. The option about the root principal of Account A is wrong because a key policy naming AppRole (or Account B) directly works without it, and Account A's root grants nothing to Account B principals.
A batch service needs a data key for envelope encryption, but it must not hold any plaintext data key while work sits in its queue. It should request a data key from AWS KMS that returns only the encrypted copy. Name that KMS API operation: _____. Later, when a worker needs the usable plaintext data key from that ciphertext, it calls the KMS API operation _____. Give the operation names exactly as they appear in the AWS KMS API reference, without an SDK prefix.#
Show answer
A batch service needs a data key for envelope encryption, but it must not hold any plaintext data key while work sits in its queue. It should request a data key from AWS KMS that returns only the encrypted copy. Name that KMS API operation: GenerateDataKeyWithoutPlaintext. Later, when a worker needs the usable plaintext data key from that ciphertext, it calls the KMS API operation Decrypt. Give the operation names exactly as they appear in the AWS KMS API reference, without an SDK prefix.
GenerateDataKey returns both a plaintext data key and its encrypted copy, so the caller holds plaintext key material immediately. GenerateDataKeyWithoutPlaintext returns only the encrypted data key, which lets a service persist or queue the ciphertext without ever holding plaintext key material. Because the plaintext is absent, the worker must later call Decrypt with that ciphertext under the same KMS key to recover the usable data key. The caller needs the separate kms:GenerateDataKeyWithoutPlaintext and kms:Decrypt permissions for these two calls.
Related interview questions
Job market
See aws salaries and hiring demand from live job postings.
The other 5 questions
This page shows 10 and marks what you pick. That's as far as a page can go. A free account opens the other 5 and keeps every answer. What you miss comes back until it's right: after a day, then at longer gaps.
Free · the whole bank · 100 answers per 30 days, each marked with written feedback