Courseiva

CCNA Identity and Access Management Questions

75 of 166 questions · Page 1/3 · Identity and Access Management · Answers revealed

1
MCQhard

A large enterprise uses AWS Organizations to manage multiple accounts. The security team has implemented a Service Control Policy (SCP) at the root level that denies all actions unless the request originates from the corporate IP range (10.0.0.0/8). Recently, a developer in a member account tried to launch an EC2 instance from the AWS Management Console while connected via a VPN that provides an IP address within the corporate range. However, the launch failed with an 'AccessDenied' error. The developer is using an IAM user with full EC2 permissions (ec2:*). The SCP is as follows: {"Version":"2012-10-17","Statement":[{"Effect":"Deny","Action":"*","Resource":"*","Condition":{"NotIpAddress":{"aws:SourceIp":"10.0.0.0/8"}}}]}. What is the MOST likely reason for the failure?

A.The SCP allows actions only from the specified IP range, but the developer's IP is not in that range.
B.The SCP does not apply to IAM users in member accounts; it only applies to the root user.
C.The aws:SourceIp condition key does not work correctly for requests made via the AWS Management Console because the console may use a different IP.
D.The IAM user does not have the necessary permissions because the SCP explicitly denies all actions.
AnswerC

The console may use intermediary IPs; the source IP condition is not reliable for console access.

Why this answer

The SCP uses the aws:SourceIp condition, but when accessing the Management Console, the IP address seen by AWS is the console's IP, which may not be the same as the developer's VPN IP if the console uses a proxy or if the VPN is configured incorrectly. Option A is wrong because SCPs affect all principals, including the root user. Option B is wrong because the SCP denies actions, not allows them; an explicit deny overrides allows.

Option D is wrong because the SCP denies all actions, so even if the developer has permissions, the SCP denies them.

2
MCQeasy

A developer needs to allow an EC2 instance to access an S3 bucket. Which is the best practice for granting permissions?

A.Store IAM user access keys in a configuration file on the EC2 instance.
B.Use a security group to allow the EC2 instance to access S3.
C.Attach an S3 bucket policy that grants access to the EC2 instance ID.
D.Create an IAM role with S3 access and attach it to the EC2 instance profile.
AnswerD

The instance assumes the role and obtains temporary credentials automatically.

Why this answer

An IAM role with S3 access attached to the EC2 instance profile provides temporary credentials via the instance metadata service, eliminating the need for long-term access keys. Option A is wrong because storing IAM user access keys on the instance is insecure and violates best practices. Option B is wrong because security groups control network traffic, not IAM permissions.

Option C is wrong because an S3 bucket policy cannot grant access based on an EC2 instance ID; the principal must be an IAM user, role, or AWS account.

3
MCQmedium

A company is using AWS Organizations with multiple accounts. The security team wants to ensure that no IAM user in any account can create new IAM users. Which approach should be used?

A.Apply an IAM policy to the root user of each account.
B.Use an SCP attached to each IAM user.
C.Use an IAM permissions boundary on each IAM user.
D.Apply a service control policy (SCP) at the root organizational unit that denies IAM:CreateUser.
AnswerD

SCPs can deny actions across all accounts in the organization.

Why this answer

Service control policies (SCPs) are the correct mechanism because they allow you to centrally restrict permissions across all accounts in an AWS Organization. By attaching an SCP at the root organizational unit that denies the `iam:CreateUser` action, you ensure that no IAM user in any member account can create new IAM users, regardless of any IAM policies applied within those accounts. SCPs act as a guardrail that overrides any allow permissions granted by IAM policies.

Exam trap

The trap here is that candidates often confuse SCPs with IAM permissions boundaries or think SCPs can be attached directly to IAM users, but SCPs only apply to accounts or organizational units and are designed for centralized governance across an AWS Organization.

How to eliminate wrong answers

Option A is wrong because the root user of each account is not subject to IAM policies; the root user has full administrative access and cannot be restricted by IAM policies. Option B is wrong because SCPs are attached to AWS accounts or organizational units, not to IAM users; attaching an SCP to an IAM user is not a valid operation. Option C is wrong because an IAM permissions boundary only limits the maximum permissions an IAM user can have, but it does not prevent the user from creating other IAM users if the boundary allows it; it is not a global deny mechanism across accounts.

4
MCQhard

An organization wants to enforce that all IAM users use MFA. The security team creates an IAM policy that denies all actions unless MFA is present. However, some users report they cannot even change their own password to enable MFA. What should the security team do to resolve this?

A.Add a statement that allows all actions when MFA is present.
B.Add an exception statement that allows iam:ChangePassword without MFA.
C.Assign the policy only after users have enabled MFA.
D.Remove the MFA condition from the policy.
AnswerB

Allows users to set up MFA by changing their password first.

Why this answer

IAM users need the ability to change their password to set up MFA even when MFA is not yet enabled. The policy should include an exception for the iam:ChangePassword action to allow this action without MFA. Option A would allow all actions without MFA, defeating the purpose of enforcement.

Option C is impractical as users without MFA cannot access the console to enable it. Option D removes MFA enforcement entirely, violating the requirement.

5
MCQmedium

A company wants to allow an IAM user to manage only their own access keys. Which IAM policy should be attached to the user?

A.{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Action":"iam:*AccessKey*","Resource":"arn:aws:iam::*:user/*"}]}
B.{"Version":"2012-10-17","Statement":[{"Effect":"Deny","Action":"iam:*AccessKey*","Resource":"*"}]}
C.{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Action":"iam:*AccessKey*","Resource":"arn:aws:iam::*:user/${aws:username}"}]}
D.{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Action":"iam:*AccessKey*","Resource":"*"}]}
AnswerC

Restricts to the user's own access keys using a resource ARN with a condition variable.

Why this answer

The IAM policy uses the ${aws:username} variable in the Resource element. When this policy is attached to a user, ${aws:username} resolves to that user's username, thereby restricting the actions to only that user's own access keys. Option A allows access to all users' keys.

Option B denies all AccessKey actions. Option D allows all AccessKey actions without restriction.

6
MCQeasy

A company uses IAM roles for EC2 instances to access DynamoDB. The security team wants to ensure that the instances can only access specific DynamoDB tables. They create an IAM policy that allows dynamodb:GetItem and dynamodb:PutItem on the specific table ARN. The policy is attached to the instance role. However, when an application on the instance tries to read from the table, it receives an 'AccessDeniedException'. The application is using the correct table name. What is the MOST likely cause?

A.The IAM policy is not attached to the instance profile.
B.The DynamoDB table is encrypted with a customer managed key that the role does not have access to.
C.The policy does not include dynamodb:DescribeTable action.
D.The instance does not have the required instance profile associated.
AnswerC

Many SDKs need DescribeTable.

Why this answer

Many AWS SDKs require the dynamodb:DescribeTable action to retrieve table metadata such as key schema and throughput settings. Without this permission, the SDK cannot execute operations like GetItem or PutItem, resulting in an AccessDeniedException. Option A is incorrect because the policy attachment is described as correct.

Option B is incorrect because encryption permissions are not the issue here; the error is about table actions. Option D is incorrect because the instance profile is associated correctly.

7
MCQeasy

An administrator needs to grant an IAM user the ability to change their own password without allowing them to change other users' passwords. Which IAM action should be included in the policy?

A.iam:CreateLoginProfile
B.iam:UpdateAccountPasswordPolicy
C.iam:UpdateServiceSpecificCredential
D.iam:ChangePassword
AnswerD

Allows the user to change their own password.

Why this answer

The correct action is iam:ChangePassword (option D). This action allows an IAM user to change their own password. Option A (iam:CreateLoginProfile) is typically used to create a login profile for a user, which includes setting a password, but it is not the standard way to allow a user to change their own password; iam:ChangePassword is the specific action for self-service password changes.

Option B (iam:UpdateAccountPasswordPolicy) is for modifying the account-level password policy, not individual passwords. Option C (iam:UpdateServiceSpecificCredential) is for managing credentials for specific services, not passwords.

8
Multi-Selectmedium

A security engineer is designing a solution to allow a Lambda function to write logs to CloudWatch Logs. Which TWO actions are required in the IAM execution role? (Choose TWO.)

Select 2 answers
A.logs:GetLogEvents
B.logs:PutLogEvents
C.logs:CreateLogStream
D.logs:PutRetentionPolicy
E.logs:CreateLogGroup
AnswersB, E

Needed to write log events.

Why this answer

The correct options are B and E. To allow a Lambda function to write logs to CloudWatch Logs, the IAM execution role must include permissions to create a log group (logs:CreateLogGroup) if it does not already exist and to put log events (logs:PutLogEvents). While logs:CreateLogStream is also typically required, the question asks for TWO actions, and of the given options, B and E are the necessary ones.

Option A (logs:GetLogEvents) is for reading logs, C (logs:CreateLogStream) is also needed but not listed as a correct choice in this two-answer scenario, and D (logs:PutRetentionPolicy) configures retention, not writing.

9
Multi-Selectmedium

A security engineer is designing IAM policies for a data analytics platform that uses Amazon S3, Amazon Athena, and AWS Glue. The platform must allow data scientists to query data in S3 using Athena, but only from specific VPC subnets. Additionally, the data must be encrypted at rest using AWS KMS. Which TWO actions should the engineer take to meet these requirements? (Choose TWO.)

Select 2 answers
A.Grant kms:Decrypt permission in the IAM policy and configure the KMS key policy to allow the IAM role to use the key.
B.Add kms:EncryptionContext condition to the IAM policy to require a specific encryption context.
C.Create a VPC endpoint for Athena and attach a bucket policy that restricts access to that endpoint.
D.Use the s3:SourceIp condition key in the IAM policy to restrict access to the private IP ranges of the VPC subnets.
E.Enable default encryption on the S3 bucket using SSE-S3 and configure the KMS key policy to allow the IAM role.
AnswersA, C

Correct – Provides kms:Decrypt permission and ensures the KMS key policy allows the IAM role, enabling Athena to decrypt objects encrypted with a customer-managed KMS key.

Why this answer

A: Correct – Granting kms:Decrypt permission in the IAM policy and ensuring the KMS key policy allows the IAM role enables Athena to decrypt S3 objects encrypted with a customer-managed KMS key. C: Correct – Creating a VPC endpoint for Athena (or S3) and attaching a bucket policy that restricts access to that endpoint ensures queries are only allowed from the specified VPC subnets. B: Incorrect – The s3:SourceIp condition key does not work for requests made via VPC endpoints; use aws:SourceVpce instead.

D: Incorrect – The kms:EncryptionContext condition is not used for restricting encryption at rest; it is used for encryption context in KMS operations. E: Incorrect – SSE-S3 does not use KMS, so the KMS key policy would not be relevant.

Exam trap

A common trap is confusing VPC endpoint policies with source IP conditions. When using a VPC endpoint, you must use aws:SourceVpce in the bucket policy, not s3:SourceIp.

10
MCQmedium

A security engineer runs the IAM policy simulator with a custom policy. The output shows the above. Which statement is true about the policy?

A.The policy allows iam:DeleteUser but denies iam:CreateUser.
B.The policy allows all actions by default.
C.The policy contains a statement that explicitly denies iam:DeleteUser.
D.The policy has no effect because the simulator returned errors.
AnswerC

Simulator shows explicitDeny.

Why this answer

The policy simulator shows an explicit deny for iam:DeleteUser, confirming that a deny statement exists in the policy. Option C is correct because the explicit deny means the policy explicitly denies iam:DeleteUser. Option A is incorrect because the simulator does not indicate that iam:CreateUser is denied.

Option B is incorrect because the explicit deny overrides any default allow. Option D is incorrect because the simulator returned an explicit deny, not errors.

11
MCQmedium

Refer to the exhibit. A developer is trying to list objects in an S3 bucket from an AWS environment. What is the most likely cause of the error?

A.The bucket name is incorrect.
B.The developer is using the wrong CLI tool (gsutil instead of aws s3).
C.The IAM role does not have S3 permissions.
D.The S3 bucket policy does not allow the user.
AnswerB

gsutil is for Google Cloud Storage; to access S3, use 'aws s3 ls s3://bucket-name'.

Why this answer

The error occurs because the developer is using gsutil, a command-line tool for Google Cloud Storage, instead of aws s3, which is the correct CLI tool for interacting with Amazon S3. Using gsutil to access an S3 bucket will fail, hence the error.

12
MCQmedium

A company is using AWS Organizations and wants to delegate administrative tasks for a specific OU to another account. Which feature should be used?

A.AWS Resource Access Manager
B.AWS CloudTrail
C.AWS SSO
D.Delegated administrator for AWS Organizations
AnswerD

Allows a member account to perform administrative tasks on behalf of the organization.

Why this answer

Delegated administrator for AWS Organizations. This feature allows a member account to manage specified services across the organization, enabling administrative delegation for an OU. Option A (AWS Resource Access Manager) is for sharing resources.

Option B (AWS CloudTrail) is for logging API activity. Option C (AWS SSO) provides single sign-on access but not delegation of administrative tasks.

13
Multi-Selecthard

A company has a requirement that all IAM users must use multi-factor authentication (MFA) to access the AWS Management Console. Which TWO steps should the company take to enforce this?

Select 2 answers
A.Enable MFA devices for each IAM user.
B.Use a service control policy (SCP) to require MFA for all users.
C.Attach an IAM policy that denies all actions unless the request includes MFA (condition aws:MultiFactorAuthPresent).
D.Enable MFA for the root user only.
E.Configure an IAM password policy that requires MFA.
AnswersA, C

Users must have MFA devices assigned.

Why this answer

To enforce MFA, each IAM user must have an MFA device enabled. Option C is correct because attaching an IAM policy with a condition that denies all actions unless aws:MultiFactorAuthPresent is true ensures that users must authenticate with MFA to perform any action. Option B is incorrect because service control policies (SCPs) are used in AWS Organizations to manage permissions across accounts, not for individual user-level MFA enforcement.

Option D is incorrect because enabling MFA for the root user only does not enforce MFA for all IAM users. Option E is incorrect because an IAM password policy controls password complexity and rotation, not MFA requirements.

14
Multi-Selectmedium

Which TWO statements are true about IAM roles? (Choose two.)

Select 2 answers
A.IAM roles can be used by federated users.
B.IAM roles are specific to an AWS region.
C.IAM roles cannot be attached to an EC2 instance.
D.IAM roles have permanent access keys.
E.IAM roles can be assumed by AWS services like EC2.
AnswersA, E

Federated users can assume roles to access AWS.

Why this answer

The correct answers are A and E. IAM roles can be used by federated users to grant temporary access (A), and they can be assumed by AWS services like EC2 to obtain permissions (E). Option B is false because IAM roles are global, not region-specific.

Option C is false because roles can be attached to EC2 instances via instance profiles. Option D is false because roles use temporary credentials obtained through AWS STS, not permanent access keys.

15
MCQeasy

Refer to the exhibit. An IAM user has this policy attached. Can the user create a new IAM user in the us-east-1 region?

A.Yes, because the Allow statement explicitly permits CreateUser.
B.No, because IAM is a global service and region conditions do not apply.
C.Yes, because the Deny only applies to us-east-1.
D.No, because the Deny statement blocks all IAM actions in us-east-1.
AnswerD

The Deny is explicit and overrides the Allow.

Why this answer

The Deny statement blocks all IAM actions in us-east-1, which overrides the Allow for CreateUser. Since the Deny is explicit, it blocks the action even though there is an Allow. The request fails.

16
MCQmedium

A company has an S3 bucket with a bucket policy that grants access to an IAM role used by an application running on EC2. The application is unable to read objects from the bucket, even though the IAM role has the necessary permissions. What is the most likely cause?

A.The bucket is in a different AWS account.
B.The bucket policy denies access to the IAM role.
C.The bucket policy does not explicitly allow the IAM role.
D.The IAM role has an explicit deny statement.
AnswerB

A deny in bucket policy overrides any allow.

Why this answer

The most likely cause is that the bucket policy explicitly denies access to the IAM role. Even though the IAM role has the necessary permissions via its attached policies, an explicit deny in the bucket policy overrides any allow, resulting in denied access. Option A is incorrect because cross-account access can be granted with proper permissions.

Option C is incorrect because while a missing explicit allow would also deny access by default, the question says the IAM role has the necessary permissions, implying the issue is an explicit deny. Option D is incorrect because if the IAM role had an explicit deny, it would also deny access, but the role is stated to have the necessary permissions.

17
Multi-Selecteasy

A company wants to allow a Lambda function to read messages from an SQS queue and write logs to CloudWatch Logs. Which TWO IAM actions should be included in the Lambda execution role?

Select 2 answers
A.logs:DeleteLogGroup
B.sqs:ReceiveMessage
C.cloudwatch:*
D.logs:CreateLogStream and logs:PutLogEvents
E.sqs:SendMessage
AnswersB, D

This allows the function to read messages from the queue.

Why this answer

Options B and D are correct because they provide the specific actions needed: sqs:ReceiveMessage to read from SQS and logs:CreateLogStream and logs:PutLogEvents to write logs to CloudWatch Logs. Option A (logs:DeleteLogGroup) is not required for writing logs. Option C (cloudwatch:*) is overly broad and CloudWatch Logs actions are under the logs: prefix, not cloudwatch:* which covers other CloudWatch services.

Option E (sqs:SendMessage) is for sending messages, not reading.

18
Multi-Selecthard

A company is using AWS Organizations with multiple accounts. The security team wants to enforce that all IAM users must have MFA enabled. Which TWO methods can be used to enforce this? (Choose TWO.)

Select 2 answers
A.Attach an IAM policy that denies all actions unless MFA is present.
B.Configure a password policy that requires MFA.
C.Require MFA for all IAM roles.
D.Use a Service Control Policy (SCP) to deny actions when MFA is not present.
E.Enable MFA delete on S3 buckets.
AnswersA, D

This policy can be applied to users or groups to enforce MFA.

Why this answer

The correct options are A and D. Option A uses an IAM policy with a condition key 'aws:MultiFactorAuthPresent' to deny actions unless MFA is present, which can be attached to users or groups. Option D uses a Service Control Policy (SCP) at the AWS Organizations level to deny actions when MFA is not present.

Option B is incorrect because a password policy does not enforce MFA usage. Option C is incorrect because requiring MFA for roles does not enforce MFA for IAM users. Option E is unrelated to IAM user MFA enforcement.

19
MCQmedium

A developer is trying to push an image to Amazon ECR but receives an 'AccessDeniedException' error. The developer's IAM user has the 'AmazonEC2ContainerRegistryPowerUser' managed policy attached. What is the most likely reason for the failure?

A.The developer needs to call 'ecr:GetAuthorizationToken' and authenticate to the registry.
B.The developer is pushing from an unsupported region.
C.The ECR repository has a resource policy that denies the push.
D.The image is too large for ECR.
AnswerA

ECR requires an authorization token before pushing; PowerUser policy does not include GetAuthorizationToken.

Why this answer

The 'AmazonEC2ContainerRegistryPowerUser' managed policy includes permissions for pushing and pulling images but does not include 'ecr:GetAuthorizationToken', which is required to authenticate Docker to the registry. Without a valid token, the push request is denied with 'AccessDeniedException'. Option B is incorrect because the error is about authentication, not region support; ECR is available in all commercial regions.

Option C is incorrect because a resource policy would cause 'AccessDeniedException' if it explicitly denies, but the PowerUser policy already lacks the necessary auth permission, which is the more direct cause. Option D is incorrect because ECR has a size limit (5 GB for default layers), but that would yield a different error message, not 'AccessDeniedException'.

20
MCQeasy

A developer needs to grant an IAM user the ability to launch EC2 instances with specific tags. Which IAM condition key should be used to enforce that the instance is tagged with 'Environment=Production'?

A.aws:ResourceTag
B.aws:SourceIp
C.ec2:ResourceTag
D.aws:RequestTag
AnswerD

Enforces tags at request time.

Why this answer

aws:RequestTag is the correct condition key because it checks the tags that are submitted in the request (e.g., during EC2 instance launch). This allows enforcement of specific tags at creation. Option A (aws:ResourceTag) checks tags on existing resources, not the request.

Option B (aws:SourceIp) is for IP-based conditions, unrelated to tags. Option C (ec2:ResourceTag) is a valid IAM condition key that checks tags on existing resources, not request tags, so it is not the correct choice for this scenario.

21
MCQhard

A security engineer is designing a cross-account access solution. An IAM role in Account A needs to be assumed by users from Account B. Which two components are required?

A.Permissions boundary on the role to limit permissions
B.Service control policy in Account A allowing AssumeRole
C.Trust policy allowing Account B to assume the role, and IAM policy in Account B allowing sts:AssumeRole
D.Resource-based policy on the role allowing cross-account access
AnswerC

This is the standard cross-account role setup.

Why this answer

For cross-account IAM role access, two components are required: (1) a trust policy on the role in Account A that grants permissions for principals in Account B to assume the role, and (2) an IAM policy in Account B that allows its users to call sts:AssumeRole on the role ARN in Account A. Option A is incorrect because a permissions boundary is optional and not a required component. Option B is incorrect because Service Control Policies (SCPs) are used to restrict permissions at the organizational level, not to allow actions; they cannot explicitly allow AssumeRole.

Option D is incorrect because IAM roles do not support resource-based policies; only trust policies are used for cross-account access.

22
MCQhard

A security engineer attaches this policy to an IAM user. The user tries to download an object from the bucket from an IP address 10.1.0.5. What will happen?

A.The user will be denied access because the condition does not match
B.The user will be allowed access because the policy allows s3:GetObject
C.The policy is invalid and will cause an error
D.The user will be denied access because there is an explicit deny
AnswerA

The IP is outside the allowed range.

Why this answer

The condition in the policy restricts access to IP addresses within the 10.0.0.0/16 range. The user's IP address 10.1.0.5 is not in that range, so the allow statement for s3:GetObject does not apply. Since there is no applicable allow statement, the default implicit deny takes effect, resulting in denied access.

Option B is wrong because the allow only applies when the condition is satisfied. Option C is wrong because the policy is syntactically valid. Option D is wrong because there is no explicit deny statement; the denial is implicit.

23
MCQmedium

A company is using Amazon API Gateway to expose a set of REST APIs. The APIs are backed by AWS Lambda functions. The security team wants to control access to the APIs using IAM authorization. The team has created an IAM policy for a group of developers that allows them to invoke the APIs only from within the corporate network (IP range 203.0.113.0/24). The policy is attached to an IAM group, and the developers are members of the group. However, when a developer tries to invoke the API from the corporate network, they receive a '403 Forbidden' error. The API Gateway endpoint is configured with IAM authorization. The IAM policy is as follows: {"Version":"2012-10-17","Statement":[{"Effect":"Allow","Action":"execute-api:Invoke","Resource":"arn:aws:execute-api:us-east-1:123456789012:api-id/*","Condition":{"IpAddress":{"aws:SourceIp":"203.0.113.0/24"}}}]}. What is the MOST likely reason for the failure?

A.The resource ARN in the policy does not include the stage and method; it should be 'arn:aws:execute-api:us-east-1:123456789012:api-id/stage/GET/resource'.
B.The IAM policy must be attached directly to the IAM user, not to a group.
C.The condition key aws:SourceIp does not work for API Gateway; you must use a custom header.
D.API Gateway IAM authorization does not support resource-level conditions; you must use a Lambda authorizer.
AnswerA

The resource ARN must be more specific to match the API's resource hierarchy.

Why this answer

The resource ARN in the IAM policy must include the stage and HTTP method to match the API Gateway endpoint. The current policy uses 'api-id/*', which is a wildcard but may not cover all paths correctly if the stage and method are not specified. In this case, the developers receive a 403 error because the policy's resource ARN does not match the actual API resource path.

Option B is incorrect because IAM policies can be attached to groups, and the developers inherit them. Option C is incorrect because the 'aws:SourceIp' condition works with API Gateway IAM authorization. Option D is incorrect because API Gateway IAM authorization supports resource-level conditions; the issue is the resource ARN format.

24
MCQhard

A security architect is designing a system where an S3 bucket must be accessed by users from multiple AWS accounts. The solution must use the principle of least privilege. Which approach should be used?

A.Create an IAM role in the bucket owner account and use a bucket policy that grants access to the role
B.Grant s3:ListBucket and s3:GetObject to all IAM users in the account
C.Use an SCP to allow access to the bucket for all accounts in the organization
D.Use an IAM role in each account with a bucket policy allowing the role
AnswerA

Users assume the role and get temporary credentials; bucket policy allows the role.

Why this answer

The recommended approach for cross-account access to an S3 bucket while adhering to least privilege is to create an IAM role in the bucket owner account and attach a bucket policy that grants the necessary permissions to that role. Users from other AWS accounts can then assume this role to access the bucket, ensuring that access is temporary and centrally managed. Option A is correct.

Option B is incorrect because granting s3:ListBucket and s3:GetObject to all IAM users violates least privilege. Option C is incorrect because SCPs are used for service control policies at the organization level, not for granting access to specific resources across accounts. Option D is incorrect because creating IAM roles in each account with a bucket policy allowing the role decentralizes permissions and does not enforce the principle of least privilege as effectively as the centralized role approach.

25
Multi-Selecteasy

Which THREE are valid methods for authenticating to AWS APIs? (Choose THREE.)

Select 3 answers
A.Access key ID and secret access key
B.SSH key pair
C.SAML federation
D.Client certificate
E.IAM role temporary credentials
AnswersA, C, E

Used for programmatic access to AWS APIs.

Why this answer

The correct options are A, C, and E. Access keys, IAM roles (via STS), and SAML federation are valid authentication methods. Option B, SSH keys, are for EC2 instance access, not AWS APIs.

Option D, client certificates, are not used for AWS API authentication.

26
Multi-Selecthard

Which THREE of the following are characteristics of IAM roles? (Choose 3.)

Select 3 answers
A.Roles have long-term credentials like access keys.
B.Roles require a password for assumption.
C.Roles can be assumed by IAM users in another AWS account.
D.Roles have a trust policy that specifies who can assume the role.
E.Roles can be attached to EC2 instances to grant permissions to applications.
AnswersC, D, E

Cross-account access is a common use case.

Why this answer

Roles are assumed by trusted entities, provide temporary credentials, and can be used by AWS services.

27
Multi-Selectmedium

A security engineer is designing a system to allow an EC2 instance to write logs to an S3 bucket. Which TWO steps are required?

Select 2 answers
A.Configure the security group of the EC2 instance to allow outbound HTTPS traffic to S3.
B.Create a VPC endpoint for S3 in the same subnet as the EC2 instance.
C.Add a bucket policy that allows the IAM role to perform s3:PutObject.
D.Create an IAM role with a policy that allows s3:PutObject on the bucket and attach it to the EC2 instance.
E.Enable AWS CloudTrail to capture log write events.
AnswersC, D

The bucket policy must explicitly grant access to the role.

Why this answer

Options C and D are correct. The EC2 instance needs an IAM role with permissions to write to the bucket (D), and the bucket policy must allow the role to write (C). Option A is incorrect because a security group controls network traffic but does not grant IAM permissions.

Option B is incorrect because a VPC endpoint provides private connectivity but is not required for this task. Option E is incorrect because CloudTrail is for API logging, not application logs.

28
MCQeasy

A company needs to provide temporary credentials to mobile app users to access AWS resources. Which AWS service should be used to issue these credentials?

A.AWS IAM
B.AWS Cognito
C.AWS Security Token Service (STS)
D.AWS Key Management Service (KMS)
AnswerC

STS issues temporary security credentials for users.

Why this answer

AWS Security Token Service (STS) is specifically designed to issue temporary credentials for IAM users or federated users. Option A is incorrect because IAM is for managing users and roles, not for generating temporary credentials directly. Option B is incorrect because AWS Cognito is for user identity and authentication; while it can use STS to get temporary credentials, the primary service for issuing temporary credentials is STS.

Option D is incorrect because KMS is for encryption key management.

29
Multi-Selectmedium

Which TWO actions are valid ways to grant an IAM user in Account A access to an S3 bucket in Account B? (Choose 2.)

Select 2 answers
A.Attach an IAM policy to the user in Account A that allows access to the S3 bucket.
B.Add a bucket policy in Account B that grants access to the user's ARN in Account A.
C.Use a service control policy (SCP) in Account B to allow access from Account A.
D.Create an IAM role in Account B with permissions to the bucket and allow the user in Account A to assume that role.
E.Add an IAM policy to the S3 bucket in Account B granting access to the user.
AnswersB, D

This allows the user direct access if the IAM policy in Account A also allows S3 actions.

Why this answer

Options B and D are correct. B: A bucket policy can grant cross-account access to a specific user. D: A role in Account B can be assumed by the user in Account A.

Option A is wrong because IAM policies in Account A cannot grant access to resources in another account; the resource account must also grant access. Option C is wrong because SCPs are used in AWS Organizations to set permissions boundaries, not to grant access across accounts. Option E is wrong because you cannot attach an IAM policy to an S3 bucket; you use bucket policies instead.

30
Multi-Selectmedium

A company wants to enforce that all IAM users must use multi-factor authentication (MFA) to access the AWS Management Console. Which THREE steps should the company take?

Select 3 answers
A.Create an IAM policy that denies all actions if aws:MultiFactorAuthPresent is false.
B.Enable CloudTrail to monitor MFA usage.
C.Attach the MFA enforcement policy to all IAM users or groups.
D.Set the password policy to require MFA.
E.Enable MFA for each IAM user.
AnswersA, C, E

This policy forces MFA to be used.

Why this answer

The correct steps are to enable MFA for each IAM user (E), create an IAM policy that denies all actions if `aws:MultiFactorAuthPresent` is false (A), and attach the policy to all IAM users or groups (C). Enabling MFA per user is a prerequisite. The policy enforces MFA usage by denying API calls when MFA is not present.

Attaching the policy ensures it applies to users. Option B (CloudTrail) is for auditing, not enforcement. Option D (password policy) does not enforce MFA for console access; it only sets password requirements.

31
Multi-Selectmedium

A security engineer needs to allow an IAM user to rotate their own access keys. Which TWO IAM actions must be allowed in the user's policy? (Choose TWO.)

Select 2 answers
A.iam:GetAccessKeyLastUsed
B.iam:DeleteAccessKey
C.iam:ListAccessKeys
D.iam:UpdateAccessKey
E.iam:CreateAccessKey
AnswersB, E

iam:DeleteAccessKey is required to remove the old key during rotation. This is correct.

Why this answer

To rotate access keys, the user needs to create a new access key (iam:CreateAccessKey) and delete the old one (iam:DeleteAccessKey). Therefore, options B and E are correct. Option A (iam:GetAccessKeyLastUsed) is not required for rotation.

Option C (iam:ListAccessKeys) is not strictly required, though it may be useful. Option D (iam:UpdateAccessKey) can change the status of a key but is not necessary for rotation.

32
MCQeasy

An IAM user receives an 'AccessDenied' error when trying to list objects in an S3 bucket. The user has the following policy attached: {"Version":"2012-10-17","Statement":[{"Effect":"Allow","Action":"s3:ListBucket","Resource":"arn:aws:s3:::example-bucket"}]}. What is the most likely reason?

A.The policy is missing a condition
B.The bucket policy explicitly denies the action
C.The policy does not include s3:GetObject
D.The policy has a syntax error
AnswerB

An explicit deny in the bucket policy overrides the user policy allow.

Why this answer

The IAM policy grants the s3:ListBucket action on the bucket, which should allow listing objects. However, an explicit deny in a bucket policy overrides any allow, including those from IAM policies. Since the user receives an 'AccessDenied' error, the most likely cause is that the bucket policy explicitly denies the s3:ListBucket action for this user, as explicit denies take precedence over all allows.

Exam trap

The trap here is that candidates often assume an IAM policy alone is sufficient and forget that bucket policies can explicitly deny actions, overriding IAM allows, leading them to incorrectly choose options like missing permissions or syntax errors.

How to eliminate wrong answers

Option A is wrong because a missing condition would not cause an 'AccessDenied' error if the action and resource are correctly allowed; conditions only further restrict access, and their absence typically broadens access. Option C is wrong because s3:GetObject is not required for listing objects; s3:ListBucket alone is sufficient for the ListObjects operation. Option D is wrong because a syntax error would result in a different error (e.g., 'MalformedPolicy') or the policy would be invalid, not an 'AccessDenied' error during the API call.

33
MCQeasy

An IAM user reports that they are unable to launch an EC2 instance in us-east-1. The IAM policy attached to the user allows ec2:RunInstances but with a condition that the instance type must be t2.micro. What could be the reason for the failure?

A.The user is trying to launch an instance type other than t2.micro.
B.The user has not attached a security group to the instance.
C.The IAM policy does not include ec2:RunInstances for us-east-1.
D.The user's account has reached the EC2 instance limit.
AnswerA

The condition restricts to t2.micro; any other type would be denied.

Why this answer

The condition likely specifies 'ec2:InstanceType' equals 't2.micro', so if the user tries to launch any other type, the action is denied. Option B is irrelevant because the policy allows the action. Option C is not a common condition.

Option D is unrelated.

34
MCQhard

A security engineer is designing an IAM policy to allow an application running on an EC2 instance to read objects from a specific S3 bucket (my-bucket) and write objects to a different S3 bucket (my-other-bucket). The application uses an IAM role with the following trust policy. Which additional policy should be attached to the role to meet the requirements with least privilege?

A.{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": ["s3:GetObject", "s3:PutObject"], "Resource": "arn:aws:s3:::*/*" } ] }
B.{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": "s3:*", "Resource": "*" } ] }
C.{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": ["s3:GetObject"], "Resource": "arn:aws:s3:::my-bucket/*" }, { "Effect": "Allow", "Action": ["s3:PutObject"], "Resource": "arn:aws:s3:::my-other-bucket/*" } ] }
D.{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": ["s3:GetObject", "s3:PutObject"], "Resource": "arn:aws:s3:::my-bucket/*" } ] }
AnswerC

Correctly scopes read to my-bucket and write to my-other-bucket.

Why this answer

The correct answer because it grants only the necessary actions (s3:GetObject and s3:PutObject) on the specific buckets (my-bucket for read, my-other-bucket for write), adhering to the principle of least privilege. Option A is incorrect because it allows both GetObject and PutObject on all buckets (*/*), which is too permissive. Option B grants full S3 access (*) to all resources, violating least privilege.

Option D only allows PutObject on my-bucket instead of my-other-bucket, failing to meet the write requirement.

35
MCQmedium

A security engineer needs to enforce that all IAM users in an AWS account use multi-factor authentication (MFA) when making API calls. What is the MOST effective way to enforce this?

A.Enable MFA for the root user.
B.Enable CloudTrail to log MFA usage.
C.Attach an IAM policy that denies all actions unless MFA is present.
D.Use an AWS Organizations service control policy (SCP) that denies all actions unless MFA is present.
AnswerD

Enforces MFA at the account level, overriding any IAM policies.

Why this answer

An SCP can be applied at the organization, OU, or account level to deny all actions if MFA is not present, ensuring enforcement across all users and roles, including the root user. Option A is wrong because it only applies to the root user. Option B is wrong because CloudTrail logs do not enforce MFA.

Option C is wrong because an IAM policy can be attached to users, groups, or roles but can be bypassed if not attached universally; an SCP provides broader, unavoidable enforcement.

36
MCQhard

A security engineer needs to ensure that an IAM role can be assumed only from a specific VPC. Which IAM policy condition key should be used?

A.aws:RequestedRegion
B.aws:VpcSourceIp
C.aws:SourceVpc
D.aws:SourceIp
AnswerC

This is the correct condition key. It restricts requests to originate from a specified VPC.

Why this answer

Aws:SourceVpc. This condition key allows you to restrict requests to originate from a specific VPC ID. Option A, aws:RequestedRegion, restricts region, not VPC.

Option B, aws:VpcSourceIp, is not a valid condition key. Option D, aws:SourceIp, restricts source IP address, not VPC.

37
MCQhard

A company uses AWS Organizations with multiple accounts. The security team wants to ensure that no IAM user in any account can create or modify IAM roles. What is the MOST effective way to enforce this?

A.Use AWS Config rules to detect role creation and automatically delete the roles.
B.Set up a Lambda function that monitors CloudTrail and revokes role creation permissions.
C.Create an SCP that denies iam:CreateRole and iam:UpdateAssumeRolePolicy and attach it to the root organizational unit.
D.Create an IAM policy that denies role creation and attach it to each user in every account.
AnswerC

SCPs can centrally restrict permissions across accounts.

Why this answer

A service control policy (SCP) can be applied to the root organizational unit to deny the specified actions across all accounts.

38
Multi-Selecthard

A security engineer is designing a permissions boundary for an IAM user. Which TWO statements about permissions boundaries are correct?

Select 2 answers
A.Permissions boundaries can be applied to service-linked roles.
B.Permissions boundaries can only be applied to IAM users, not roles.
C.The effective permissions are the intersection of the identity-based policy and the permissions boundary.
D.Permissions boundaries can override resource-based policies.
E.A permissions boundary alone does not grant permissions; an identity-based policy is also required.
AnswersC, E

Intersection of both policies.

Why this answer

The correct answers are C and E. Permissions boundaries set the maximum permissions that an identity-based policy can grant. The effective permissions are the intersection of the identity-based policy and the permissions boundary (C).

A permissions boundary alone does not grant permissions; you must also attach an identity-based policy (E). Option A is incorrect because permissions boundaries cannot be applied to service-linked roles. Option B is incorrect because permissions boundaries can be applied to both IAM users and roles.

Option D is incorrect because permissions boundaries do not affect resource-based policies; they only limit identity-based policies.

39
MCQmedium

A company needs to allow an external auditor to access a specific S3 bucket for 30 days. The auditor does not have an AWS account. What is the MOST secure way to grant temporary access?

A.Create an IAM user with long-term credentials and share them with the auditor.
B.Use AWS STS to issue temporary credentials via a custom identity broker.
C.Grant access via a bucket policy using the auditor's email address as a condition.
D.Create an IAM role and allow the auditor to assume it using SAML federation.
AnswerB

Temporary credentials can be issued after authenticating the auditor externally.

Why this answer

The most secure method is to use AWS Security Token Service (STS) to issue temporary credentials via a custom identity broker. The broker authenticates the auditor independently (e.g., via their own corporate credentials) and then calls STS to obtain temporary, limited-privilege credentials valid for up to 36 hours. This avoids long-term credentials and does not require the auditor to have an AWS account.

Option A is insecure because it exposes long-term credentials. Option C is not possible because bucket policies cannot use an email address as a condition for access without a specific IAM entity. Option D (SAML federation) requires the auditor's organization to have a SAML identity provider and a trust relationship, which may not be feasible and is less flexible than a custom broker.

40
MCQmedium

A company wants to allow users from an external AWS account to assume an IAM role in its account. What must be configured in both accounts?

A.An IAM password policy in both accounts.
B.Only the trusting account's role trust policy.
C.Only the external account's IAM policy to allow sts:AssumeRole.
D.Both the trusting account's role trust policy and the external account's IAM policy to allow sts:AssumeRole.
AnswerD

Correct. Both the trusting account's role trust policy and the external account's IAM policy to allow sts:AssumeRole are required for cross-account role access.

Why this answer

Cross-account role access requires configuration on both sides: the trusting account (where the role resides) must have a trust policy that allows the external account to assume the role, and the external account must have an IAM policy that grants its users permission to call sts:AssumeRole targeting that role. Option A is incorrect because an IAM password policy is unrelated to cross-account role access. Option B is incorrect because while the trusting account's trust policy is necessary, the external account also needs to grant sts:AssumeRole permission to its users.

Option C is incorrect because the external account's policy alone is insufficient without the trusting account's trust policy.

41
MCQmedium

A security engineer discovers that an IAM policy allows 'iam:CreateUser' and 'iam:CreateAccessKey' for all users in the account. Which risk does this pose?

A.Users can create new IAM users and programmatic access keys
B.Users can disable CloudTrail logging
C.Users can decrypt data in S3
D.Users can modify VPC security groups
AnswerA

This allows creation of new users and keys, which can be used for unauthorized access.

Why this answer

The IAM policy allows 'iam:CreateUser' and 'iam:CreateAccessKey', which enables users to create new IAM users and programmatic access keys, leading to unauthorized access and privilege escalation. Option B is incorrect because the policy does not grant permissions to disable CloudTrail logging. Option C is incorrect because creating users/keys does not allow decrypting data in S3.

Option D is incorrect because it does not allow modifying VPC security groups.

42
MCQmedium

An IAM policy has the following statement: { "Effect": "Deny", "Action": "s3:*", "Resource": "*", "Condition": { "BoolIfExists": { "aws:SecureTransport": "false" } } }. What does this policy do?

A.Denies all S3 access for any request.
B.Requires MFA for all S3 access.
C.Allows all S3 access only if using HTTPS.
D.Denies all S3 access if the request is not using HTTPS.
AnswerD

The condition checks for false SecureTransport.

Why this answer

The policy denies all S3 actions when the request is not using HTTPS (i.e., aws:SecureTransport is false). Option A is incorrect because the policy does not deny all S3 access; it only denies non-HTTPS requests. Option B is incorrect because the policy does not require MFA; it denies non-HTTPS requests.

Option C is incorrect because the policy does not allow anything; it denies non-HTTPS requests. Option D correctly states that the policy denies S3 access if the request is not using HTTPS.

43
Multi-Selecthard

A security engineer is designing a solution to allow an external auditor to access logs in an S3 bucket in the company's AWS account. The auditor does not have an AWS account. The engineer needs to grant read-only access to the specific bucket for a limited time. Which TWO actions should the engineer take? (Choose two.)

Select 2 answers
A.Enable S3 Access Analyzer on the bucket to generate findings for the auditor.
B.Create a cross-account IAM role in the company's account and share the role ARN with the auditor.
C.Use AWS STS to issue temporary credentials that the auditor can use to access the bucket.
D.Generate a pre-signed URL for each log file the auditor needs to access.
E.Configure the bucket policy to grant access to 'Principal': '*' with a condition that limits access to the auditor's IP address.
AnswersC, D

STS can issue temporary credentials with a specified expiration; the auditor can use these to access the bucket.

Why this answer

AWS Security Token Service (STS) can issue temporary, limited-privilege credentials (access key, secret key, and session token) that the auditor can use to authenticate API requests to the S3 bucket. This approach does not require the auditor to have an AWS account and allows the engineer to control the validity period (via the DurationSeconds parameter) to enforce a limited time window. Option D is correct because a pre-signed URL embeds temporary credentials and a specific expiration time, granting read-only access to a single object without requiring the auditor to have AWS credentials or an AWS account.

Exam trap

The trap here is that candidates often choose cross-account IAM roles (Option B) without realizing that the external user must have an AWS account to assume the role, which is explicitly not the case in this scenario.

44
MCQeasy

A company requires that all access to its S3 buckets be logged for compliance. Which AWS service should be used to record API calls to S3?

A.Amazon GuardDuty
B.Amazon Inspector
C.AWS Config
D.AWS CloudTrail
AnswerD

AWS CloudTrail records API calls for auditing purposes.

Why this answer

AWS CloudTrail records API calls for auditing purposes, making it the correct service for logging access to S3 buckets. Option A is incorrect because Amazon GuardDuty is a threat detection service, not a logging service. Option B is incorrect because Amazon Inspector assesses vulnerabilities.

Option C is incorrect because AWS Config tracks resource configuration changes, not API calls.

45
MCQhard

A security engineer is designing a cross-account IAM role to allow users in Account A to access resources in Account B. The engineer wants to restrict access to only users who have authenticated with multi-factor authentication (MFA) in Account A. What condition key should the engineer use in the trust policy of the IAM role in Account B?

A.aws:SourceIp
B.aws:MultiFactorAuthPresent
C.aws:RequestedRegion
D.aws:UserAgent
AnswerB

This condition key checks if the user authenticated with MFA.

Why this answer

Aws:MultiFactorAuthPresent is the condition key used to verify whether the requesting user authenticated using multi-factor authentication (MFA). In a trust policy, this condition ensures that only MFA-authenticated users from Account A can assume the role in Account B. Option A (aws:SourceIp) is incorrect because it checks the source IP address, not MFA status.

Option C (aws:RequestedRegion) is incorrect because it restricts based on the AWS region, not MFA. Option D (aws:UserAgent) is incorrect because it checks the user agent string of the request, not MFA.

46
MCQhard

An organization uses AWS KMS to encrypt S3 objects. They want to allow a developer to decrypt objects only if the request comes from a specific IP address range. Which IAM policy condition should be used?

A.Condition with kms:GrantOperations and aws:SourceIp.
B.Condition with kms:CallerAccount and aws:SourceIp.
C.Condition with kms:EncryptionContext and aws:SourceIp.
D.Condition with kms:ViaService and aws:SourceIp.
AnswerD

kms:ViaService ensures the request comes through S3, and aws:SourceIp restricts the IP.

Why this answer

Kms:ViaService ensures the KMS request is made through an integrated AWS service (in this case, S3), and aws:SourceIp restricts the request to a specific IP address range. Option A is incorrect because kms:GrantOperations is used for managing grants, not for restricting based on IP or service. Option B is incorrect because kms:CallerAccount checks the account number of the caller, not the IP.

Option C is incorrect because kms:EncryptionContext is used to specify encryption context, not for IP restrictions.

47
MCQhard

A company uses an IAM role to allow an EC2 instance to access an S3 bucket. The security team wants to ensure that if the EC2 instance is compromised, the attacker cannot use the role credentials to access resources outside the account. What should the security team do?

A.Store the role credentials in AWS Secrets Manager and rotate them frequently.
B.Use an instance profile with a short-lived session token.
C.Use an SCP to deny all actions except S3 access for the role.
D.Attach a permissions boundary to the IAM role that limits access to only the required S3 bucket.
AnswerD

Permissions boundaries set the maximum permissions for the role.

Why this answer

Using a permissions boundary restricts the maximum permissions the role can have, limiting the impact of a compromised instance.

48
MCQmedium

A security engineer is investigating an IAM role that was used to access AWS resources from an external account. The role has a trust policy that allows the external account to assume it. Which of the following is a required step for the external account to use the role?

A.Configure the role to require MFA for the external account.
B.Create a new IAM role in the external account with a trust policy allowing the role's ARN.
C.Add the external account's root user ARN to the role's trust policy.
D.Attach an IAM policy to an IAM user in the external account that allows sts:AssumeRole for the role ARN.
AnswerD

The external user needs permission to assume the role.

Why this answer

To assume a role in another AWS account, the external account must have an IAM user or role with permissions to call the sts:AssumeRole API for the target role ARN. Option D correctly describes this requirement. Option A is incorrect because MFA is not a required step unless specified in the role's trust policy.

Option B is incorrect because the external account does not need to create a new role; it only needs a principal (user or role) with the appropriate permissions. Option C is incorrect because the trust policy is attached to the role in the target account, not the external account.

49
Multi-Selectmedium

Which THREE of the following are best practices for managing IAM access keys? (Choose THREE.)

Select 3 answers
A.Use IAM roles for EC2 instances instead of access keys
B.Use long-lived access keys for applications
C.Delete unused access keys
D.Embed access keys in application code for convenience
E.Rotate access keys regularly
AnswersA, C, E

Roles are more secure than embedding keys.

Why this answer

The correct best practices are A, C, and E. Using IAM roles for EC2 instances (A) eliminates the need for long-term access keys. Deleting unused access keys (C) reduces risk.

Rotating access keys regularly (E) limits exposure if keys are compromised. Option B is incorrect because long-lived access keys increase risk; they should be rotated. Option D is incorrect because embedding access keys in application code is insecure; use IAM roles instead.

50
MCQmedium

A company wants to allow cross-account access to an S3 bucket in Account A for a user in Account B. What is the correct combination of steps?

A.Add a bucket policy in Account A allowing access to the user in Account B, and attach an IAM policy to the user in Account B allowing access to the bucket.
B.Create an IAM role in Account A with access to the bucket, and have the user in Account B assume that role.
C.Add a bucket policy in Account A allowing access to Account B, and no action is needed in Account B because the user already has permissions.
D.Add a bucket policy in Account A allowing access to Account B, and attach an IAM policy to the user in Account B allowing access to the bucket.
AnswerA

Correct: Both a bucket policy granting access to the specific user and an IAM policy for that user are required for cross-account access.

Why this answer

Cross-account access to an S3 bucket requires two key permissions: a resource-based policy (bucket policy) in the owning account (Account A) that grants access to the specific IAM user in Account B, and an identity-based policy (IAM policy) attached to that user in Account B that permits the necessary S3 actions. Option A correctly describes this combination. Option D grants the bucket policy to the entire Account B, which may work but is less secure and not the recommended least-privilege approach; furthermore, the bucket policy to 'Account B' alone does not grant access to a specific user unless accompanied by the correct IAM policy, but the phrasing is ambiguous and not as precise as Option A.

Option B suggests using an IAM role in Account A, which would require the user to assume the role, a different pattern not matching the question's scenario. Option C is incorrect because the user in Account B must have an explicit IAM policy; the bucket policy alone is insufficient.

51
Multi-Selecthard

Which THREE are valid ways to grant cross-account access to an S3 bucket? (Choose three.)

Select 3 answers
A.Use an IAM user in the source account with access keys.
B.Create an IAM role in the target account and allow the source account to assume it.
C.Use an S3 access point with a policy that allows cross-account access.
D.Create a bucket policy that grants access to the other account's root user.
E.Set the bucket ACL to grant full control to the other account.
AnswersB, C, D

Cross-account role assumption is a common pattern.

Why this answer

The correct methods for granting cross-account access to an S3 bucket are: creating an IAM role in the target account and allowing the source account to assume it (B), using an S3 access point with a policy that allows cross-account access (C), and creating a bucket policy that grants access to the other account's root user (D). Option A (using IAM user access keys in the source account) is not a valid cross-account access method because access keys are tied to a specific user and do not provide cross-account delegation. Option E (bucket ACL) does not support cross-account full control grants for S3 buckets in AWS.

52
MCQeasy

A company has an AWS Lambda function that processes sensitive data stored in an Amazon S3 bucket. The Lambda function needs to read objects from the S3 bucket and write results to a different S3 bucket. The security engineer is configuring IAM permissions for the Lambda execution role. The engineer wants to follow the principle of least privilege. The Lambda function is triggered by S3 events from the source bucket. The engineer creates an IAM policy that grants s3:GetObject on the source bucket and s3:PutObject on the destination bucket. However, when testing, the Lambda function fails with an access denied error when trying to process an object. The error message indicates that the Lambda function does not have permission to list the objects in the source bucket. The engineer checks the S3 event notification configuration and confirms that the event is configured correctly. What should the engineer do to resolve the issue?

A.Add s3:ListBucket permission for the source bucket to the Lambda execution role.
B.Add s3:GetObject permission for the destination bucket to the Lambda execution role.
C.Add s3:* permission for both buckets to the Lambda execution role.
D.Add s3:PutObject permission for the source bucket to the Lambda execution role.
AnswerA

Correct – Grants the required list permission.

Why this answer

The error occurs because the Lambda function, when triggered by an S3 event, receives the object key but may still need s3:ListBucket permission for certain SDK operations (e.g., to verify bucket existence or for batch processing). Option A is correct: adding s3:ListBucket for the source bucket allows the function to list objects, resolving the access denied error while following least privilege. Option B is incorrect because the destination bucket already has s3:PutObject; adding s3:GetObject there is unnecessary and does not address the listing issue.

Option C violates least privilege by granting full S3 access, which is excessive. Option D adds s3:PutObject to the source bucket, which is not needed and does not solve the list permission error.

53
Multi-Selecthard

A company uses AWS KMS to encrypt objects in an S3 bucket. The security team wants to ensure that only users with the appropriate KMS key permissions can decrypt objects. Which TWO conditions should be included in the S3 bucket policy to enforce this? (Choose TWO.)

Select 2 answers
A."Condition": {"StringEquals": {"kms:ViaService": "s3.us-east-1.amazonaws.com"}}
B."Condition": {"StringEquals": {"kms:KeySpec": "SYMMETRIC_DEFAULT"}}
C."Condition": {"StringEquals": {"kms:ViaService": "s3.us-east-1.amazonaws.com"}}
D."Condition": {"StringEquals": {"kms:GranteePrincipal": "arn:aws:iam::123456789012:role/Admin"}}
E."Condition": {"StringEquals": {"kms:EncryptionContext": {"aws:s3:arn": "arn:aws:s3:::my-bucket"}}}
AnswersA, E

Correct. This condition restricts the KMS key to be used only via the S3 service, ensuring that decryption requests must come through S3.

Why this answer

Options A and E are the only distinct conditions that can be used in an S3 bucket policy to enforce that only users with appropriate KMS key permissions can decrypt objects. kms:ViaService restricts the use of the KMS key to requests coming via the S3 service, and kms:EncryptionContext restricts decryption to requests that include the specific S3 bucket ARN. Option C is identical to A and thus does not provide an additional constraint, making it redundant. Options B and D are not valid condition keys for S3 bucket policies.

54
MCQhard

An IAM administrator ran the simulate-custom-policy command shown in the exhibit. The result shows an 'explicitDeny' for s3:ListBucket. What is the most likely reason?

A.The simulation incorrectly evaluates the policy due to a syntax error.
B.The resource ARN for ListBucket is incorrect; it should include a wildcard.
C.The policy does not include an action that allows s3:ListBucket, so it is implicitly denied.
D.The s3:ListBucket action is not valid for S3.
AnswerC

The policy only allows GetObject; ListBucket is not allowed, resulting in implicit deny, but the simulator might show explicitDeny if there is another policy.

Why this answer

The policy does not allow s3:ListBucket, so it is implicitly denied; but the simulator shows 'explicitDeny' because there might be an attached policy that denies it. However, in this simulation, the policy only allows s3:GetObject, so ListBucket is not allowed. The 'explicitDeny' could be due to an SCP or a different policy attached to the user.

Option A is wrong because the resource ARN is correct. Option B is wrong because the policy does not include ListBucket. Option D is wrong because the action is spelled correctly.

55
MCQeasy

A developer needs to grant an IAM user access to a specific S3 bucket only. Which IAM policy element should be used to restrict access to that bucket?

A.Principal
B.Condition
C.Resource
D.Action
AnswerC

Resource specifies the bucket ARN.

Why this answer

The Resource element specifies the ARN of the S3 bucket. Option A is wrong because Principal specifies who gets access, not the resource. Option B is wrong because Action specifies allowed actions.

Option D is wrong because Condition specifies when the policy applies.

56
MCQeasy

A company wants to allow its development team to have full access to Amazon S3 buckets that are tagged with 'Environment: Dev'. Which IAM policy element should be used to restrict access based on tags?

A.Use 'aws:PrincipalTag' in the Condition element
B.Use 'aws:SourceTag' in the Condition element
C.Use 'aws:RequestTag' in the Condition element
D.Use 'aws:ResourceTag' in the Condition element
AnswerD

'aws:ResourceTag' allows you to restrict actions based on tags attached to the resource.

Why this answer

IAM policies can use 'aws:ResourceTag' in the Condition element to restrict access based on tags attached to the S3 bucket. Option A ('aws:PrincipalTag') is used to restrict based on tags attached to the principal (user/role), not the resource. Option B ('aws:SourceTag') is not a valid condition key in IAM.

Option C ('aws:RequestTag') is used to require specific tags on the request itself, not on the resource.

57
MCQmedium

A company has an S3 bucket that contains sensitive data. The security team wants to ensure that all access to the bucket is encrypted in transit. What is the most effective way to enforce this?

A.Enable default encryption on the S3 bucket using SSE-S3.
B.Enable AWS CloudTrail to log all S3 access and alert on non-HTTPS requests.
C.Add a bucket policy that denies access if the request does not use HTTPS (aws:SecureTransport condition).
D.Create an IAM policy that denies S3 actions without the condition aws:SecureTransport.
AnswerC

This condition denies non-HTTPS requests.

Why this answer

A bucket policy with the aws:SecureTransport condition denies any request that does not use HTTPS, enforcing encryption in transit. Option A is incorrect because SSE-S3 only encrypts data at rest, not during transmission. Option B is incorrect because CloudTrail logs access but does not enforce encryption.

Option D is incorrect because an IAM policy can deny non-HTTPS requests, but enforcing this at the bucket policy level is more direct and applies to all principals accessing the bucket.

58
MCQeasy

A company wants to enforce that all IAM users use multi-factor authentication (MFA) to access the AWS Management Console. What is the best way to achieve this?

A.Enable MFA in the account settings.
B.Attach an IAM policy to all users that denies console access without MFA.
C.Set a password policy that requires MFA.
D.Use an SCP to deny access if MFA is not present.
AnswerB

A policy with condition aws:MultiFactorAuthPresent is required.

Why this answer

An IAM policy with a condition that denies console access unless MFA is present enforces MFA for all IAM users. Option A is incorrect because account settings do not enforce MFA for individual users. Option C is incorrect because a password policy cannot require MFA.

Option D is incorrect because SCPs apply to accounts or OUs, not to individual IAM users, and are not the best way to enforce MFA per user.

59
MCQeasy

A developer needs to grant an EC2 instance read-only access to an S3 bucket. Which of the following is the most secure way to provide these permissions?

A.Use an IAM role and store the credentials in AWS Systems Manager Parameter Store, then retrieve them at instance launch.
B.Create an IAM role with read-only access and attach it to the EC2 instance profile.
C.Create a bucket policy that grants read-only access to the instance's public IP address.
D.Create an IAM user with read-only access and store the access keys in the instance's user data.
AnswerB

IAM roles for EC2 provide temporary credentials without managing keys.

Why this answer

Using an IAM role attached to an instance profile grants temporary credentials and eliminates long-term access keys. Option A is incorrect because storing credentials in Parameter Store (or any static storage) is less secure than using an instance profile, and IAM roles do not have static credentials to store. Option C is incorrect because a bucket policy cannot grant access based on an instance's public IP in a secure or reliable way, and it would grant access to anyone with that IP, not just the instance.

Option D is incorrect because storing IAM user access keys in user data exposes long-term credentials, which is less secure than using an instance profile.

60
MCQeasy

Which IAM entity can be used to delegate permissions to an AWS service to perform actions on your behalf?

A.Service role
B.Service-linked role
C.Instance profile
D.Permissions boundary
AnswerA

A service role allows an AWS service to assume it and perform actions.

Why this answer

A service role is an IAM role that a service assumes to perform actions on your behalf. Option A is correct. Option B is wrong because a service-linked role is a special type of service role, but not all service roles are service-linked.

Option C is wrong because an instance profile is used for EC2. Option D is wrong because a permissions boundary is used to set maximum permissions.

61
MCQhard

Refer to the exhibit. An IAM policy allows running EC2 instances. A developer tries to launch a t2.micro instance but receives an 'AccessDenied' error. What is the most likely reason?

A.The policy does not grant permissions for other required resources such as images or security groups.
B.The developer is trying to launch a different instance type.
C.The region in the policy does not match the developer's region.
D.The policy has an explicit deny elsewhere.
AnswerA

RunInstances requires permissions on multiple resource types; the policy only grants on instance, not on image, network, etc.

Why this answer

Even though the policy allows the ec2:RunInstances action on the instance resource, the RunInstances API call requires permissions for other resources such as Amazon Machine Images (AMI), security groups, and key pairs. Without explicit permissions for these resources, the API call fails with an AccessDenied error. Option B is incorrect because the condition specifies t2.micro, matching the developer's request.

Option C is incorrect because the policy does not restrict by region. Option D is incorrect because there is no explicit deny; the denial is due to missing resource permissions.

62
MCQmedium

An organization wants to enforce multi-factor authentication (MFA) for all IAM users who perform sensitive actions. Which condition key should be used in an IAM policy to require MFA?

A.aws:SourceIp
B.aws:MultiFactorAuthPresent
C.aws:UserAgent
D.aws:CurrentTime
AnswerB

This condition checks if MFA was used.

Why this answer

Aws:MultiFactorAuthPresent is the IAM condition key that checks whether multi-factor authentication (MFA) was used for the request. Option A (aws:SourceIp) is incorrect because it checks the IP address of the requester, not MFA status. Option C (aws:UserAgent) is incorrect because it checks the user agent string, not MFA.

Option D (aws:CurrentTime) is incorrect because it checks the date and time of the request, not MFA.

63
MCQeasy

A company wants to allow an external auditor to read all objects in a specific S3 bucket for a limited time. What is the most secure way to grant this access?

A.Generate pre-signed URLs for the objects the auditor needs to read, with an expiration time.
B.Use a bucket policy that allows access only from the auditor's IP address.
C.Make the bucket public and restrict access via IP address in the bucket policy.
D.Create an IAM user for the auditor with read-only access to the bucket and share the access keys.
AnswerA

Pre-signed URLs provide time-limited access without sharing credentials.

Why this answer

Pre-signed URLs provide temporary, granular access to specific S3 objects without requiring the auditor to have AWS credentials. The expiration time ensures access is limited. Option B is incorrect because a bucket policy restricting by IP address still requires the auditor to have some form of authentication (like IAM user credentials) to access the bucket, and it doesn't provide object-level granularity.

Option C is incorrect because making the bucket public, even with IP restrictions, is less secure as it could allow unintended access from allowed IPs and doesn't provide temporary access. Option D is incorrect because creating an IAM user for an external auditor and sharing access keys is a security risk; the credentials could be compromised or misused, and it's not a best practice for temporary external access.

64
MCQeasy

Refer to the exhibit. An EC2 instance is launched with an instance profile that references this role. The application on the instance tries to list objects in 'my-bucket' but receives an AccessDenied error. What is the most likely cause?

A.The trust policy does not allow the EC2 service to assume the role.
B.The policy does not grant s3:GetObject permission.
C.The S3 bucket has a bucket policy that denies access.
D.The role does not have any permissions policy attached.
AnswerC

An explicit deny in the bucket policy would override the role's allow.

Why this answer

Even if the IAM role allows s3:ListBucket on the bucket, an explicit deny in the S3 bucket policy will override any allow, resulting in an AccessDenied error. This is a common scenario where both IAM and bucket policies are evaluated, and a deny in either causes denial of access. Option A is incorrect because the trust policy must allow EC2 for the instance profile to work; if it were wrong, the instance wouldn't be able to assume the role at all.

Option B is incorrect because the action required to list objects is s3:ListBucket, not s3:GetObject; the error is for listing, not retrieving. Option D is incorrect because the role has a permissions policy attached (as shown in the exhibit); the issue is the bucket policy denying the request.

65
MCQhard

A company uses AWS Organizations with SCPs. The SCP for the production OU denies all actions on DynamoDB. An IAM policy attached to a user in that OU allows dynamodb:PutItem. What is the effective access?

A.The user can perform PutItem because the IAM policy allows it.
B.The user cannot perform PutItem because the SCP denies all DynamoDB actions and IAM allows are overridden.
C.The user cannot perform PutItem because the SCP applies only to the root account.
D.The user can perform PutItem only if the SCP has an explicit allow.
AnswerB

SCP deny takes precedence over IAM allow.

Why this answer

The user cannot perform PutItem because the SCP denies all DynamoDB actions, and an explicit deny in an SCP overrides any allow from IAM policies. Option A is incorrect because SCPs apply to all principals in the OU and deny overrides allow. Option C is incorrect because SCPs apply to all accounts in the OU, not just the root account.

Option D is incorrect because the SCP does not need an explicit allow; it is deny-by-default for actions not explicitly allowed, but here it has an explicit deny, which overrides any allow.

66
Multi-Selectmedium

Which TWO of the following are valid ways to grant an IAM user permissions to access an S3 bucket? (Choose 2.)

Select 2 answers
A.Assign an instance profile to the user.
B.Create a VPC endpoint policy.
C.Attach an IAM policy to the user.
D.Add the user to an IAM group with a policy.
E.Use an SCP to allow access.
AnswersC, D

IAM policies attached to users grant permissions.

Why this answer

An IAM policy attached directly to a user explicitly grants that user permissions to perform specific actions on an S3 bucket. This is a fundamental method of identity-based access control in AWS, where the policy document defines allowed or denied actions (e.g., s3:GetObject) and resources (e.g., arn:aws:s3:::example-bucket/*).

Exam trap

The trap here is that candidates often confuse identity-based policies (attached to users/groups/roles) with resource-based policies (like bucket policies) or other access control mechanisms (like SCPs or VPC endpoint policies), leading them to select options that do not directly grant permissions to an IAM user.

67
MCQhard

An IAM policy is attached to a user. The user is trying to change their own password in the IAM console but receives an 'Access Denied' error. The user has an MFA device configured and is logged in with MFA. Why is the password change failing?

A.The Allow statement for iam:ChangePassword is not sufficient because the Deny statement explicitly denies all actions.
B.The Deny statement uses 'BoolIfExists' which evaluates to true if the condition key is not present. In the IAM console, the 'aws:MultiFactorAuthPresent' key may not be set, causing the Deny to apply even when the user has MFA.
C.The Deny statement denies all actions unconditionally, so the Allow statement cannot override it.
D.The user does not have permission to change their own password because the Allow statement is not specific enough.
AnswerB

BoolIfExists returns true if the key does not exist, so the Deny applies, blocking all actions including password change.

Why this answer

The Deny statement uses the `BoolIfExists` condition operator with the `aws:MultiFactorAuthPresent` key. In the IAM console, the `aws:MultiFactorAuthPresent` key may not be present in the request context (e.g., during the initial password change flow before MFA is re-validated), causing `BoolIfExists` to evaluate to true when the key is absent. This triggers the Deny even though the user has an MFA device and is logged in with MFA, blocking the `iam:ChangePassword` action.

Exam trap

The trap here is that candidates assume `BoolIfExists` behaves like `Bool` and that MFA presence is always indicated in the request context, but `BoolIfExists` treats a missing key as true, causing the Deny to apply when the key is absent, such as in the IAM console's password change flow.

How to eliminate wrong answers

Option A is wrong because the Deny statement does not explicitly deny all actions; it only denies actions when the condition evaluates to true, so the Allow statement could be sufficient if the condition were not met. Option C is wrong because the Deny statement is not unconditional; it includes a condition (`BoolIfExists`), so it only applies when the condition is true, not to all actions. Option D is wrong because the Allow statement is specific enough (it allows `iam:ChangePassword` for the user's own account), but the Deny overrides it due to the condition evaluation.

68
Matchingmedium

Match each AWS KMS key type to its description.

Drag a concept onto its matching description — or click a concept then click the description.

Concepts
Matches

Managed by AWS for use with specific services

Managed by customer with full control

Used internally by AWS, not visible to customers

Key store backed by AWS CloudHSM

Why these pairings

Customer managed keys give you full control over the key lifecycle and policies. AWS managed keys are created and managed by AWS but allow you to view and audit usage. AWS owned keys are fully managed by AWS and used across many accounts.

Custom key store keys are stored in a CloudHSM cluster under your control. Distractors swap the definitions of customer and AWS managed keys.

69
MCQeasy

An IAM policy attached to a user contains the above statements. The user attempts to download an object from 'example-bucket/confidential/report.pdf'. What is the result?

A.The download fails because the user is not an administrator.
B.The download succeeds because the user can access other objects.
C.The download succeeds because the first statement allows GetObject.
D.The download fails because the deny statement applies to the object.
AnswerD

Explicit deny on the path.

Why this answer

The explicit deny on the 'confidential' folder overrides the allow from the first statement, causing the download to fail. Option A is incorrect because deny overrides, not requiring admin. Option B is incorrect because the ability to access other objects does not apply here.

Option C is incorrect because the first statement allows GetObject generally, but the explicit deny on the specific path overrides it. Option D is correct because the deny applies to the object's path.

70
MCQeasy

A developer is trying to use the AWS CLI to list objects in an S3 bucket but receives an AccessDenied error. The developer has an IAM user with a policy that allows s3:ListBucket on the bucket. What could be causing the error?

A.The developer has not enabled MFA on their IAM user.
B.The S3 bucket has a bucket policy that denies access to the developer's IAM user.
C.The S3 bucket does not exist in the same AWS region as the CLI is configured.
D.The IAM policy is attached to a group, not directly to the user.
AnswerB

An explicit deny in a bucket policy overrides an allow in an IAM policy.

Why this answer

The AccessDenied error indicates that the request was received but denied. Even though the IAM policy allows s3:ListBucket on the bucket, an explicit deny in the S3 bucket policy overrides any allow. Therefore, option B is correct because the bucket policy likely denies access to the developer's IAM user.

Option A is incorrect: MFA is not required unless a condition is set. Option C is incorrect: S3 is a global service and bucket names are globally unique; region configuration does not affect this. Option D is incorrect: attaching a policy to a group still applies to the user as a member, so if the policy allows the action, it is effective.

71
Multi-Selecthard

A company has an S3 bucket with a bucket policy that allows access to a specific IAM role. However, users assume the role but still get access denied. Which THREE factors could cause this?

Select 3 answers
A.The bucket policy does not reference the role's trust policy.
B.A service control policy (SCP) denies the required actions.
C.The bucket policy has a condition on aws:RoleSessionName that does not match.
D.The role's trust policy does not allow the user's account to assume the role.
E.The bucket policy grants access to an IAM user instead of the role.
AnswersB, D, E

SCPs can override IAM permissions.

Why this answer

Options B, D, and E are correct. B: A service control policy (SCP) acts as an upper permissions boundary and can deny actions even if the bucket policy allows them. D: The role's trust policy must allow the user's account to assume the role; if not, the user cannot obtain the role's permissions.

E: The bucket policy must grant access to the role ARN, not an IAM user ARN; granting to a user does not help users who assume the role. Option A is incorrect because the bucket policy does not need to reference the role's trust policy. Option C is incorrect because the aws:RoleSessionName condition is not a common cause and would require explicit configuration.

72
MCQmedium

An organization has a production AWS account and a development AWS account. Developers need to access the production account from the development account using IAM roles. What is the MOST secure way to set this up?

A.Create an IAM role in the production account with a trust policy allowing the development account to assume it.
B.Create IAM users in the production account and share access keys with developers.
C.Establish a VPN connection between the accounts and use directory credentials.
D.Create the same IAM users in both accounts with identical permissions.
AnswerA

Cross-account roles provide temporary credentials.

Why this answer

It uses cross-account IAM roles, allowing developers in the development account to assume a role in the production account using AWS Security Token Service (STS). This provides temporary, least-privilege credentials without sharing long-term access keys. Option B is insecure because sharing access keys creates long-term credentials that are hard to rotate and manage.

Option C is incorrect: a VPN provides network connectivity but does not grant IAM access. Option D is incorrect because IAM users are account-specific; duplicating users across accounts does not enable cross-account access.

73
MCQeasy

An organization wants to use AWS Organizations to centrally manage permissions for multiple accounts. Which IAM feature is used to grant cross-account access within the organization?

A.IAM roles
B.Service control policies (SCPs)
C.Resource-based policies
D.IAM groups
AnswerA

IAM roles allow cross-account access through role assumption.

Why this answer

AWS Organizations allows you to centrally manage multiple accounts, but for actual cross-account access, IAM roles are the primary mechanism. You can create an IAM role in one account and allow users from another account (within or outside the organization) to assume that role. Service control policies (SCPs) set permission boundaries but do not grant direct access across accounts.

Resource-based policies are used for service-specific cross-account access (e.g., S3 bucket policies), not for general IAM access. IAM groups are confined to a single account and cannot be used for cross-account access. Therefore, option A is correct.

74
MCQeasy

An application running on an EC2 instance needs to read from an S3 bucket. What is the BEST practice for granting permissions to the EC2 instance?

A.Store AWS access keys in the application code.
B.Create an IAM user and give access keys to the developer.
C.Use an IAM role and attach it to the EC2 instance profile.
D.Use the root account credentials.
AnswerC

This provides temporary credentials automatically.

Why this answer

Using an IAM role attached to the EC2 instance is the secure and recommended way to grant permissions to applications on EC2.

75
MCQeasy

Refer to the exhibit. An IAM policy is attached to a user. The user is trying to download an object from 'example-bucket' from an IP address of 10.1.1.1. What will happen?

A.Access is denied because the policy does not include an explicit deny
B.Access is allowed because the condition key is misspelled
C.Access is denied because the IP address is not in the allowed range
D.Access is allowed because the policy allows s3:GetObject
AnswerC

The condition restricts to 10.0.0.0/16; 10.1.1.1 is not in that range.

Why this answer

The condition restricts access to the IP range 10.0.0.0/16, and the user's IP is outside that range, so access is denied. Option A is incorrect because the policy does not need an explicit deny; the condition fails, resulting in an implicit deny. Option B is incorrect because the condition key is valid and misspelling would not cause this behavior.

Option D is incorrect because the policy allows s3:GetObject only if the condition is met, which it is not.

Page 1 of 3 · 166 questions totalNext →

Ready to test yourself?

Try a timed practice session using only Identity and Access Management questions.