Courseiva

CCNA IAM Questions

75 of 151 questions · Page 2/3 · IAM topic · Answers revealed

76
MCQmedium

A security team needs to audit all changes to IAM resources in their AWS account. Which AWS service should they use?

A.VPC Flow Logs
B.AWS CloudTrail
C.AWS Config
D.Amazon CloudWatch Logs
AnswerB

AWS CloudTrail records API activity across the account, including every IAM create, update, and delete operation, with the identity, timestamp, and source IP. This provides the complete audit trail the security team needs to track all IAM resource changes.

Why this answer

AWS CloudTrail records API activity across the AWS account, including all IAM resource changes such as CreateUser, AttachPolicy, DeleteRole, and UpdateAssumeRolePolicy. It captures the identity of the caller, the time, the source IP, and the request parameters, making it the authoritative audit trail for IAM modifications. CloudTrail event history provides 90 days of management events by default, and trails can deliver logs to S3 for long-term retention.

Exam trap

SCS-C02 often tests the distinction between CloudTrail (API activity audit), AWS Config (resource configuration history and compliance), and VPC Flow Logs (network traffic metadata), so candidates must match the service to the specific audit requirement — IAM changes require CloudTrail.

How to eliminate wrong answers

Option A is wrong because VPC Flow Logs capture IP traffic metadata (source/destination IP, ports, protocol, accept/reject) at the ENI, subnet, or VPC level — they do not record IAM API calls or resource changes. Option C is wrong because AWS Config records resource configuration changes and evaluates compliance against rules, but it does not provide the full API-level audit trail of who made each IAM change; it shows the resulting configuration state, not the API call details. Option D is wrong because Amazon CloudWatch Logs stores application and service logs, but IAM API activity is not automatically published there — CloudTrail is the service that captures IAM API calls, and CloudWatch Logs can receive CloudTrail logs only if explicitly configured.

77
MCQmedium

A company uses AWS Organizations with SCPs to restrict services. An administrator creates an SCP that denies access to EC2. A developer in a member account tries to launch an EC2 instance but fails. What is the most likely reason?

A.The SCP from the organization denies EC2
B.The root user of the account has denied EC2
C.The developer's IAM permissions boundary blocks EC2
D.The EC2 instance has a resource-based policy denying access
AnswerA

SCPs apply to all principals in the account.

Why this answer

Service Control Policies (SCPs) in AWS Organizations act as a centralized governance mechanism that applies a deny effect across all IAM principals in member accounts. When an SCP explicitly denies access to EC2, it overrides any allow permissions at the account level, including those granted by IAM policies. The developer's launch attempt fails because the SCP's deny is evaluated before any account-level permissions, effectively blocking the action regardless of the developer's IAM role or user permissions.

Exam trap

The trap here is that candidates often assume IAM permissions or permissions boundaries are the primary cause of access failures, overlooking that SCPs apply a blanket deny that overrides all account-level permissions, including those of the root user.

How to eliminate wrong answers

Option B is wrong because the root user of a member account is also subject to SCPs from the organization; while the root user has full permissions by default, an SCP that denies EC2 applies to the root user as well, so the root user cannot bypass the SCP to allow EC2. Option C is wrong because an IAM permissions boundary limits the maximum permissions a principal can have, but it does not deny actions by itself; if the developer's IAM policy allowed EC2 and the boundary did not explicitly deny EC2, the boundary would not cause the failure—the SCP's deny is the overriding factor. Option D is wrong because EC2 instances do not have resource-based policies that control who can launch them; resource-based policies are used for services like S3 buckets or Lambda functions, not for controlling the ability to create EC2 instances.

78
MCQhard

Refer to the exhibit. An IAM policy is attached to a group. A user in the group accesses the S3 bucket from an IP address 203.0.113.5 using HTTPS. What will be the result?

A.The user will be denied access because the source IP is not in the allowed ranges.
B.The user can access objects because an Allow with conditions grants access by default.
C.The user will be denied access because the policy does not allow the action explicitly.
D.The user can access objects because the condition for SecureTransport is met.
AnswerA

Because the only Allow statement in the attached group policy is conditioned on both a permitted source IP range and HTTPS (SecureTransport=true), a request coming from an IP outside that range does not satisfy the source IP condition. In IAM evaluation, an Allow with unsatisfied conditions contributes no effective permission, and since no other applicable statement grants the action, the default-deny rule applies. The user is therefore denied even though HTTPS might be used.

Why this answer

The IAM policy includes a condition that restricts access to only the IP ranges 192.0.2.0/24 and 198.51.100.0/24. The user's IP address 203.0.113.5 does not fall within these ranges, so access is denied. Option B is incorrect because an Allow with conditions does not grant access by default; all conditions must be satisfied.

Option C is incorrect because the policy does explicitly allow the s3:GetObject action, but only under the specified conditions. Option D is incorrect because while SecureTransport is satisfied, the IP condition is not met, and all conditions must be true for the Allow to take effect.

79
Multi-Selecteasy

Which TWO are valid ways to authenticate an IAM user?

Select 2 answers
A.SSL/TLS certificate
B.MFA token
C.Password
D.SSH key pair
E.Access keys (access key ID and secret access key)
AnswersC, E

An IAM user password is the primary authentication factor for the AWS Management Console, entered together with the account ID or alias at the sign-in page. This password is stored as a login profile for the IAM user and can be rotated manually by the user or administratively by an account administrator. It functions as a persistent credential that grants full access to the console session. This is one of the two standard ways to authenticate an IAM user.

Why this answer

Option C (Password) is correct because an IAM user with console access authenticates to the AWS Management Console using a user name and password, which is the standard sign-in credential for interactive console sessions. Option E (Access keys, i.e., access key ID and secret access key) is correct because programmatic requests to AWS APIs, CLI, and SDKs are signed with an access key ID and secret access key pair tied to the IAM user. Option A (SSL/TLS certificate) is not a valid IAM user authentication method; X.509 certificates are used for signing SOAP requests in limited legacy scenarios, not as a general IAM user credential.

Option B (MFA token) is not a standalone authentication method — it is a second factor used in addition to a password or access key, not a primary credential by itself. Option D (SSH key pair) is not an IAM authentication mechanism; SSH keys are used for logging into EC2 instances (e.g., via CodeCommit or instance access), not for authenticating to AWS as an IAM user.

Exam trap

The trap is considering MFA as a primary authentication method. Candidates might select MFA token as a way to authenticate, but it is only a second factor. Another trap is confusing SSH keys with IAM authentication; SSH keys are for EC2 instances, not IAM users.

80
Multi-Selectmedium

Which TWO are best practices for managing IAM roles for EC2 instances?

Select 2 answers
A.Regularly rotate IAM user access keys.
B.Attach the same role to all instances for simplicity.
C.Apply the principle of least privilege when defining role permissions.
D.Use an IAM role to grant permissions to applications running on EC2.
E.Store AWS access keys directly on the instance.
AnswersC, D

Enforcing least privilege means granting only the specific API actions and resources required for the application's function, and then further constraining them with conditions such as ec2:ResourceTag or aws:SourceIp. This limits the blast radius if the instance is compromised because a breached application can only perform the minimal set of operations. A role's policy is the sole authority for what temporary credentials obtained through the instance profile can do, so its precision directly determines the security posture.

Why this answer

The principle of least privilege ensures that an IAM role attached to an EC2 instance grants only the minimum permissions required for the application to function. This reduces the attack surface and limits potential damage from compromised instances. AWS Identity and Access Management (IAM) roles for EC2 use temporary security credentials obtained via the instance metadata service (IMDS), eliminating the need for long-term access keys.

Exam trap

The trap here is that candidates may confuse IAM user access key rotation (Option A) with role credential management, or think that storing keys directly on the instance (Option E) is acceptable if the instance is in a private subnet, but AWS explicitly recommends using IAM roles for EC2 to avoid hardcoded credentials.

81
MCQhard

A security engineer notices that a developer's IAM user has full administrator access. The engineer wants to implement the principle of least privilege for the developer. What is the best way to proceed?

A.Create a new IAM group with the AdministratorAccess policy and add the developer to the group.
B.Use IAM Access Advisor to review the developer's historical usage and create a custom policy that only includes the services and actions used.
C.Replace the AdministratorAccess policy with a managed job function policy such as PowerUserAccess.
D.Remove the administrative access and ask the developer to request permissions as needed.
AnswerB

IAM Access Advisor reports the last-accessed timestamp for each service the developer actually used. Building a custom policy from that historical usage removes unused permissions, achieving least privilege without breaking required workflows, unlike blanket administrator access.

Why this answer

The best way to implement least privilege is to use IAM Access Advisor to review the developer's historical usage and then create a custom policy that only includes the services and actions actually used. This approach is data-driven and ensures that the developer retains necessary permissions while removing unnecessary ones. It aligns with the principle of least privilege by tailoring permissions to actual needs.

Exam trap

SCS-C02 often tests the misconception that using a managed policy like PowerUserAccess is sufficient for least privilege, but it is still too broad; the correct approach is to create a custom policy based on actual usage.

How to eliminate wrong answers

Option A is wrong because creating a new group with AdministratorAccess and adding the developer would still grant full admin access, violating least privilege. Option C is wrong because replacing with PowerUserAccess is still broad and may include more permissions than needed; it is not tailored to the developer's actual usage. Option D is wrong because removing all administrative access and requiring the developer to request permissions as needed is disruptive and does not proactively define a least-privilege policy; it could lead to delays and is not the best practice for implementing least privilege.

82
Multi-Selectmedium

A security engineer is designing a system to manage access to an S3 bucket containing confidential data. Which TWO actions should the engineer take to implement least privilege?

Select 2 answers
A.Use a condition in the IAM policy to restrict access to requests from a specific IP range.
B.Grant only the specific S3 actions needed (e.g., s3:GetObject) rather than s3:*
C.Use a policy that allows s3:* for all users in the organization.
D.Make the bucket public and rely on object ACLs to restrict access.
E.Use pre-signed URLs for all access to the bucket.
AnswersA, B

An IAM condition using aws:SourceIp restricts valid S3 requests to a specified CIDR range, ensuring credentials are only usable from your corporate or trusted network and shrinking the attack surface. This complements least-privilege actions by adding a network-layer control, but remember that if the request goes through a VPC endpoint, aws:SourceIp is not evaluated and you must use aws:sourceVpce instead. It is a valid, cost-free way to reduce exposure.

Why this answer

Option A is correct because adding an IAM policy condition such as aws:SourceIp to restrict requests to a specific IP range narrows the circumstances under which the allowed S3 actions can be performed, which is a core least-privilege technique. Option B is correct because granting only the specific actions required (for example s3:GetObject instead of s3:*) limits permissions to exactly what the workload needs, directly implementing least privilege. Option C is wrong because allowing s3:* for all users in the organization grants far broader permissions than necessary and violates least privilege.

Option D is wrong because making the bucket public exposes the confidential data and object ACLs alone are not a least-privilege access control mechanism. Option E is wrong because pre-signed URLs are a temporary delegation mechanism, not a substitute for scoping IAM permissions to the minimum required actions and conditions.

Exam trap

SCS-C02 often tests the misconception that using pre-signed URLs or object ACLs alone achieves least privilege, when in fact least privilege requires explicit, minimal IAM actions and conditions.

83
MCQmedium

A company uses AWS IAM Identity Center (AWS SSO) to manage access. A user is assigned to a permission set that grants AdministratorAccess. However, when the user tries to access the AWS console, they receive an error that they are not authorized. What is a possible reason?

A.The user is not assigned to the AWS account in Identity Center
B.The user has not set up MFA
C.The permission set does not include the necessary policies
D.The user does not have permissions to manage permission sets
AnswerA

In AWS IAM Identity Center, access to an AWS account is granted only after an account assignment links the user (or a group containing them) to a permission set in that account. The assignment is what provisions the temporary IAM role credentials, so without it the portal might still list the account but authorization fails because no IAM role exists for that user. This missing assignment is exactly the root cause and must be created in the console or CLI before access is possible.

Why this answer

In AWS IAM Identity Center, a user must be assigned to both a permission set and an AWS account. The error occurs when the user has the permission set but not the account assignment. Option B is incorrect because MFA is about authentication, not authorization; the user could be authenticated but still lack access to the account.

Option C is incorrect because the permission set already includes AdministratorAccess, which provides full permissions; the issue is the account assignment. Option D is incorrect because the error is about accessing the console, not about managing permission sets.

84
MCQhard

An IAM policy includes: { "Effect": "Allow", "Action": "iam:PassRole", "Resource": "arn:aws:iam::*:role/MyRole" }. What does this allow?

A.Allows the user to create the role MyRole.
B.Allows the user to pass the role MyRole to an AWS service like Lambda.
C.Allows the user to assume the role MyRole.
D.Allows the user to attach the role to an IAM user.
AnswerB

This is the exact definition of iam:PassRole: it permits a user to specify an existing IAM role as a configuration parameter for an AWS service, such as setting the execution role for a Lambda function or the instance profile for an EC2 instance. The user is not assuming the role themselves, but rather delegating the role to the service so that the service can use its permissions after assuming it via its trust policy.

Why this answer

Iam:PassRole allows a user to pass a role to an AWS service such as Lambda, enabling the service to assume that role. Option A is incorrect because creating a role requires the iam:CreateRole action, not iam:PassRole. Option C is incorrect because assuming a role requires the sts:AssumeRole action.

Option D is incorrect because attaching a role to an IAM user is not a valid operation; roles are attached to services, not users.

85
MCQeasy

A company wants to grant temporary credentials to mobile app users to access their own data in an S3 bucket. Which AWS service should be used to achieve this securely?

A.Amazon Cognito identity pools
B.AWS Key Management Service (KMS)
C.IAM users with long-term access keys
D.Amazon CloudFront signed URLs
AnswerA

Amazon Cognito identity pools are purpose-built for granting temporary AWS credentials to mobile app users. When an identity is authenticated (via Cognito User Pools, social providers, or SAML), the identity pool exchanges the user's token for short-lived credentials by assuming an IAM role. These credentials are scoped to that role's permissions and automatically expire, eliminating the need to embed or manage long-term access keys. This is the standard serverless pattern for secure mobile access to AWS APIs.

Why this answer

Cognito Identity Pools can issue temporary AWS credentials for authenticated users. Option B is wrong because IAM users are not suitable for millions of mobile users. Option C is wrong because KMS is for encryption keys.

Option D is wrong because CloudFront is a CDN, not for issuing credentials.

86
Multi-Selectmedium

An IAM policy includes the following statement: 'Effect': 'Allow', 'Action': 's3:GetObject', 'Resource': 'arn:aws:s3:::example-bucket/*', 'Condition': {'IpAddress': {'aws:SourceIp': '192.0.2.0/24'}}. Which TWO statements about this policy are correct?

Select 2 answers
A.The policy allows s3:PutObject from the IP range 192.0.2.0/24.
B.Requests from outside 192.0.2.0/24 will be implicitly denied.
C.The policy allows s3:GetObject only if the bucket owner matches.
D.The policy allows anonymous access.
E.The policy allows s3:GetObject from the IP range 192.0.2.0/24.
AnswersB, E

This is correct because an IAM policy's Allow effect only takes effect when all conditions are satisfied. The IpAddress condition restricts valid source IPs to 192.0.2.0/24; if a request originates outside that range, the condition fails and the Allow does not apply. Since no other statement explicitly allows the action, the request is implicitly denied by default.

Why this answer

Option E is correct because the statement's Action is s3:GetObject and its Condition restricts aws:SourceIp to 192.0.2.0/24, so the allow applies exactly to GetObject requests originating from that CIDR range. Option B is correct because IAM policies are deny-by-default: any request that does not satisfy the IpAddress condition (i.e., comes from outside 192.0.2.0/24) is not matched by this Allow and is therefore implicitly denied, absent another applicable allow. Option A is wrong because s3:PutObject is not listed in the Action, so the policy never grants write access.

Option C is wrong because there is no condition on bucket ownership; the only condition is the source IP. Option D is wrong because the policy grants no anonymous/public access by itself—it only allows GetObject when the request's source IP falls in the specified range, and it does not remove authentication requirements.

Exam trap

SCS-C02 often tests IAM policy evaluation logic — candidates forget that a Condition on an Allow statement means requests failing the condition are implicitly denied, and they confuse GetObject with PutObject or assume the policy grants anonymous access.

87
MCQeasy

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

A.Denies all S3 actions when the request is not using HTTPS.
B.Denies all S3 actions to a specific bucket.
C.Denies all S3 actions for all users.
D.Allows all S3 actions only when using HTTPS.
AnswerA

The policy statement uses "Effect": "Deny" with a condition key "aws:SecureTransport" set to "false". Since "Resource" is "*", it denies every S3 API action—on any bucket or object—when the request is transmitted over HTTP without TLS. This is a standard pattern to enforce HTTPS: any request where the secure transport boolean is false is blocked, while HTTPS requests remain unaffected by this statement.

Why this answer

The policy statement has an explicit Deny effect for all S3 actions on all resources, with a condition that the request must have aws:SecureTransport set to false. aws:SecureTransport is a global condition key that evaluates to true if the request uses SSL/TLS, and false otherwise. Therefore, the policy denies all S3 actions when the request is not using HTTPS (i.e., when SecureTransport is false).

Exam trap

SCS-C02 often tests the difference between explicit Deny and Allow, and candidates may misinterpret the condition as allowing HTTPS instead of denying HTTP.

How to eliminate wrong answers

Option B is wrong because the Resource is '*', meaning it applies to all resources, not a specific bucket. Option C is wrong because the policy only denies requests that meet the condition; it does not deny all S3 actions for all users unconditionally—requests using HTTPS are not denied by this statement (though they might be allowed or denied by other policies). Option D is wrong because the effect is Deny, not Allow; the policy does not allow any actions, it only denies when the condition is met.

88
MCQmedium

A developer needs to grant an EC2 instance access to an S3 bucket. Which is the most secure way to provide credentials to the EC2 instance?

A.Store AWS access keys in the application code
B.Store the keys in an S3 bucket and download them at startup
C.Create an IAM role and attach it to the EC2 instance profile
D.Use environment variables to store the keys
AnswerC

Creating an IAM role and attaching it to the EC2 instance profile is the AWS-recommended pattern. The instance profile securely delivers temporary credentials to the instance through the instance metadata service (IMDSv2), and the AWS SDKs automatically retrieve and refresh these credentials. Permissions are scoped to the role's policy, no secrets are stored on disk or in source code, and credentials rotate automatically, minimizing the blast radius of any single credential leak.

Why this answer

It uses an IAM role attached to an EC2 instance profile, which allows the instance to obtain temporary, automatically rotated credentials from the AWS STS service via the instance metadata service (IMDS). This eliminates the need to hardcode, store, or manage long-term access keys, significantly reducing the risk of credential exposure.

Exam trap

The trap here is that candidates may think storing keys in S3 or environment variables is acceptable, but the exam emphasizes that any form of long-term static credential storage on an EC2 instance is insecure compared to using IAM roles with instance profiles and temporary credentials from STS.

How to eliminate wrong answers

Option A is wrong because storing AWS access keys in application code exposes them to version control, code reviews, and potential leaks, violating the principle of least privilege and long-term credential security. Option B is wrong because storing keys in an S3 bucket and downloading them at startup still requires the instance to have long-term credentials to access the bucket, creating a circular dependency and exposing keys during transit and at rest. Option D is wrong because environment variables can be read by any process or user on the instance, are often logged or captured in debugging output, and still rely on long-term access keys that must be manually rotated.

89
MCQmedium

An IAM policy grants access to a DynamoDB table with a condition that the request must originate from a specific VPC endpoint. However, requests from an EC2 instance in that VPC are being denied. What is the most likely cause?

A.The EC2 instance does not have a public IP address.
B.The security group on the EC2 instance does not allow outbound traffic to the DynamoDB endpoint.
C.The EC2 instance is not using the VPC endpoint to access DynamoDB; it is using an internet gateway.
D.The VPC endpoint policy does not allow the specific DynamoDB action.
AnswerC

The IAM policy includes a condition that requires requests to originate from the VPC endpoint (e.g., aws:SourceVpce). If the EC2 instance routes traffic over an internet gateway to DynamoDB's public endpoint, the source is the internet gateway, not the VPC endpoint, so the condition fails. This mismatch directly explains the access denied error. To resolve it, the instance should route DynamoDB-bound traffic through the VPC endpoint, or the condition must be changed to align with the actual traffic path.

Why this answer

The IAM policy condition uses aws:SourceVpce to restrict access to requests routed through a specific VPC endpoint. If the EC2 instance reaches DynamoDB via an internet gateway (using the public DynamoDB endpoint), the request's source is not the VPC endpoint, so the condition evaluates to false and access is denied. The instance must be configured to resolve the DynamoDB service name to the VPC endpoint's private DNS name (via the endpoint's private DNS or a Route 53 private hosted zone) so traffic actually flows through the endpoint.

Exam trap

SCS-C02 often tests the misconception that creating a VPC endpoint automatically routes all DynamoDB traffic through it, when in fact DNS resolution and route selection determine whether aws:SourceVpce is populated.

How to eliminate wrong answers

Option A is wrong because a public IP is irrelevant to VPC endpoint access — interface endpoints use private IPs and the instance doesn't need a public IP to reach them. Option B is wrong because the security group on the EC2 instance governs outbound traffic to the endpoint's ENI, but the symptom described (denial due to a condition on the request source) points to the request not traversing the endpoint at all, not a blocked outbound rule; a blocked SG would typically cause a timeout, not an IAM condition failure. Option D is wrong because a restrictive endpoint policy would produce an explicit AccessDenied from the endpoint policy, and the question already states the IAM policy grants access with a source condition — the endpoint policy is a separate layer not indicated as the cause.

90
MCQmedium

A company uses AWS Organizations with multiple accounts. The security team wants to enforce that no IAM user can have an access key older than 90 days. What is the MOST efficient way to achieve this?

A.Use an SCP in the root organizational unit that denies IAM actions if the access key age exceeds 90 days.
B.Use AWS Config rules to detect old access keys and send alerts.
C.Use an IAM policy in each account that denies access if the key age exceeds 90 days.
D.Use an SCP to disable IAM user creation.
AnswerA

A service control policy (SCP) applied at the root organizational unit centrally enforces the 90-day access key age limit across all accounts. SCPs can use a condition like 'aws:AccessKeyAge' to deny actions (e.g., 'iam:CreateAccessKey') when the age exceeds 90 days. This is the most efficient because it's a single policy that applies to all accounts without per-account configuration or manual auditing.

Why this answer

A service control policy (SCP) applied at the root organizational unit centrally enforces the 90-day access key age limit across all accounts. SCPs can use a condition like 'aws:AccessKeyAge' to deny actions (e.g., 'iam:CreateAccessKey') when the age exceeds 90 days. This is the most efficient because it's a single policy that applies to all accounts without per-account configuration or manual auditing.

Option B (AWS Config) is reactive—it only sends alerts and does not prevent excessive key age.

Option C (IAM policy in each account) requires deploying a policy to every account individually, which is less efficient and prone to gaps.

Option D disables IAM user creation entirely, which is too restrictive and does not address existing old access keys.

91
Multi-Selecteasy

Which TWO of the following are best practices for managing IAM user credentials? (Choose TWO.)

Select 2 answers
A.Create a single IAM user for multiple developers.
B.Store access keys in source code repositories for convenience.
C.Enable MFA for all IAM users.
D.Rotate access keys regularly.
E.Use long-term access keys for all users.
AnswersC, D

Enabling MFA for all IAM users is a core AWS security best practice because it requires something the user has, such as a TOTP device or U2F key, in addition to a password or access key. This materially reduces the risk that a stolen password or access key alone can be used to access the account, and AWS recommends MFA for every user including root. MFA protects against credential theft and is an explicit requirement for privileged accounts in many compliance frameworks.

Why this answer

Option C is correct because enabling multi-factor authentication (MFA) for all IAM users adds a second authentication factor beyond the password, significantly reducing the risk of credential compromise if a password is leaked or guessed. Option D is correct because regularly rotating access keys limits the window of exposure if a key is compromised and aligns with AWS security best practices for credential lifecycle management. Option A is incorrect because sharing a single IAM user across multiple developers eliminates individual accountability and makes it impossible to audit or revoke access per person; each developer should have a unique IAM user or federated identity.

Option B is incorrect because storing access keys in source code repositories exposes them to anyone with repository access and is a common cause of credential leakage; secrets should be stored in AWS Secrets Manager or similar. Option E is incorrect because relying on long-term access keys for all users increases risk; temporary credentials via IAM roles or AWS STS are preferred where possible.

Exam trap

SCS-C02 often tests the misconception that convenience (shared users, hardcoded keys) is acceptable, when the exam expects you to recognize that identity isolation, MFA, and short-lived credentials are non-negotiable security controls.

92
MCQeasy

A company wants to allow users from an external AWS account to assume a role in the company's account. What must be configured in the company's account?

A.An IAM user in the company's account with cross-account access.
B.A permissions policy that allows the external account to list roles.
C.An IAM identity provider for the external account.
D.A trust policy that allows the external account to assume the role.
AnswerD

The trust policy, also called the assume-role policy, is attached to the IAM role and grants the external AWS account permission to call sts:AssumeRole, with the account ID listed as the Principal. When the external account's IAM users or roles have permission to use that trust relationship, AWS then issues temporary credentials scoped by the role's permissions policy. This is exactly the cross-account role assumption pattern required to give the external account access.

Why this answer

Cross-account IAM role access requires the role in the company's account to have a trust policy that explicitly grants the external AWS account's root user or specific IAM entities permission to assume the role. The trust policy uses the `sts:AssumeRole` action and specifies the external account ID as the `Principal`, which establishes the trust relationship necessary for the external account to request temporary security credentials via AWS STS.

Exam trap

The trap here is that candidates confuse a trust policy (which grants permission to assume a role) with a permissions policy (which defines what actions the role can perform after being assumed), leading them to incorrectly select Option B or C.

How to eliminate wrong answers

Option A is wrong because creating an IAM user in the company's account with cross-account access would require sharing long-term access keys, which violates the principle of least privilege and does not leverage the secure, temporary credential model of role assumption. Option B is wrong because a permissions policy that allows the external account to list roles does not grant the ability to assume a role; listing roles is a read-only operation that provides no mechanism for obtaining temporary credentials or performing actions in the company's account. Option C is wrong because an IAM identity provider is used for federating external identities (e.g., SAML 2.0 or OpenID Connect) from a third-party identity provider, not for granting access to another AWS account's IAM entities; cross-account role access between AWS accounts does not require an identity provider.

93
MCQhard

A security team wants to grant a Lambda function access to read from a DynamoDB table in the same account. What is the most secure way to do this?

A.Create a VPC endpoint for DynamoDB and associate it with the Lambda function.
B.Attach the AWS managed policy AmazonDynamoDBFullAccess to the Lambda execution role.
C.Store the database access keys in the Lambda environment variables.
D.Create an IAM role with a policy that allows only the required DynamoDB actions (e.g., GetItem, Query) on the specific table and assign it to the Lambda function.
AnswerD

The correct approach is to create a custom IAM role with a policy that grants only the required DynamoDB actions (e.g., GetItem, Query) on the specific table ARN, and then assign that role to the Lambda function as its execution role. At runtime, Lambda uses this role to obtain temporary credentials through AWS STS, which are automatically rotated and scoped to the policy. This follows the principle of least privilege because the function can only perform the exact actions on the exact table it needs, minimizing the blast radius of a compromise. It is the AWS-recommended best practice for granting Lambda functions access to AWS services.

Why this answer

The most secure method is D because it follows the principle of least privilege by creating a custom IAM role that grants only the necessary DynamoDB actions (like GetItem, Query) on the specific table. This limits the Lambda function's permissions to only what is required. Option A is incorrect because a VPC endpoint allows network access to DynamoDB but does not grant IAM permissions; the Lambda function still needs an IAM role with appropriate permissions.

Option B is incorrect because attaching the managed policy AmazonDynamoDBFullAccess grants full access to all DynamoDB resources, violating least privilege and increasing security risk. Option C is incorrect because storing database access keys in Lambda environment variables exposes credentials and is insecure; the recommended approach is to use an IAM execution role.

94
MCQhard

A security engineer is configuring an IAM role for a Lambda function that must access an Amazon RDS database. The engineer wants the Lambda function to retrieve database credentials from AWS Secrets Manager without hardcoding them. Which combination of IAM permissions and trust policy is required?

A.The role's trust policy must allow lambda.amazonaws.com to assume it, and the role's permissions policy must allow secretsmanager:GetSecretValue on the specific secret ARN.
B.The role's trust policy must allow the Lambda function's IAM user to assume it, and the permissions policy must allow secretsmanager:GetSecretValue.
C.The role's trust policy must allow lambda.amazonaws.com, and the permissions policy must allow secretsmanager:* on all resources.
D.The role's trust policy must allow secretsmanager.amazonaws.com to assume it, and the permissions policy must allow rds:DescribeDBInstances.
AnswerA

Lambda functions assume an execution role via the service principal lambda.amazonaws.com. The trust policy must allow that principal to call sts:AssumeRole. The permissions policy then grants secretsmanager:GetSecretValue on the secret ARN, enabling the function to retrieve credentials securely without embedding them in code. This is the standard, least-privilege approach for Lambda accessing Secrets Manager.

Why this answer

A Lambda execution role requires a trust policy that allows the Lambda service principal to assume it, and a permissions policy that grants the specific Secrets Manager action on the secret ARN. This enables secure, dynamic credential retrieval without hardcoding. Trusting the wrong principal or granting excessive permissions fails the security and functional requirements.

Exam trap

The trap here is confusing the trust policy principal with the permissions policy action, and assuming the service that stores the secret is the one that assumes the role.

95
MCQeasy

A company has a single AWS account with multiple IAM users. The administrator created an IAM policy that allows all users to launch EC2 instances, but only if they use a specific AMI ID (ami-12345678) and a specific instance type (t3.micro). The policy uses a condition that checks the EC2 instance type and AMI ID. However, a user is able to launch an EC2 instance with a different AMI ID and a larger instance type. The administrator reviews the policy and confirms that the condition is correctly written. What is the most likely reason that the policy is not working as expected?

A.The condition keys used (ec2:InstanceType and ec2:ImageId) are not supported for the RunInstances action in IAM policies.
B.The policy is attached to the user but must also be attached to the IAM group.
C.The policy does not include an explicit deny statement for non-compliant launches.
D.The condition is written incorrectly; it should use StringLike instead of StringEquals.
AnswerC

In IAM, the default behavior is to deny access, but that default is overridden by any applicable allow statement from another policy. This policy only allows RunInstances when the specified condition keys match; it does not explicitly deny RunInstances when the conditions are not met. Consequently, if the user has any other identity-based or resource-based policy that allows RunInstances without conditions, the user can still launch non-compliant instances. An explicit Deny statement using a condition like StringNotEquals (or a NotCondition) would be required to block those non-compliant launches, making the missing deny the root cause.

Why this answer

The most likely reason is that the user has another IAM policy attached (e.g., a managed policy or group policy) that allows ec2:RunInstances without the condition. IAM evaluates all policies; if any allow statement grants the action, the action is permitted unless explicitly denied. The conditional allow only restricts when that specific statement is used, but a separate unconditional allow overrides the condition.

Adding an explicit deny for non-compliant launches would block them regardless of other policies.

Exam trap

Candidates often assume that adding a condition to an allow statement is sufficient to restrict actions, but if another allow statement without the condition exists, the condition is ineffective. An explicit deny is required to override other allows.

How to eliminate wrong answers

Option B is wrong because attaching a policy to an IAM group is not required for it to take effect; policies attached directly to a user are fully evaluated and do not need group attachment to work. Option C is wrong because an explicit deny statement is not needed; IAM policies are deny-by-default, so an allow with a condition that fails results in an implicit deny, but the condition keys are unsupported, so the condition is ignored and the allow applies broadly. Option D is wrong because the condition key issue is not about the operator (StringEquals vs StringLike); even if StringLike were used, the unsupported condition keys would still be ignored, so the policy would still not restrict the launch.

96
MCQmedium

A security engineer reviews the trust policy of an IAM role. Which accounts can assume this role?

A.Only the root user of account 123456789012
B.Account 123456789012
C.Any AWS account
D.Account 111111111111
AnswerD

By setting the Principal to "arn:aws:iam::111111111111:root", the trust policy authorizes all IAM users and roles within account 111111111111 to assume the role. This root principal syntax is idiomatic for granting an entire account access, including both current and future IAM principals in that account. The policy does not restrict to a specific user or role, so the correct interpretation is that the whole account is permitted.

Why this answer

The trust policy of the IAM role specifies a principal of "111111111111" as the trusted entity. This means only accounts explicitly listed in the Principal element can assume the role. Since the policy does not include account 123456789012 or allow any AWS account, only account 111111111111 is authorized to assume the role.

Exam trap

The trap here is that candidates often assume the role is in the account that owns the trust policy (e.g., 123456789012) and mistakenly think that account can always assume it, but the trust policy explicitly lists a different account as the trusted entity, so only that account's principals can assume the role.

How to eliminate wrong answers

Option A is wrong because the trust policy does not restrict the principal to the root user of account 123456789012; it specifies account 111111111111, not 123456789012. Option B is wrong because account 123456789012 is not listed in the Principal element of the trust policy, so no IAM users or roles from that account can assume the role. Option C is wrong because the trust policy does not use a wildcard principal like "*" or "AWS": "*", which would allow any AWS account; it explicitly specifies a single account ID.

97
MCQeasy

A developer needs to grant an IAM user temporary access to an S3 bucket for 15 minutes. Which AWS service should be used to generate temporary credentials?

A.AWS Certificate Manager (ACM)
B.AWS Key Management Service (KMS)
C.AWS Security Token Service (STS)
D.AWS Directory Service
AnswerC

AWS Security Token Service (STS) is the service that issues short-lived credentials composed of an access key ID, secret access key, and session token, exactly what an IAM user needs for temporary access. By calling sts:AssumeRole (or GetFederationToken), the developer can request a role's permissions for a configurable duration and receive credentials that expire automatically. This matches the requirement: STS is the correct service for granting temporary access to AWS resources.

Why this answer

AWS Security Token Service (STS) is the service that issues temporary, limited-privilege credentials via APIs like AssumeRole, GetSessionToken, and GetFederationToken. To grant an IAM user temporary access to an S3 bucket for 15 minutes, you call STS AssumeRole (or GetSessionToken) with a DurationSeconds value of 900, and STS returns an access key, secret key, and session token that expire automatically.

Exam trap

SCS-C02 often tests whether candidates confuse key-management services with credential-issuing services; the trap is selecting KMS because it 'manages keys,' when the question is about temporary IAM credentials, which only STS provides.

How to eliminate wrong answers

Option A is wrong because AWS Certificate Manager (ACM) provisions and manages TLS/SSL certificates for HTTPS — it has no role in issuing credentials. Option B is wrong because AWS KMS manages encryption keys for data at rest and does not issue IAM credentials or session tokens. Option D is wrong because AWS Directory Service provides managed Microsoft AD or Simple AD for directory-based identity, not temporary AWS credentials; it can be a source of identities but does not itself mint STS tokens.

98
Multi-Selecthard

Which THREE AWS services can be used to authenticate users for accessing AWS resources?

Select 3 answers
A.AWS Single Sign-On
B.Amazon Cognito
C.AWS Secrets Manager
D.AWS Identity and Access Management (IAM)
E.AWS CloudTrail
AnswersA, B, D

AWS Single Sign-On (now AWS IAM Identity Center) authenticates users by acting as a broker between AWS and a trusted external identity provider, such as Okta, Azure AD, or a built-in identity store. It validates the user's credentials through the IdP and then issues temporary AWS credentials or federation tokens, making it a fully functional authentication service for workforce users.

Why this answer

AWS Single Sign-On (SSO) is a service that centrally manages access to multiple AWS accounts and business applications, authenticating users via an external identity provider (IdP) such as Microsoft Active Directory or Okta. It allows users to sign in once and gain federated access to assigned AWS resources, making it a valid authentication service for AWS resource access.

Exam trap

The trap here is that candidates often confuse AWS Secrets Manager as an authentication service because it stores credentials, but it does not authenticate users—it only provides secure storage for secrets that other services use.

99
MCQhard

A security team notices that an IAM user has permissions to launch EC2 instances but should not have access to certain instance types. Which IAM policy condition key should be used to restrict this?

A.ec2:ResourceTag
B.ec2:Tenancy
C.ec2:InstanceProfile
D.ec2:InstanceType
AnswerD

ec2:InstanceType is the IAM condition key specifically intended for restricting the type of EC2 instance a principal can launch, and it can be used with the ec2:RunInstances action. By applying, for example, a StringLike condition of "t3.*" or "t3.micro", an administrator can deny all other instance families and sizes. This key is evaluated as a request-level condition during the RunInstances call, so it directly matches the requirement to control which instance type a user is allowed to create.

Why this answer

The ec2:InstanceType condition key allows you to restrict IAM users to launching only specific EC2 instance types (e.g., t2.micro, m5.large) by evaluating the instance type value in the RunInstances API call. This is the correct key to enforce a policy that denies access to certain instance types while permitting others.

Exam trap

The trap here is that candidates often confuse ec2:InstanceType with ec2:ResourceTag, thinking they can use tags to restrict instance types, but tags are applied after launch and cannot be used to block the initial API call based on instance type.

How to eliminate wrong answers

Option A is wrong because ec2:ResourceTag is used to control access based on tags attached to EC2 resources, not to restrict instance types. Option B is wrong because ec2:Tenancy controls whether instances can be launched on shared or dedicated hardware (e.g., default vs. dedicated tenancy), not the instance type. Option C is wrong because ec2:InstanceProfile is used to restrict which IAM roles (instance profiles) can be associated with an EC2 instance, not the instance type itself.

100
MCQhard

An IAM policy allows a user to pass a specific role and launch EC2 instances. The user tries to launch an EC2 instance with the role 'ec2-full-access' but receives an error: 'You are not authorized to perform iam:PassRole'. What is the MOST likely cause?

A.The role 'ec2-full-access' does not exist in the account
B.The user is attempting to pass a role with an ARN that does not exactly match the one in the policy
C.The policy is missing a condition key such as ec2:InstanceProfile
D.The user does not have permission to call ec2:RunInstances
AnswerB

The iam:PassRole error occurs because the role ARN in the request does not exactly match the Resource element in the policy. IAM evaluates ARNs literally, so any mismatch in account, path, or role name denies the action despite the Allow.

Why this answer

The error 'You are not authorized to perform iam:PassRole' indicates that the iam:PassRole permission is being denied. In IAM policies, the Resource element for iam:PassRole must specify the exact ARN of the role that can be passed. If the user attempts to pass a role whose ARN does not exactly match the ARN in the policy (e.g., due to a different path, account ID, or role name), the PassRole action is not allowed, resulting in this error.

Therefore, the most likely cause is that the role ARN being passed does not match the ARN specified in the policy.

Exam trap

SCS-C02 often tests the misconception that iam:PassRole permission is granted based on role name alone, but the exam expects you to know that the exact ARN, including path and account ID, must match the policy's Resource element.

How to eliminate wrong answers

Option A is wrong because if the role did not exist, the error would typically be 'The role with name ec2-full-access cannot be found' or similar, not an authorization error for iam:PassRole. Option C is wrong because condition keys like ec2:InstanceProfile are used to restrict which instance profiles can be passed, but the absence of such a condition does not cause an authorization failure; it would only make the policy less restrictive. Option D is wrong because the error explicitly mentions iam:PassRole, not ec2:RunInstances; if the user lacked RunInstances permission, the error would be 'You are not authorized to perform ec2:RunInstances'.

101
Multi-Selecthard

Which THREE factors should be considered when designing IAM policies for cross-account access? (Choose three.)

Select 3 answers
A.The resource-based policy must allow the external account
B.Permission boundaries must be used
C.The AWS account ID must be specified in the policy
D.The IAM policy in the external account must allow the action
E.Service control policies (SCPs) must allow the action
AnswersA, C, D

For cross-account access, the resource owner must explicitly grant the external account or its principal access in the resource-based policy. This policy defines the trust relationship because it specifies who can access the resource and what actions they can perform. Without this allow, the request fails even if the caller has valid IAM permissions in their own account.

Why this answer

For cross-account access using resource-based policies (e.g., S3 bucket policies, KMS key policies), the resource-based policy must explicitly grant access to the external AWS account. This allows the external account's IAM principals to access the resource, provided the external account's IAM policy also permits the action. Without this allowance in the resource-based policy, the external account cannot access the resource, even if its own IAM policies allow it.

Exam trap

The SCS-C02 exam often tests the misconception that only one policy (either resource-based or identity-based) is sufficient for cross-account access, but in reality both the resource-based policy and the external account's IAM policy must allow the action.

102
MCQeasy

A company needs to grant cross-account access to an S3 bucket in Account A to users in Account B. What is the recommended approach?

A.Attach an IAM role to Account B's users.
B.Add a bucket policy in Account A that grants access to the IAM user ARNs from Account B.
C.Make the bucket public.
D.Create an IAM user in Account A and share the credentials with Account B users.
AnswerB

A bucket policy in Account A can specify the Amazon Resource Names (ARNs) of IAM users from Account B in the Principal element, granting them explicit actions such as s3:GetObject on the bucket and its objects. For this to work, those IAM users also need an identity-based policy in Account B that allows the corresponding S3 actions, but the bucket policy is what authorizes the cross-account access at the resource level. This approach is precise, auditable, and follows least privilege because only the named IAM users get access, not any broader principal.

Why this answer

A bucket policy in Account A can explicitly grant cross-account access to IAM user ARNs from Account B. This is the recommended approach for granting access to an S3 bucket across AWS accounts, as it avoids managing additional IAM users or roles and leverages the resource-based policy directly on the bucket. The bucket policy must specify the `Principal` element with the AWS account ID of Account B and the `Action` and `Resource` for the S3 operations, allowing Account B's IAM users to access the bucket after they have appropriate permissions in their own account.

Exam trap

The trap here is that candidates often confuse resource-based policies (bucket policies) with identity-based policies (IAM policies) and incorrectly think that a bucket policy cannot grant access to users in another account, or they mistakenly believe that an IAM role must be created in the target account for cross-account access.

How to eliminate wrong answers

Option A is wrong because attaching an IAM role to Account B's users is not a valid operation; IAM roles are attached to AWS resources or assumed by users, not directly attached to users in another account. The correct approach would be for Account B's users to assume a cross-account role, but that requires a role in Account A with a trust policy, not attaching a role to users. Option C is wrong because making the bucket public grants access to anyone on the internet, which violates the principle of least privilege and is not a secure cross-account access method.

Option D is wrong because creating an IAM user in Account A and sharing credentials with Account B users introduces security risks (e.g., credential leakage, lack of audit trail) and is not a scalable or recommended practice for cross-account access.

103
Multi-Selecteasy

Which TWO services can be used to manage identity and access across multiple AWS accounts? (Choose TWO.)

Select 2 answers
A.Amazon Cognito
B.AWS Organizations
C.AWS Single Sign-On (SSO)
D.AWS Config
E.AWS CloudTrail
AnswersB, C

AWS Organizations is a governance service that lets you centrally manage multiple AWS accounts by organizing them into organizational units and applying service control policies (SCPs). SCPs define the maximum allowed permissions for every IAM principal in an account, effectively managing identity and access by creating guardrails at the organization level. This makes Organizations a correct service for managing identity and access across accounts.

Why this answer

AWS Organizations (B) is correct because it centrally manages multiple AWS accounts under a single organization, enabling consolidated billing and centralized policy-based governance through Service Control Policies (SCPs) that control access across all member accounts. AWS Single Sign-On (C) is correct because it provides centralized identity and access management across multiple AWS accounts, letting users sign in once with their existing corporate credentials and access assigned accounts and roles via permission sets. Amazon Cognito (A) is incorrect because it is a customer-facing identity service for web and mobile applications (user pools and identity pools), not for managing access across AWS accounts.

AWS Config (D) is incorrect because it is a configuration compliance and auditing service that records resource changes, not an identity and access management service. AWS CloudTrail (E) is incorrect because it logs API activity and account events for auditing, not identity or access management.

Exam trap

SCS-C02 often tests the distinction between services that manage identities and access versus those that monitor or audit, so candidates may incorrectly select AWS Config or CloudTrail for identity management.

104
MCQmedium

A company uses IAM roles for EC2 instances to access S3. A security audit reveals that some instances have roles with overly permissive policies. What is the BEST practice to scope down permissions while maintaining functionality?

A.Use S3 bucket policies instead of IAM policies
B.Attach the AdministratorAccess policy to the role and use S3 conditions
C.Create custom IAM policies that grant only the necessary S3 actions on specific buckets
D.Create a new instance profile with a more restrictive permissions boundary
AnswerC

A custom IAM policy should be scoped to the exact S3 actions the application requires, such as s3:GetObject and s3:PutObject, and limited to the specific bucket ARNs and optional prefixes. When attached to the instance role, this policy ensures the temporary credentials issued to the EC2 instance can perform only the intended S3 operations, aligning with the least-privilege principle. This is the standard and recommended way to control S3 access for EC2 roles.

Why this answer

The best practice to scope down permissions while maintaining functionality is to create custom IAM policies that grant only the necessary S3 actions on specific buckets. This follows the principle of least privilege, ensuring that the EC2 instances have exactly the permissions they need to perform their tasks, and no more. This approach is more granular and secure than using broader policies or alternative methods.

Exam trap

SCS-C02 often tests the misconception that permissions boundaries alone can restrict permissions; they only limit, but you still need to attach appropriate policies. Also, candidates might think bucket policies can replace IAM policies, but they serve different purposes.

How to eliminate wrong answers

Option A is wrong because using S3 bucket policies instead of IAM policies does not scope down the IAM role's permissions; bucket policies are resource-based and can complement IAM policies, but they do not replace the need for least privilege in IAM. Option B is wrong because attaching AdministratorAccess is overly permissive and violates least privilege, even with S3 conditions; it grants full access to all AWS services. Option D is wrong because creating a new instance profile with a permissions boundary does not by itself scope down permissions; a permissions boundary sets the maximum permissions but does not grant permissions, and you still need to attach policies that grant only necessary actions.

It is not the best practice for scoping down.

105
MCQmedium

A company uses AWS Organizations with multiple accounts. The security team wants to ensure that all IAM users in the production account must use multi-factor authentication (MFA) to access the AWS Management Console. Which combination of actions should the security team take to enforce this requirement?

A.Use an SCP to deny access to the AWS Management Console unless MFA is present. Attach the SCP to the production OU.
B.Disable password-based access for all IAM users and require federation with an identity provider that enforces MFA.
C.Enable MFA on the root user and apply a password policy that requires MFA.
D.Create an IAM policy that denies all console actions unless MFA is present. Attach the policy to the IAM group that contains all production users.
AnswerD

After an IAM user signs in to the console with only a password, the resulting temporary credentials have aws:MultiFactorAuthPresent set to false. An explicit deny policy using that condition key will block every console action, forcing the user to either re-authenticate with MFA or call STS GetSessionToken with MFA to obtain valid credentials. This effectively enforces MFA for all console access and directly satisfies the stated requirement for production users.

Why this answer

An IAM policy with a condition that denies all console actions unless MFA is present can be attached to an IAM group containing all production users. This enforces MFA at the user level within the account, directly meeting the requirement to ensure all IAM users in the production account must use MFA to access the AWS Management Console.

Exam trap

The trap here is that candidates often confuse SCPs with IAM policies, thinking SCPs can enforce MFA for console access within an account, but SCPs apply at the organizational level and cannot target specific IAM users or groups within an account.

How to eliminate wrong answers

Option A is wrong because SCPs cannot deny access to the AWS Management Console specifically; they deny actions on AWS resources, and the condition for MFA in an SCP would apply to all accounts in the OU, not just the production account's IAM users. Option B is wrong because disabling password-based access and requiring federation with an identity provider that enforces MFA is a valid approach but not listed as a combination of actions that the security team can take directly within the production account; it requires external setup and does not enforce MFA for existing IAM users. Option C is wrong because enabling MFA on the root user and applying a password policy that requires MFA does not enforce MFA for all IAM users; the root user MFA is separate, and password policies cannot enforce MFA for console access.

106
MCQmedium

A security engineer is reviewing an AWS account and notices that multiple IAM users have full administrative access. The company policy requires that users have only the permissions necessary to perform their job. What is the MOST secure and efficient way to enforce this policy?

A.Create an IAM policy that denies all actions except those specifically allowed, and attach it to each user.
B.Use an IAM group for each job function, attach appropriate managed policies to the group, and add users to the group.
C.Use an SCP in AWS Organizations to deny all actions by default.
D.Assign an inline policy to each user that specifies allowed actions.
AnswerB

IAM groups are the recommended way to organize permissions by job function: you attach a managed policy (AWS-managed or customer-managed) to the group, and any user added to the group automatically receives those permissions. This separates identity management from permission management, so updating a group policy affects all members consistently, and you can onboard/offboard users simply by adding or removing them from the group. Groups also help you adhere to least privilege without duplicating policy content across individual users.

Why this answer

Using IAM groups mapped to job functions and attaching managed policies to those groups is the most secure and efficient approach. It enforces least privilege by granting only the permissions each role needs, and it centralizes administration so permissions are managed in one place rather than per user. This aligns with AWS best practices for identity management.

Exam trap

SCS-C02 often tests the misconception that SCPs grant permissions or that per-user inline policies are equivalent to group-based managed policies — candidates must recognize that SCPs are guardrails and that groups are the efficient least-privilege mechanism.

How to eliminate wrong answers

Option A is wrong because creating a deny-all-except-allow policy and attaching it to each user is operationally inefficient and error-prone; AWS evaluates explicit denies first, and maintaining per-user policies scales poorly. Option C is wrong because SCPs apply at the AWS Organizations level and set permission guardrails, but they do not grant permissions — an SCP alone cannot enforce least privilege for individual users. Option D is wrong because inline policies attached directly to each user are harder to audit and manage than group-based managed policies, increasing the risk of permission drift.

107
MCQhard

Refer to the exhibit. A security engineer runs the IAM Policy Simulator with the provided policy input. The result shows 'explicitDeny' for ec2:RunInstances even though the policy only contains an Allow. What is the most likely reason?

A.The user has an attached policy or SCP that explicitly denies ec2:RunInstances.
B.The policy input has a syntax error.
C.The simulate-custom-policy command does not support ec2:RunInstances.
D.The resource ARN is incorrect for ec2:RunInstances.
AnswerA

An explicit Deny in any attached identity policy, permissions boundary or AWS Organizations SCP always overrides Allow, producing explicitDeny in the simulator. The Allow in the supplied policy cannot take effect while that deny remains in force.

Why this answer

The IAM Policy Simulator evaluates the effective permissions by combining all applicable policies — identity-based policies, resource-based policies, permissions boundaries, SCPs, and session policies. An 'explicitDeny' result means some policy in the evaluation chain contains an explicit Deny statement for ec2:RunInstances, which always overrides any Allow. Since the input policy only has an Allow, the deny must originate from an attached policy or an SCP in the account hierarchy.

Exam trap

SCS-C02 often tests the misconception that the simulator only evaluates the policy you paste in — candidates forget that explicit Deny from SCPs, permissions boundaries, or other attached policies takes precedence and produces the explicitDeny result.

How to eliminate wrong answers

Option B is wrong because a syntax error in the policy would produce a malformed-policy or validation error, not a clean 'explicitDeny' evaluation result — the simulator would reject the policy before evaluating it. Option C is wrong because the IAM Policy Simulator supports all IAM actions including ec2:RunInstances; there is no per-action restriction on the simulation engine. Option D is wrong because an incorrect resource ARN would cause the Allow statement to not match, resulting in an implicit deny (not an explicitDeny), and the simulator would report 'implicitDeny' or 'allowed: false' rather than the explicitDeny classification.

108
MCQeasy

A developer needs to access AWS resources from a mobile app. Which AWS service allows the app to obtain temporary credentials for authenticated users?

A.Amazon Cognito user pools
B.AWS IAM Identity Center (AWS SSO)
C.Amazon Cognito identity pools (federated identities)
D.AWS Key Management Service (AWS KMS)
AnswerC

Amazon Cognito identity pools (federated identities) are the correct choice because they are specifically built to trade identity tokens—from Cognito user pools, social IdPs, or custom OIDC providers—for temporary AWS credentials. Internally, this uses AWS Security Token Service (STS) actions like AssumeRoleWithWebIdentity, and the resulting credentials are automatically refreshed by the AWS mobile SDKs. They also support unauthenticated guest access when guest users need limited access. This maps the authenticated/unauth user to an IAM role with fine-grained permissions to AWS resources.

Why this answer

Amazon Cognito identity pools (federated identities) are specifically designed to provide temporary, scoped AWS credentials to authenticated and unauthenticated users. The identity pool exchanges a token from an identity provider (such as a Cognito user pool, social provider, or SAML) for temporary AWS credentials via AWS Security Token Service (STS). This allows mobile apps to directly access AWS services like S3 or DynamoDB without embedding long-term credentials.

Exam trap

SCS-C02 often tests the distinction between Cognito user pools (authentication) and identity pools (authorization for AWS credentials), causing candidates to confuse the two and select user pools when temporary AWS credentials are required.

How to eliminate wrong answers

Option A is wrong because Amazon Cognito user pools are directories for user sign-up and sign-in, and they issue JSON Web Tokens (JWTs) for authentication, but they do not directly provide temporary AWS credentials for accessing AWS services. Option B is wrong because AWS IAM Identity Center (AWS SSO) is designed for workforce identity and access management across multiple AWS accounts and business applications, not for providing temporary credentials to end-users of a mobile app. Option D is wrong because AWS Key Management Service (KMS) is a service for creating and managing encryption keys, not for issuing temporary credentials to users or applications.

109
MCQmedium

An IAM user has the policy shown in the exhibit. The user tries to launch an m5.large instance in us-east-1, but gets an 'AccessDenied' error. Why does this happen?

A.The policy restricts RunInstances to instance type t2.micro, but the user requested m5.large.
B.The condition uses StringEquals, which is case-sensitive and the instance type is in the wrong case.
C.The policy does not allow the RunInstances action at all.
D.The resource ARN in the policy is incorrect for launching instances.
AnswerA

The policy grants RunInstances only when the ec2:InstanceType condition key exactly equals t2.micro, so a request for m5.large does not satisfy the condition and is implicitly denied. IAM evaluation requires an explicit Allow to match all parts of the request—action, resource, and condition—and because the condition fails here, the request falls through to the default deny, producing AccessDenied. This is the correct explanation because the user did have permission to launch instances, but only for the specific instance type t2.micro, not m5.large.

Why this answer

The IAM policy's RunInstances statement includes a condition that restricts the allowed instance type (likely ec2:InstanceType StringEquals t2.micro). Because the user requested m5.large, the condition evaluates false and the Allow does not apply, resulting in an implicit deny and AccessDenied.

Exam trap

SCS-C02 often tests the misconception that AccessDenied always means the action is missing — candidates overlook that a condition inside an Allow statement can silently block the request, producing the same error as an explicit deny.

How to eliminate wrong answers

Option B is wrong because StringEquals is indeed case-sensitive, but the instance type 'm5.large' is already in the correct lowercase format — case is not the issue here. Option C is wrong because the policy does allow RunInstances; the deny is caused by the condition, not by the absence of the action. Option D is wrong because the resource ARN for RunInstances (typically '*' or an instance ARN) is not the cause — the failure is driven by the instance-type condition, not the resource element.

110
MCQhard

A security engineer notices that an IAM role has a trust policy that allows 'sts:AssumeRole' from any AWS account. What is the security risk?

A.The role can be assumed by any AWS service.
B.The role's permissions are exposed to all AWS accounts.
C.Any IAM user in any AWS account can assume the role and gain its permissions.
D.The role can be used to access resources in other accounts.
AnswerC

Because the trust policy allows 'sts:AssumeRole' from any principal (often expressed as 'Principal': '*'), any IAM user in any AWS account can call the STS API to assume this role. Upon successful assumption, AWS returns temporary credentials bound to the role's permission policy, so the user gains whatever access that policy grants. This is precisely the overly permissive condition that makes the role dangerous.

Why this answer

A trust policy with a Principal of "*" (or an account root without conditions) allows sts:AssumeRole from any AWS account, meaning any IAM principal in any account that knows the role ARN can call AssumeRole and obtain temporary credentials scoped to that role's permissions. This is a classic cross-account confused-deputy vulnerability: the role's identity-based policies determine what the assumer can do, so the blast radius is exactly the role's permissions. The risk is not that permissions are 'exposed' in a read sense, but that they can be actively exercised by untrusted external principals.

Exam trap

SCS-C02 often tests the misconception that a wildcard Principal in a trust policy grants service access or exposes permissions, when the actual risk is that any external IAM principal can assume the role and exercise its permissions.

How to eliminate wrong answers

Option A is wrong because a trust policy controls which principals may call sts:AssumeRole, not which AWS services can use the role — service principals must be explicitly listed (e.g., ec2.amazonaws.com) and a wildcard principal does not grant service-linked usage. Option B is wrong because permissions are not 'exposed' passively; IAM policies are not readable by other accounts, and the actual risk is unauthorized assumption and use of the role's permissions, not visibility of the policy. Option D is wrong because the role's ability to access resources in other accounts depends on the role's identity-based policies and those accounts' resource policies — the trust policy alone does not grant cross-account resource access, and the question asks about the risk of the trust policy itself.

111
MCQmedium

A company uses an IAM role to allow an EC2 instance to access an S3 bucket. The instance is launched in a VPC with a VPC endpoint for S3. The IAM role has a policy that grants s3:GetObject on the bucket. However, the application on the instance receives 'Access Denied' errors when trying to read objects. What is the MOST likely cause?

A.The VPC endpoint policy for S3 does not allow the required action.
B.The EC2 instance does not have an encryption key to decrypt the objects.
C.The S3 bucket policy does not explicitly allow the IAM role.
D.The IAM role is not attached to the EC2 instance profile.
AnswerA

A VPC endpoint policy is an additional authorization boundary for S3 traffic routed through the gateway endpoint. Even when the IAM role explicitly allows s3:GetObject and the bucket policy permits the request, the endpoint policy must also allow the action; if it only allows s3:ListBucket or omits the operation, the request is denied. S3 evaluates the endpoint policy alongside the IAM role's permissions, and any missing allow from this policy results in AccessDenied.

Why this answer

When an EC2 instance accesses S3 through a VPC endpoint (gateway endpoint), both the IAM role policy and the VPC endpoint policy must allow the action. The default endpoint policy allows all, but if a custom policy restricts actions or resources, s3:GetObject can be denied even though the IAM role grants it. This is the most likely cause of the Access Denied error.

Exam trap

The trap is assuming IAM role permissions are sufficient — candidates forget that VPC endpoint policies act as an additional permission boundary, and a restrictive endpoint policy can silently block access even when IAM grants it.

How to eliminate wrong answers

Option B is wrong because encryption key access is governed by KMS permissions, and the error would typically mention KMS or be a different error code; also the scenario does not mention SSE-KMS. Option C is wrong because an S3 bucket policy does not need to explicitly allow the IAM role if the bucket is owned by the same account and the IAM policy grants access — IAM policies alone suffice unless the bucket policy explicitly denies. Option D is wrong because if the role were not attached to the instance profile, the instance would have no credentials at all, producing a different error (Unable to locate credentials), not Access Denied.

112
Drag & Dropmedium

Drag and drop the steps to implement AWS KMS key rotation in the correct order.

Drag or tap steps into the slots.

Steps
Order
1Step 1
2Step 2
3Step 3
4Step 4

Why this order

Key rotation starts with creating a CMK, enabling auto-rotation, manual rotation if needed, updating apps, and verifying decryption.

113
MCQmedium

A company hosts a web application on EC2 instances behind an Application Load Balancer. The application accesses an S3 bucket to store user uploads. The security team needs to ensure that the EC2 instances can access the S3 bucket without storing AWS credentials on the instances. What should the security team do?

A.Create an IAM user with programmatic access and use those credentials in the application.
B.Configure a security group that allows outbound traffic to the S3 bucket.
C.Create an IAM role with an S3 access policy and attach it to the EC2 instance profile.
D.Store AWS access keys in a configuration file on the EC2 instances.
AnswerC

Attaching an IAM role with the appropriate S3 access policy to the EC2 instance profile enables the instance to obtain temporary credentials from AWS STS via the instance metadata service (IMDSv2). The AWS SDK automatically retrieves and rotates these credentials, meaning the application never stores or manages long-lived keys. This follows the principle of least privilege and is the AWS-recommended pattern for granting EC2 instances access to S3, because it ties permissions to the instance itself rather than to a user or stored key.

Why this answer

An IAM instance profile with an IAM role grants temporary credentials to EC2 instances. Option A is wrong because storing credentials on instances is insecure. Option B is wrong because it's not a best practice.

Option D is wrong because security groups do not grant access to S3.

114
MCQeasy

A company wants to allow an IAM user to manage only their own password in the AWS Management Console. Which IAM policy action should be used?

A.iam:ChangePassword
B.iam:ListUsers
C.iam:CreateAccessKey
D.iam:DeactivateMFADevice
AnswerA

iam:ChangePassword permits a user to change only their own console password, provided they supply the existing password. It grants no ability to modify other users' credentials, matching the requirement to manage solely their own password.

Why this answer

The correct IAM policy action to allow a user to manage only their own password is iam:ChangePassword. This action enables the user to change their password in the AWS Management Console. Option A is correct.

Option B (iam:ListUsers) is used to list IAM users, not relevant to password management. Option C (iam:CreateAccessKey) creates access keys, which is unrelated. Option D (iam:DeactivateMFADevice) deactivates MFA devices, also not relevant.

Therefore, only iam:ChangePassword is appropriate.

115
Multi-Selecteasy

A company wants to grant an IAM user the ability to manage (create and update) their own access keys. Which TWO IAM actions must be allowed in the policy?

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

Allowing `iam:UpdateAccessKey` lets the user activate or deactivate their own existing access keys, satisfying the "update" half of the manage requirement. It does not create keys, so it must be paired with `iam:CreateAccessKey`; together these two actions cover the full create-and-update scope the stem demands.

Why this answer

The scenario requires the IAM user to manage their own access keys, specifically to create and update them. Option B, iam:CreateAccessKey, is correct because it is the exact IAM action that permits a user to create a new access key for themselves. Option A, iam:UpdateAccessKey, is correct because it allows the user to change the status of an existing access key, such as activating or deactivating it, which falls under managing access keys.

Option C, iam:GetAccessKeyLastUsed, is not required because it only retrieves metadata about when an access key was last used, not manage it. Option D, iam:DeleteAccessKey, is not required because the scenario specifies create and update, not delete. Option E, iam:ListAccessKeys, is not required because it only lists access keys and does not grant management capabilities.

Exam trap

SCS-C02 often tests the distinction between read-only and write actions for IAM access keys, and candidates may mistakenly include DeleteAccessKey or ListAccessKeys when the question specifies 'create and update' only.

116
MCQeasy

A developer needs to grant an IAM user read-only access to an S3 bucket named 'my-bucket'. Which policy should be attached to the IAM user?

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

This policy exactly implements read-only object access by allowing the s3:GetObject action on the objects within the bucket. The resource ARN arn:aws:s3:::my-bucket/* correctly scopes the action to object keys under my-bucket, rather than the bucket itself or all buckets. This grants the user the ability to retrieve object data and metadata while denying writes, deletions, or bucket-level administrative changes.

Why this answer

Option D grants s3:GetObject, which allows the IAM user to read (download) objects from the bucket. Although full read-only access typically includes s3:ListBucket to list objects, the question asks for read access, and s3:GetObject is the essential read action. Option A only allows listing, not reading object data.

Option B grants full access, and option C grants write access. Thus, D is the best choice for read-only access.

Exam trap

The trap here is that candidates often confuse s3:ListBucket with read access, thinking listing objects is sufficient for reading, when in fact s3:GetObject is required to retrieve the actual object data.

How to eliminate wrong answers

Option A is wrong because it only grants s3:ListBucket on the bucket itself, which allows listing objects but not reading their contents; this is insufficient for read-only access. Option B is wrong because it grants s3:* on all resources, which is an administrative full-access policy that violates the principle of least privilege. Option C is wrong because it grants s3:PutObject, which is a write action that allows uploading objects, not read-only access.

117
Multi-Selectmedium

Which TWO are characteristics of an IAM role? (Choose 2.)

Select 2 answers
A.It can be used to grant permissions to an AWS service without requiring a user.
B.It does not have long-term access keys.
C.It cannot have an attached permissions policy.
D.It provides temporary security credentials.
E.It is associated with a specific IAM user.
AnswersB, D

An IAM role has no embedded long-term credentials such as static IAM user access keys. Instead, it contains a trust policy and permission policies, and when an entity assumes the role, AWS STS issues temporary credentials — an access key ID, a secret access key, and a session token — that expire after a configurable duration between 15 minutes and 12 hours.

Why this answer

IAM roles do not have long-term access keys; they provide temporary security credentials when assumed. Option D is correct because roles provide temporary security credentials through AWS STS. Option A is incorrect because while a role can be used by an AWS service, it still requires an entity (user, service, or application) to assume it—a role is not 'without a user.' Option C is incorrect because roles can have attached permissions policies that define what actions are allowed.

Option E is incorrect because a role is not tied to a specific IAM user; it can be assumed by multiple users, services, or federated identities.

118
MCQeasy

A company wants to allow an IAM user to list objects in an S3 bucket named 'my-bucket'. Which IAM policy statement grants the minimum required permissions?

A.{"Effect":"Allow","Action":"s3:PutObject","Resource":"arn:aws:s3:::my-bucket/*"}
B.{"Effect":"Allow","Action":"s3:GetObject","Resource":"arn:aws:s3:::my-bucket/*"}
C.{"Effect":"Allow","Action":"s3:ListBucket","Resource":"arn:aws:s3:::my-bucket"}
D.{"Effect":"Allow","Action":"s3:*","Resource":"arn:aws:s3:::my-bucket"}
AnswerC

This is the correct minimal policy because s3:ListBucket is the exact permission required for the S3 ListObjects/ListObjectsV2 API calls used to list objects and prefixes. The resource is correctly set to the bucket ARN, which is where S3 checks the ListBucket authorization; object-level ARNs like arn:aws:s3:::my-bucket/* are not valid for this action. It is least-privilege because it grants only the ability to list, with no object-level read, write, or delete permissions and no bucket administrative rights.

Why this answer

The s3:ListBucket action is the specific permission required to list objects in an S3 bucket, and the resource ARN must be the bucket itself (arn:aws:s3:::my-bucket) without a trailing /*. This grants the minimum necessary permission to perform the ListObjects (or ListObjectsV2) API call, which returns the object keys in the bucket.

Exam trap

The trap here is that candidates often confuse s3:ListBucket with s3:GetObject or incorrectly use an object-level ARN (with /*) for listing permissions, failing to recognize that listing requires the bucket-level ARN and the specific ListBucket action.

How to eliminate wrong answers

Option A is wrong because s3:PutObject grants permission to upload objects, not to list them, and it uses a resource ARN with /* which applies to objects, not the bucket. Option B is wrong because s3:GetObject grants permission to read object content, not to list objects, and again uses an object-level ARN. Option D is wrong because s3:* grants all S3 actions (including delete, write, etc.), which violates the principle of least privilege by providing far more permissions than needed to list objects.

119
Multi-Selecthard

An organization wants to enforce that all IAM users must use MFA to access the AWS API. Which TWO steps should be taken?

Select 2 answers
A.Rotate all IAM user access keys.
B.Attach the policy to all IAM users or to a group that all users belong to.
C.Create an IAM policy with a condition that denies all actions unless aws:MultiFactorAuthPresent is true.
D.Configure the account password policy to require MFA.
E.Create a service control policy (SCP) that requires MFA for all API calls.
AnswersB, C

Attaching the MFA enforcement policy to every IAM user, or to a group that all users belong to, is the required deployment step: IAM policies have no effect until they are attached to an identity. Using a group is the most maintainable approach because new users added to the group automatically receive the policy, and it prevents individual users from being missed. This distribution is what makes the deny-unless-MFA condition universally enforced across the account.

Why this answer

Option B is correct because an IAM policy that enforces MFA must actually be attached to the principals it should affect — either directly to each IAM user or, more manageably, to a group that all users belong to, so the deny-unless-MFA condition is evaluated for their API calls. Option C is correct because the standard way to enforce MFA on API access is an IAM policy with a Deny effect on all actions ("*") guarded by a condition such as "aws:MultiFactorAuthPresent": "true" (typically combined with a BoolIfExists or Null check to handle cases where the key is absent), which blocks any request not made with MFA-authenticated credentials. Option A is not required: rotating access keys improves key hygiene but does not enforce MFA on API calls.

Option D is wrong because the account password policy controls password complexity, length, and rotation for console sign-in, not MFA requirements for API access. Option E is wrong because SCPs only apply to accounts within AWS Organizations and cannot require MFA for individual IAM users' API calls; MFA enforcement for users is done with IAM policies.

Exam trap

SCS-C02 often tests the misconception that SCPs or password policies can enforce MFA for IAM users, when in fact only IAM policies with the aws:MultiFactorAuthPresent condition key (attached to users/groups) achieve API-level MFA enforcement.

120
MCQmedium

A security engineer notices that an IAM role allows 'iam:PassRole' to an EC2 instance. What security risk does this present?

A.The instance can launch new resources with a more privileged role.
B.The instance can modify IAM policies.
C.The instance can stop CloudTrail logging.
D.The instance can decrypt data encrypted with KMS keys.
AnswerA

The ability to pass a role (iam:PassRole) combined with permission to launch EC2 instances (ec2:RunInstances) lets the instance specify a different, more privileged IAM instance profile at launch. Because the PassRole permission is often granted broadly without restricting which roles can be passed, the current instance can create a new instance carrying permissions beyond its own, thereby escalating privileges within the account.

Why this answer

The 'iam:PassRole' permission allows an entity to pass an IAM role to an AWS service, such as EC2. If an EC2 instance has this permission, it can launch new resources (like another EC2 instance or a Lambda function) and associate a more privileged role with that resource. This is a privilege escalation risk because the instance could effectively gain the permissions of the passed role.

Exam trap

The trap is thinking that 'iam:PassRole' directly allows modifying IAM policies or other actions, when it specifically enables passing roles to services, leading to potential privilege escalation if not properly restricted.

How to eliminate wrong answers

Option B is wrong because 'iam:PassRole' does not grant permission to modify IAM policies; that would require actions like 'iam:CreatePolicy' or 'iam:PutRolePolicy'. Option C is wrong because stopping CloudTrail logging requires permissions like 'cloudtrail:StopLogging', which are not granted by 'iam:PassRole'. Option D is wrong because decrypting data with KMS keys requires 'kms:Decrypt' permissions, not 'iam:PassRole'.

121
MCQeasy

An AWS Lambda function needs to read from a DynamoDB table. What is the best practice for granting the Lambda function the necessary permissions?

A.Use a resource-based policy on the DynamoDB table to allow the Lambda function.
B.Create an IAM user with the necessary permissions and assign it to the Lambda function.
C.Create an IAM role with the necessary permissions and attach it as the Lambda function's execution role.
D.Embed the IAM user's access key and secret key in the Lambda function code.
AnswerC

Attaching an IAM role as the Lambda function's execution role is the recommended pattern. In the role's trust policy you allow the Lambda service principal, lambda.amazonaws.com, to assume the role; the role's permissions policy then grants the minimal DynamoDB actions needed, such as GetItem or Query. Lambda automatically calls sts:AssumeRole and obtains short-term credentials, so no long-lived keys are ever stored in the function.

Why this answer

The best practice for granting a Lambda function permissions to DynamoDB is to create an IAM role with the necessary permissions and attach it as the function's execution role. Lambda assumes this role at runtime, and the AWS SDK automatically uses temporary credentials from the role, eliminating the need to manage long-term keys. This follows the principle of least privilege and avoids embedding secrets.

Exam trap

SCS-C02 often tests the misconception that Lambda can use IAM user credentials or resource-based policies for same-account access, when the correct and secure practice is an IAM execution role.

How to eliminate wrong answers

Option A is wrong because DynamoDB resource-based policies are used for cross-account access or specific resource permissions, but they are not the standard mechanism for granting a Lambda function in the same account access; the execution role is the correct approach. Option B is wrong because Lambda functions cannot be assigned an IAM user; they assume an IAM role, and creating an IAM user with long-term credentials is an anti-pattern. Option D is wrong because embedding access keys in code is a severe security risk, violates best practices, and keys can be leaked or rotated improperly.

122
MCQmedium

A security engineer needs to grant an IAM user in Account A (111111111111) access to an S3 bucket in Account B (222222222222). The bucket policy in Account B allows cross-account access from Account A. Which additional step is required?

A.Attach an IAM policy to the IAM user in Account A granting s3:GetObject on the bucket.
B.Create a cross-account role in Account B and have the user assume it.
C.Attach the bucket policy to the IAM user in Account A.
D.Create an S3 access point in Account B and grant the IAM user access.
AnswerA

For cross-account access, S3 requires an explicit allow from both the resource-based policy (the bucket policy in Account B, which is already in place) and an identity-based policy on the IAM user in Account A. The IAM user's permissions are evaluated separately, and even though the bucket policy grants the Account A root access, the user does not inherit that permission without an explicit identity-based allow. Attaching a policy that grants s3:GetObject on the specific bucket is the necessary, minimal step to complete the authorization chain.

Why this answer

For cross-account access to an S3 bucket, both the bucket policy in Account B and an IAM policy in Account A are required. The bucket policy grants access to the Account A user, but the user also needs an IAM policy in their own account allowing the s3:GetObject action on that bucket. This is because IAM policies in the user's account must permit the action, and the bucket policy must also allow it.

Exam trap

SCS-C02 often tests cross-account access, and candidates may forget that both the bucket policy and the IAM policy are required, thinking that the bucket policy alone is sufficient.

How to eliminate wrong answers

Option B is wrong because creating a cross-account role is an alternative approach, but the question states the bucket policy already allows access, so the additional step is an IAM policy, not a role. Option C is wrong because bucket policies are attached to buckets, not IAM users. Option D is wrong because S3 access points are a different feature and not required for basic cross-account access.

123
MCQhard

A security engineer needs to grant a third-party vendor temporary access to an S3 bucket in the company's AWS account. The vendor has its own AWS account and will use its own IAM users. The engineer wants to avoid creating IAM users in the company's account and wants to audit all access. Which solution meets these requirements?

A.Create an IAM role in the company account with a trust policy that allows the vendor's AWS account to assume it, and attach a policy granting access to the S3 bucket.
B.Use AWS Resource Access Manager (RAM) to share the S3 bucket with the vendor's account.
C.Enable S3 public access and provide the vendor with the bucket URL and an access key.
D.Create an IAM user in the company account for each vendor employee and share the credentials securely.
AnswerA

This is the standard cross-account access pattern. The role's trust policy specifies the vendor's account as the principal, allowing its IAM users to assume the role via STS. The permissions policy grants S3 access. No IAM users are created in the company account, and all access is audited through CloudTrail, which logs AssumeRole and S3 API calls. This meets all requirements.

Why this answer

Cross-account access is best achieved by creating an IAM role in the trusting account that the trusted account can assume. The trust policy names the vendor's account, and the permissions policy grants S3 access. This avoids creating IAM users in the company account and ensures all actions are logged in CloudTrail.

Other options either violate security best practices or use unsupported features.

Exam trap

The trap here is assuming that AWS RAM can share S3 buckets, when it cannot, or that creating IAM users is acceptable despite the explicit requirement to avoid them.

124
MCQhard

An IAM policy has the following statement: {"Effect":"Allow","Action":"s3:*","Resource":"arn:aws:s3:::my-bucket/*"}. A user with this policy tries to perform s3:ListBucket on 'my-bucket'. Will the request succeed?

A.No, because there is an explicit deny elsewhere.
B.Yes, because s3:* allows all actions.
C.No, because the resource ARN does not include the bucket itself.
D.Yes, because the user has permission to access objects.
AnswerC

s3:ListBucket is a bucket-level action, so IAM evaluates the Resource against the bucket's ARN (arn:aws:s3:::bucket), not the ARN of objects inside it. A resource pattern that includes only the wildcard for object keys (e.g., arn:aws:s3:::bucket/*) does not match the bucket ARN, because the bucket itself is a distinct resource. Consequently, the allow statement does not cover this request, and the user cannot list the bucket.

Why this answer

The statement grants s3:* on arn:aws:s3:::my-bucket/*, which matches only objects inside the bucket, not the bucket itself. s3:ListBucket is a bucket-level operation that requires the resource arn:aws:s3:::my-bucket (without the /*). Since the policy does not grant access to that resource, the request is denied by default. This is a classic IAM resource-ARN mismatch.

Exam trap

SCS-C02 often tests the misconception that s3:* on a bucket/* ARN grants all S3 actions on the bucket, but bucket-level actions require the bucket ARN without the wildcard.

How to eliminate wrong answers

Option A is wrong because there is no explicit deny in the policy; the request fails due to lack of an Allow, not an explicit Deny. Option B is wrong because s3:* allows all S3 actions only on the resources specified; the resource ARN here is limited to objects, so bucket-level actions are not permitted. Option D is wrong because permission to access objects does not imply permission to list the bucket; ListBucket is a separate bucket-level action requiring its own resource ARN.

125
MCQmedium

A security engineer is troubleshooting an issue where an IAM user is unable to list objects in an S3 bucket even though the user has an IAM policy that allows s3:ListBucket. What is the MOST likely cause?

A.The user's IAM policy is not attached to the user.
B.The bucket is in a different AWS region.
C.The user needs to use MFA.
D.The bucket policy explicitly denies the action for that user.
AnswerD

In S3, an explicit deny in a bucket policy takes precedence over any allow from an identity-based IAM policy. When a bucket policy includes a Deny statement that matches the principal, action, and resource, the request is rejected regardless of the user's IAM permissions. This is the most direct and common cause of an Access Denied error when the user's IAM policy already grants the s3:ListBucket action.

Why this answer

In AWS, an explicit deny in a bucket policy overrides any allow in an IAM policy. Even if the IAM user has s3:ListBucket allowed, if the bucket policy explicitly denies that action for that user, the user will be unable to list objects. This is the most likely cause given the scenario.

Exam trap

The trap is assuming that an IAM allow is sufficient; candidates might overlook the possibility of an explicit deny in a bucket policy, which takes precedence.

How to eliminate wrong answers

Option A is wrong because if the IAM policy were not attached, the user would have no permissions at all, but the question states the user has an IAM policy that allows s3:ListBucket. Option B is wrong because S3 bucket names are globally unique and region is specified in the endpoint; a different region would cause a redirect but not an authorization failure. Option C is wrong because MFA is not required for s3:ListBucket by default; it could be enforced by policy, but that would be an explicit deny or condition, not the most likely cause without evidence.

126
MCQhard

Refer to the exhibit. This IAM policy is attached to a user. The user attempts to assume the AdminRole without using MFA. What is the result?

A.The user can assume the role because the Allow statement grants it
B.The user cannot assume the role because the Deny statement blocks all actions when MFA is not present
C.The user can assume the role because the Deny statement does not apply to sts:AssumeRole
D.The user cannot assume the role because the Allow statement requires MFA
AnswerB

The Deny statement applies to all actions, including sts:AssumeRole, because its Action element is the wildcard '*'. Its condition, typically 'aws:MultiFactorAuthPresent' being false, is true for a user who has not authenticated with MFA, so the explicit deny is in effect. Under IAM's evaluation logic, an explicit deny always blocks the request, regardless of any other matching Allow statements, so the role assumption fails.

Why this answer

The Deny statement explicitly denies all actions when MFA is not present, overriding the Allow statement. Since the user is not using MFA, sts:AssumeRole is denied. Option A is incorrect because the Deny overrides the Allow.

Option C is incorrect because the Deny applies to all actions, including sts:AssumeRole. Option D is incorrect because the Deny, not the Allow, imposes the MFA requirement.

127
MCQhard

An IAM user reports that they are unable to launch an EC2 instance in a specific VPC. The user has an IAM policy that allows ec2:RunInstances but does not grant permission for the subnet resource. The VPC has a network ACL that allows all inbound and outbound traffic. What is the most likely cause of the failure?

A.The IAM policy does not grant permission to use the VPC.
B.The security group associated with the instance is blocking the launch.
C.The IAM policy does not grant permission to use the subnet.
D.The network ACL is blocking the launch request.
AnswerC

Launching an instance with a resource-scoped IAM policy requires the ec2:RunInstances action to be granted on each dependent resource, including the subnet ARN (e.g., arn:aws:ec2:region:account-id:subnet/subnet-...). If the policy's Resource element omits the subnet but references the instance or AMI, the request fails with an explicit access denied because RunInstances is a 'create' action that conditionally requires subnet permission. This is the exact reason a user can have broad EC2 permissions yet still be blocked for a specific subnet.

Why this answer

ec2:RunInstances requires permissions on multiple resource types — the instance, the AMI, the subnet, the security group, the key pair, and the volume. If the IAM policy grants ec2:RunInstances on * for the instance resource but omits the subnet ARN (or uses a Resource that does not include the subnet), the request fails with an unauthorized error even though the VPC and NACL are permissive. The fix is to include the subnet ARN in the Resource element or use a wildcard that covers it.

Exam trap

SCS-C02 often tests the misconception that RunInstances only needs permission on the instance resource — candidates forget that the subnet, AMI, security group, and volume are also required resources in the IAM evaluation.

How to eliminate wrong answers

Option A is wrong because IAM does not have a separate 'use the VPC' permission for RunInstances — the relevant resource is the subnet, not the VPC itself. Option B is wrong because security groups are evaluated at the network layer after the instance is launched; they do not block the RunInstances API call itself. Option D is wrong because network ACLs operate at the subnet boundary for data-plane traffic and have no role in authorizing the control-plane RunInstances API call.

128
MCQhard

A security engineer notices that an IAM user has permissions to create new IAM users and attach policies. What is the most effective way to detect if this user created a backdoor user?

A.Review S3 access logs for any PutObject calls from the IAM user.
B.Use IAM Access Analyzer to review all IAM policies for potential backdoor access.
C.Configure an AWS Config rule to check for IAM users with administrative policies.
D.Enable AWS CloudTrail and monitor IAM events using Amazon CloudWatch Logs and create a metric filter for CreateUser and AttachUserPolicy events.
AnswerD

AWS CloudTrail records every IAM control-plane API call, including CreateUser and AttachUserPolicy, as management events with the user identity, source IP, and timestamps. By delivering the trail to Amazon CloudWatch Logs and creating a metric filter that matches on the eventName field for these API calls, you can trigger an Amazon CloudWatch alarm to alert a security engineer in near real-time. This gives you both a complete audit trail and an automated detection mechanism, making it the appropriate detective control for this scenario.

Why this answer

The most effective way to detect if a user created a backdoor IAM user is to enable AWS CloudTrail and monitor IAM events such as CreateUser and AttachUserPolicy using CloudWatch Logs metric filters and alarms. CloudTrail records all API activity, including IAM changes, and CloudWatch can alert on specific event names in near real-time. This provides direct detection of the exact actions that would indicate backdoor user creation.

Exam trap

SCS-C02 often tests the difference between detection tools — candidates confuse Access Analyzer (policy analysis) with CloudTrail (activity logging) and pick the wrong service for detecting user creation events.

How to eliminate wrong answers

Option A is wrong because S3 access logs only record S3 data-plane operations like PutObject and have no visibility into IAM user creation or policy attachment. Option B is wrong because IAM Access Analyzer analyzes resource policies and permissions for external access, but it does not detect the creation of new IAM users or the act of attaching policies — it is a static analysis tool, not an activity monitor. Option C is wrong because an AWS Config rule checking for IAM users with administrative policies detects a configuration state, not the real-time event of a user being created, and it would not identify who created it or when.

129
Multi-Selecteasy

Which TWO are valid IAM identity-based policies? (Choose 2.)

Select 2 answers
A.Trust policy
B.Inline policy
C.S3 bucket policy
D.Service control policy (SCP)
E.AWS managed policy
AnswersB, E

Inline policies are identity-based policies that are embedded directly into a single IAM user, group, or role. They are maintained as part of the entity itself, rather than as standalone managed policies, which ensures a strict one-to-one relationship between the policy and the identity. This direct attachment qualifies inline policies as a valid type of identity-based policy in IAM. They are particularly useful when you need to guarantee that a specific policy cannot be accidentally attached to another entity.

Why this answer

An inline policy (B) is a valid IAM identity-based policy because it is an embedded JSON policy document attached directly to a single IAM user, group, or role, granting or denying that identity's permissions. An AWS managed policy (E) is also a valid identity-based policy since it is a standalone, AWS-authored policy that can be attached to IAM users, groups, or roles as their permissions policy. By contrast, a trust policy (A) is a resource-based policy on an IAM role that defines which principals may assume it via sts:AssumeRole, not an identity-based permissions policy.

An S3 bucket policy (C) is a resource-based policy attached to the bucket, and a service control policy (D) is an AWS Organizations guardrail that sets maximum permissions for accounts, not an identity-based policy attached to an IAM identity.

Exam trap

SCS-C02 often tests the confusion between identity-based and resource-based policies, so candidates incorrectly select trust policies or S3 bucket policies as identity-based because they all use similar JSON syntax.

130
MCQhard

A security engineer is troubleshooting an issue where an IAM policy allows access to S3 but the user is denied access to a specific bucket. The policy has the following statement: { "Effect": "Allow", "Action": "s3:*", "Resource": "*" } What is the most likely cause of the denial?

A.The policy statement is too broad and AWS automatically denies access to specific buckets.
B.An explicit deny statement in a different policy (e.g., SCP, permissions boundary) is overriding the allow.
C.The S3 bucket has a bucket policy that denies access to the user.
D.The policy is attached to the user but the user is assuming a role that does not have S3 permissions.
AnswerB

An explicit deny in any applicable policy, such as a service control policy (SCP) attached to an organizational unit or a permissions boundary on the IAM principal, overrides any allow in the user's own IAM policy. During policy evaluation, AWS determines the final decision by first considering all applicable policies and applying the rule that an explicit deny takes precedence over any allow. Even if the user's policy grants s3:GetObject, the explicit deny in the SCP or boundary will cause the request to fail with an access denied error. To resolve this, the security engineer must identify and modify the deny statement or remove the restricting boundary.

Why this answer

AWS evaluates all applicable policies using a union-of-allows model, but any explicit Deny anywhere in the evaluation chain (identity policy, resource policy, SCP, permissions boundary, session policy) wins over every Allow. A broad Allow like s3:* on * does not get 'narrowed' by AWS — it is simply overridden when an explicit Deny matches the same action/resource. The most likely cause is therefore an explicit Deny in an SCP, permissions boundary, or similar policy that targets the specific bucket.

Exam trap

SCS-C02 often tests the misconception that a broad Allow policy 'wins' or that AWS auto-narrows permissions — candidates forget that explicit Deny always overrides Allow in the IAM evaluation chain.

How to eliminate wrong answers

Option A is wrong because AWS never automatically denies access to specific buckets just because a policy is broad — Allow statements are additive and only explicit Deny overrides them. Option C is wrong because while a bucket policy can deny access, the question asks for the most likely cause given the scenario of a policy that 'allows access to S3 but the user is denied' — an explicit Deny in the identity/SCP/boundary chain is the canonical answer, and a bucket policy deny would be a resource-based explicit deny, which is a subset of the same principle but not the best fit for the described symptom. Option D is wrong because if the user assumed a role, the role's permissions would be evaluated instead of the user's policy — but the question states the policy is attached to the user and the user is denied, so the role-assumption scenario contradicts the premise.

131
Multi-Selecteasy

A developer wants to allow an IAM role to be assumed by an EC2 instance that is part of an Auto Scaling group. Which TWO AWS services or features are required? (Choose TWO.)

Select 2 answers
A.AWS Config
B.Instance profile
C.IAM role
D.AWS CloudFormation
E.AWS Single Sign-On (SSO)
AnswersB, C

An instance profile is the container that delivers an IAM role's temporary credentials to EC2 via the instance metadata service. Auto Scaling groups reference the profile in their launch template, so each launched instance automatically assumes the role.

Why this answer

Option B (Instance profile) is correct because an instance profile is the container that passes an IAM role's temporary credentials to an EC2 instance; without attaching an instance profile to the instance, the EC2 instance cannot assume the role. Option C (IAM role) is correct because the role defines the permissions and trust policy that the EC2 instance assumes to obtain temporary credentials via the instance metadata service (IMDS). AWS Config (A) is a compliance and configuration tracking service and is not required to assume a role.

AWS CloudFormation (D) is an infrastructure-as-code service that could optionally launch resources but is not required for role assumption. AWS Single Sign-On (E) is for human user federated access, not for EC2 instance role assumption.

Exam trap

The trap here is that candidates often confuse IAM roles with instance profiles, thinking a role can be directly attached to an EC2 instance, but the instance profile is the required intermediary container that enables the role to be assumed by the instance.

132
MCQhard

A company has a policy that requires all IAM users to use multi-factor authentication (MFA) to access the AWS Management Console. A user reports that they are unable to sign in even after configuring MFA. What is the most likely cause?

A.The IAM policy explicitly denies console access.
B.The user is using the root account instead of an IAM user.
C.The MFA token has expired.
D.The MFA device is not properly synchronized with AWS.
AnswerD

The most common cause of consistently rejected MFA codes is clock drift between the authenticator device and AWS’s TOTP server, so the 30-second time window computed by the device does not match AWS’s window. AWS compares the presented code with codes for the current time step and an allowed clock skew; if the device’s time is off by more than the skew, even a freshly generated code will fail. To fix this, synchronize the device clock (or re-register the MFA device), which is why 'MFA device is not properly synchronized with AWS' correctly describes the failure.

Why this answer

The most likely cause is that the MFA device is not properly synchronized with AWS. When an IAM user configures MFA, the device must be synchronized with AWS to generate valid tokens. If synchronization fails, the token entered during sign-in will be rejected, preventing console access.

Option A is unlikely because if the policy explicitly denied console access, the user would not be able to sign in at all regardless of MFA, but the user specifically reported having configured MFA and still fails. Option B is incorrect because the root account does not require MFA for console access by default, and the user stated they are an IAM user. Option C is incorrect because MFA tokens do not expire; they are time-based and change every 30 seconds, but the token itself does not become permanently invalid after a period.

The issue is synchronization.

133
MCQeasy

A company's security policy requires that all IAM users must use strong passwords. Which IAM feature should be used to enforce this requirement?

A.AWS Organizations
B.AWS Key Management Service (AWS KMS)
C.AWS CloudTrail
D.IAM password policy
AnswerD

The IAM password policy is the account-level setting designed to enforce password requirements for all IAM users. It lets you require minimum length, uppercase/lowercase letters, numbers, non-alphanumeric characters, password expiration, and prevent password reuse, and users see the requirements during sign-in. Because this policy is applied natively by the IAM service during authentication and password changes, it exactly matches the security policy described.

Why this answer

The IAM password policy is the feature that enforces password requirements such as minimum length, complexity (uppercase, lowercase, numbers, symbols), reuse prevention, and expiration for IAM users. It is applied at the account level and directly addresses the requirement for strong passwords. Other services like AWS Organizations, KMS, and CloudTrail do not manage IAM user password rules.

Exam trap

SCS-C02 often tests the misconception that AWS Organizations or KMS can enforce IAM password rules — candidates must remember the IAM password policy is the specific feature for this requirement.

How to eliminate wrong answers

Option A is wrong because AWS Organizations manages multiple accounts, SCPs, and consolidated billing — it does not enforce IAM user password policies. Option B is wrong because KMS is a key management service for encryption, not password policy enforcement. Option C is wrong because CloudTrail logs API activity for auditing, not password enforcement.

134
MCQmedium

A company uses IAM roles for EC2 instances. An application running on an EC2 instance needs to read from an S3 bucket in another AWS account. What is the most secure way to grant access?

A.Create an IAM role in the target account with read access to the bucket, and allow the EC2 instance's role to assume it.
B.Store the other account's IAM user access keys in the EC2 instance.
C.Make the bucket public.
D.Create a bucket policy that allows access from the EC2 instance's public IP.
AnswerA

By creating an IAM role in the target account with read-only permissions to the S3 bucket, the application can use the EC2 instance's existing instance profile role to assume that role via STS AssumeRole. The target account role's trust policy must explicitly allow the EC2 instance role as a principal, and the instance role needs sts:AssumeRole permission. This yields temporary security credentials, avoids storing long-term keys, and adheres to least-privilege cross-account access.

Why this answer

The most secure cross-account access pattern is to create an IAM role in the target (bucket-owning) account with read access to the S3 bucket, and allow the EC2 instance's role in the source account to assume it via STS AssumeRole. This uses temporary credentials, avoids long-term keys, and follows least privilege without exposing the bucket publicly.

Exam trap

SCS-C02 often tests whether candidates choose temporary role-based credentials over long-term access keys or public access, tempting them with seemingly simple solutions (public bucket, IP allowlist) that violate least privilege and security best practices.

How to eliminate wrong answers

Option B is wrong because storing another account's IAM user access keys on an EC2 instance creates long-term credentials that can be exfiltrated, violates AWS best practices, and bypasses role-based temporary credential rotation. Option C is wrong because making the bucket public exposes data to the entire internet, violating confidentiality and least privilege, and is a common cause of data breaches. Option D is wrong because allowing access based on the EC2 instance's public IP is fragile (IPs change), insecure (IP spoofing, shared NAT), and does not authenticate the instance's identity — IAM roles are the correct identity mechanism.

135
Multi-Selectmedium

A security administrator is designing a cross-account access strategy. The administrator needs to allow users in Account A to assume an IAM role in Account B to access an S3 bucket. Which TWO of the following statements are true regarding this configuration?

Select 2 answers
A.The IAM users in Account A must have an IAM policy that allows the sts:AssumeRole action for the role ARN in Account B.
B.The trust policy for the role must be defined in Account A.
C.The S3 bucket policy must grant access to the IAM users in Account A.
D.The role in Account B must have a trust policy that allows the IAM users in Account A to assume the role.
E.The IAM users in Account A must have cross-account permissions on the S3 bucket in Account B.
AnswersA, D

The IAM users in Account A must have an identity-based policy that explicitly grants the sts:AssumeRole action against the role ARN in Account B. Without this allow, the AssumeRole API call is denied even if the trust policy in Account B permits the user, because IAM policies are evaluated by default-deny. The policy should specify the exact role ARN in the Resource element, for example arn:aws:iam::AccountB:role/CrossAccountRole.

Why this answer

For an IAM user in Account A to assume a role in Account B, the user must be explicitly granted permission to call the sts:AssumeRole API action against the role's Amazon Resource Name (ARN). This is done by attaching an IAM policy to the user (or a group/role the user belongs to) that includes the sts:AssumeRole action and specifies the target role ARN as the resource. Without this permission, the user cannot initiate the cross-account role assumption, even if the role's trust policy allows it.

Exam trap

The trap here is confusing where the trust policy is defined (it must be on the role in the target account, not in the source account) and assuming that direct IAM user permissions on the S3 bucket are required instead of using the assumed role's permissions.

136
MCQhard

A company uses cross-account IAM roles to allow a third-party vendor to access resources in the company's AWS account. The security team wants to ensure that the vendor can only access the specific S3 bucket named 'vendor-bucket'. What should the security team do?

A.Create an IAM user for the vendor and attach a policy that allows access to 'vendor-bucket'.
B.In the trust policy of the role, specify the vendor's AWS account and attach a permissions policy that allows s3:* on 'vendor-bucket'. Also create a bucket policy that allows the role.
C.Use an SCP to deny access to all S3 buckets except 'vendor-bucket'.
D.Create a new AWS account for the vendor and use VPC peering.
AnswerB

The trust policy in the role should list the vendor's AWS account as a principal, allowing that account's users or roles to call sts:AssumeRole. The role's permissions policy then grants only s3:* on 'vendor-bucket' (e.g., arn:aws:s3:::vendor-bucket and arn:aws:s3:::vendor-bucket/*), adhering to least privilege. A bucket policy that explicitly allows the role can be added to make the resource-based authorization unambiguous and to satisfy any governance requirement that the bucket owner also approve access.

Why this answer

The correct approach is to create a cross-account IAM role for the vendor. In the role's trust policy, specify the vendor's AWS account as the trusted entity. Attach a permissions policy to the role that grants access only to the specific S3 bucket 'vendor-bucket' (e.g., s3:GetObject, s3:PutObject).

Additionally, create a bucket policy on 'vendor-bucket' that allows the role to access the bucket. This ensures the vendor can only assume the role and access the designated bucket.

137
MCQmedium

Refer to the exhibit. An IAM policy allows s3:GetObject on an S3 bucket only when the object is encrypted with SSE-KMS. An IAM user with this policy attempts to download an object that is not encrypted. What will happen?

A.The download fails because the condition is not met, even though the action is allowed.
B.The download succeeds because the condition is not required.
C.The download fails because the policy is invalid.
D.The download succeeds because there is no explicit deny.
AnswerA

The request does not satisfy the condition placed on the Allow, so the policy engine cannot produce an effective Allow for this operation. AWS evaluates IAM condition blocks as part of determining whether a statement applies, and a false condition causes the statement to be skipped entirely. Consequently, the s3:GetObject action is denied by default even though the statement text appears to authorize the action.

Why this answer

The policy allows s3:GetObject only when the condition (SSE-KMS encryption) is met. Since the object is not encrypted with SSE-KMS, the condition fails, the allow does not apply, and the request is implicitly denied. Option B is incorrect because the condition is required for the allow to take effect.

Option C is incorrect because the policy is syntactically valid. Option D is incorrect because the absence of an explicit deny does not grant permission; the allow condition must still be satisfied.

138
Multi-Selectmedium

A security engineer is designing a CI/CD pipeline that deploys AWS infrastructure using AWS CloudFormation. The pipeline must assume an IAM role in each target account to create and update stacks. Which TWO steps are required to allow cross-account access for CloudFormation? (Choose TWO.)

Select 2 answers
A.Create a service role for CloudFormation in the pipeline account with a trust policy for the target account.
B.Store the target account root credentials in AWS Secrets Manager and retrieve them in the pipeline.
C.Configure the pipeline's IAM role with a trust policy that allows the target account to access it.
D.Use AWS STS AssumeRole in the pipeline to obtain temporary credentials for the target account role.
E.Create an IAM role in the target account with a trust policy allowing the pipeline account to assume it.
AnswersD, E

The pipeline must call the AWS Security Token Service (STS) AssumeRole API using the pipeline's existing IAM role or a dedicated deployment role, passing the ARN of the target-account role as the RoleArn parameter. STS then returns temporary, automatically expiring credentials (access key, secret key, and session token) that grant exactly the permissions defined in the target role's permissions policy. These temporary credentials can be passed to AWS SDK clients or exported as environment variables so that the deployment commands interact with the target account without human involvement or long-lived secrets.

Why this answer

Option E is correct because cross-account access requires a role in the target account whose trust policy explicitly allows the pipeline account (or its principal) to assume it via sts:AssumeRole. Option D is correct because the pipeline must call AWS STS AssumeRole to obtain temporary credentials for that target-account role before CloudFormation can create or update stacks there. Together, E establishes the destination role and D obtains the credentials to use it.

Option A is wrong because a service role in the pipeline account with a trust policy for the target account does not grant the pipeline permission to act in the target account. Option B is wrong because using root credentials is insecure and unnecessary when role assumption is available. Option C is wrong because configuring the pipeline role to trust the target account reverses the trust direction and does not let the pipeline assume a role in the target account.

Exam trap

SCS-C02 often tests the direction of trust policies in cross-account access, tricking candidates into placing the trust policy on the wrong account or using long-term credentials instead of STS AssumeRole.

139
MCQeasy

A company wants to allow an IAM user to list only the objects in a specific S3 bucket named 'my-bucket'. Which IAM policy statement should be used?

A.{"Effect":"Allow","Action":"s3:GetObject","Resource":"arn:aws:s3:::my-bucket/*"}
B.{"Effect":"Allow","Action":"s3:ListBucket","Resource":"arn:aws:s3:::my-bucket"}
C.{"Effect":"Allow","Action":"s3:ListBucket","Resource":"arn:aws:s3:::my-bucket/*","Condition":{"StringEquals":{"s3:prefix":""}}}
D.{"Effect":"Allow","Action":"s3:*","Resource":"arn:aws:s3:::my-bucket/*"}
AnswerB

This is the correct least-privilege policy because s3:ListBucket is the only permission needed to list the objects in a bucket, and it must be applied to the bucket ARN (arn:aws:s3:::my-bucket). Unlike object-level actions such as GetObject, ListBucket is evaluated against the bucket resource itself, so adding an object-path wildcard would make the ARN invalid. This statement grants exactly the ability to list keys and nothing else, such as reading or writing object contents.

Why this answer

The s3:ListBucket action operates on the bucket itself, so the Resource must be the bucket ARN without the /* wildcard: arn:aws:s3:::my-bucket. This grants permission to list objects in that specific bucket only. The /* suffix is used for object-level actions like s3:GetObject, not for ListBucket.

Exam trap

The trap is mixing up bucket-level and object-level ARNs — candidates often append /* to ListBucket or use GetObject when the requirement is to list objects, confusing 'listing' with 'reading'.

How to eliminate wrong answers

Option A is wrong because s3:GetObject is an object-level action that grants read access to object contents, not the ability to list objects, and its resource uses the /* wildcard. Option C is wrong because while it uses s3:ListBucket, the resource ARN includes /* (which is incorrect for bucket-level actions) and the condition with an empty s3:prefix is unnecessary and does not match the requirement. Option D is wrong because s3:* on the object ARN grants all object-level actions (including delete, put) but not ListBucket, and it is overly permissive.

140
MCQmedium

Refer to the exhibit. A KMS key policy allows decryption only when the request comes through S3 in us-east-1. An application in account 111122223333 tries to decrypt an S3 object using the KMS key directly via the KMS API (not through S3). What will happen?

A.The decryption succeeds because the principal is the root user.
B.The decryption fails because the policy is invalid.
C.The decryption succeeds because the principal is allowed.
D.The decryption fails because the condition on kms:ViaService is not satisfied.
AnswerD

The key policy's Allow for kms:Decrypt is explicitly conditioned on kms:ViaService matching the S3 service endpoint, for example s3.us-east-1.amazonaws.com. When the call is made directly to KMS or through any service other than S3, that condition key does not match. Since the condition is false, the Allow is not applied and KMS returns AccessDenied. The decryption therefore fails precisely because the request did not come via Amazon S3.

Why this answer

The KMS key policy includes a condition that restricts decryption to requests that come through S3 in us-east-1, using the kms:ViaService condition key. When the application calls the KMS Decrypt API directly (not through S3), the kms:ViaService condition is not satisfied, so the request is denied. This is the intended behavior of the policy.

Exam trap

SCS-C02 often tests the kms:ViaService condition and candidates may assume that having kms:Decrypt permission is enough, forgetting that the condition must be satisfied.

How to eliminate wrong answers

Option A is wrong because being the root user does not bypass explicit deny conditions in a key policy; the policy's condition still applies. Option B is wrong because the policy is valid — it correctly uses the kms:ViaService condition key, which is a supported feature. Option C is wrong because the principal being allowed is not sufficient; the condition on kms:ViaService must also be met, and it is not when calling KMS directly.

141
MCQmedium

Refer to the exhibit. An IAM policy is attached to a group. An IAM user in that group attempts to stop an EC2 instance from IP address 198.51.100.10. What will happen?

A.The action is allowed because the first statement allows StopInstances
B.The action is allowed because the resource is '*'
C.The action is denied because the source IP does not match the allowed range
D.The action is denied only if the user is not using MFA
AnswerC

The Deny statement blocks requests from IPs not in the allowed range.

Why this answer

The IAM policy includes a `Deny` statement with a `NotIpAddress` condition that restricts all actions (including `StopInstances`) to the IP range `10.0.0.0/8`. Since the user's source IP is `198.51.100.10`, which falls outside this range, the deny statement explicitly blocks the action. In IAM, an explicit deny always overrides any allow, so the request is denied regardless of the allow statement in the first policy block.

Exam trap

The trap here is that candidates assume the allow statement with `Effect: Allow` and `Action: ec2:StopInstances` will grant permission, forgetting that an explicit deny with a condition that does not match the request context takes precedence over any allow.

How to eliminate wrong answers

Option A is wrong because the explicit deny statement with the `NotIpAddress` condition overrides the allow statement; IAM evaluates deny before allow, and an explicit deny cannot be bypassed by a separate allow. Option B is wrong because while the resource is `*`, the deny statement applies to all resources and actions, and the condition key `aws:SourceIp` is evaluated against the source IP, not the resource ARN. Option D is wrong because the policy does not include any condition requiring MFA (`aws:MultiFactorAuthPresent`); the denial is based solely on the source IP mismatch.

142
MCQmedium

A company uses AWS IAM Identity Center (SSO) for managing access to multiple AWS accounts. A user reports that they can log in to the SSO portal but cannot see any AWS accounts in their dashboard. What is the most likely cause?

A.The user has not been assigned to any AWS accounts in IAM Identity Center.
B.The user's identity source (e.g., Active Directory) is not synchronized correctly.
C.The user's session token has expired.
D.The permission set assigned to the user does not grant any permissions.
AnswerA

This is correct because the user successfully authenticated to IAM Identity Center (the portal loaded and they can log in), but the portal only displays AWS accounts to which the user has been explicitly granted access. In IAM Identity Center, administrators must create an account assignment that pairs a principal (user or group) with a permission set for a specific AWS account. If no such assignment exists for this user, the login succeeds but the account list is empty, so the user sees no accounts to choose from.

Why this answer

In IAM Identity Center, users see AWS accounts in their portal only if they have been assigned to those accounts via account assignments (which link a user/group, a permission set, and an AWS account). If no account assignments exist, the user can authenticate successfully but will see an empty dashboard. This is the most common cause of the reported symptom.

Exam trap

SCS-C02 often tests the distinction between authentication (can I log in?) and authorization (what can I see/do?) — a successful login with an empty dashboard points to missing assignments, not auth failure.

How to eliminate wrong answers

Option B is wrong because identity source synchronization issues typically prevent login or cause missing user attributes, not a successful login with an empty account list. Option C is wrong because an expired session token would prevent portal access entirely, not just hide accounts. Option D is wrong because a permission set with no permissions would still show the account in the dashboard — the user would just get access-denied errors when trying to use it.

143
MCQmedium

A company uses AWS Organizations to manage multiple accounts. The security team wants to ensure that no IAM user in any account can create access keys. Which policy type should be used to enforce this restriction across all accounts?

A.IAM identity-based policy
B.Resource-based policy
C.Permissions boundary
D.Service Control Policy (SCP)
AnswerD

Service Control Policies (SCPs) are organization policies attached to the AWS Organizations root, an organizational unit, or an individual account, and they apply to every IAM principal—including the root user—within the affected accounts. An explicit Deny in an SCP overrides any Allow generated by identity-based, resource-based, or permissions-boundary policies, but an SCP itself never grants permissions. This makes SCP the correct choice for an account-wide, centrally managed restriction that cannot be bypassed by individual principals.

Why this answer

Service Control Policies (SCPs) in AWS Organizations define the maximum permissions for all IAM principals in member accounts. An SCP that denies the iam:CreateAccessKey action applied at the organization or OU level prevents any IAM user in any account from creating access keys, regardless of their identity-based policies. This is the correct mechanism for enforcing restrictions across all accounts.

Exam trap

SCS-C02 often tests the distinction between SCPs (organization-wide guardrails) and permissions boundaries (per-entity limits), so candidates who pick permissions boundaries miss the cross-account enforcement requirement.

How to eliminate wrong answers

Option A is wrong because IAM identity-based policies are attached to users, groups, or roles within a single account and cannot enforce a restriction across all accounts in an organization. Option B is wrong because resource-based policies are attached to resources (e.g., S3 buckets, KMS keys) and control who can access that resource — they cannot prevent the creation of access keys. Option C is wrong because a permissions boundary sets the maximum permissions for a single IAM entity (user or role) and must be attached per entity; it does not scale across an entire organization.

144
MCQmedium

Refer to the exhibit. A security engineer runs the 'simulate-custom-policy' command to test a policy. The output shows 'explicitDeny' for ec2:RunInstances. What is the most likely reason?

A.The policy does not include ec2:RunInstances in the Action list
B.The policy includes an explicit Deny statement for ec2:RunInstances
C.The policy allows ec2:Describe* but the action ec2:RunInstances is not a Describe action
D.The policy uses a Resource of '*' which does not include the required resources
AnswerB

An explicit Deny statement always overrides any Allow in IAM policy evaluation. The simulate-custom-policy output returning explicitDeny confirms a matching Deny statement exists for ec2:RunInstances, so the request is blocked regardless of any Allow statements present.

Why this answer

In AWS IAM policy evaluation, an explicit Deny statement always overrides any Allow. The simulate-custom-policy command returns 'explicitDeny' when the action is explicitly denied by a Deny statement in the policy. Therefore, the most likely reason is that the policy includes an explicit Deny for ec2:RunInstances.

Exam trap

SCS-C02 often tests the difference between implicit and explicit deny, and candidates may incorrectly attribute an explicit deny to a missing Allow statement rather than an actual Deny statement.

How to eliminate wrong answers

Option A is wrong because if the action is not included in any Allow statement, the result would be 'implicitDeny', not 'explicitDeny'. Option C is wrong because the absence of an Allow for ec2:RunInstances would also result in 'implicitDeny', not 'explicitDeny'. Option D is wrong because a Resource of '*' does not cause an explicit deny; it would allow the action if the Action is allowed, or result in implicit deny if not allowed.

145
MCQhard

A company has multiple AWS accounts and wants to allow a user in the production account to assume a role in the development account. The role in the development account has a trust policy that allows the production account to assume it. What additional configuration is required?

A.Attach a policy to the user in the production account allowing sts:AssumeRole for the development role ARN.
B.Modify the trust policy of the role in the development account to allow the user ARN instead of the account ARN.
C.Set up a VPC peering connection between the accounts.
D.Create a new IAM user in the development account with the same name.
AnswerA

This is correct because cross-account role assumption requires two halves: the role's trust policy in the development account must list the production account (or the user ARN) as a trusted principal, and the user in the production account must have an IAM identity policy that explicitly grants sts:AssumeRole against the development role's ARN. Without this identity-side permission, the user is not authorized to call AssumeRole even though the role trusts the account. Attaching the policy to the user therefore completes the authorization chain and allows the user to receive temporary credentials for the development role.

Why this answer

The user in the production account must have an IAM policy that allows sts:AssumeRole targeting the development account role ARN. Option B is wrong because the trust policy is already set. Option C is wrong because the role must be created in the development account.

Option D is wrong because the trust policy should reference the production account.

146
MCQmedium

A company has a requirement to grant cross-account access to an S3 bucket named 'shared-data' in Account A (111111111111) to users in Account B (222222222222). The security team has set up a bucket policy in Account A that grants read-only access to the IAM role 'DataReader' in Account B. The bucket policy is as follows: {"Version":"2012-10-17","Statement":[{"Effect":"Allow","Principal":{"AWS":"arn:aws:iam::222222222222:role/DataReader"},"Action":["s3:GetObject"],"Resource":"arn:aws:s3:::shared-data/*"}]}. A user in Account B assumes the 'DataReader' role, but when trying to read an object from the bucket, they receive an 'Access Denied' error. What is the MOST likely reason for this error?

A.The bucket policy principal must be the IAM user ARN, not the role ARN.
B.The bucket policy is missing the 's3:ListBucket' action, which is required to read objects.
C.The IAM role 'DataReader' does not have an IAM policy that allows s3:GetObject on the bucket.
D.The bucket objects are encrypted with a KMS key, and the role does not have permission to decrypt.
AnswerC

For cross-account S3 access, the IAM role must have an identity-based policy that explicitly allows s3:GetObject on the target bucket. Even if the bucket policy trusts the role, the role's own permissions are evaluated independently; without that allow, the request fails with Access Denied. This is the classic root cause of this scenario.

Why this answer

The most likely reason for the Access Denied error is that the IAM role 'DataReader' in Account B does not have an IAM policy that allows s3:GetObject on the bucket. For cross-account access, both the bucket policy in Account A and the IAM policy in Account B must grant the necessary permissions. The bucket policy alone is not sufficient; the role must also have an identity-based policy allowing the action.

Exam trap

SCS-C02 often tests the dual-permission requirement for cross-account access; candidates may assume the bucket policy alone is sufficient, forgetting the need for an identity-based policy in the trusted account.

How to eliminate wrong answers

Option A is wrong because the bucket policy can specify a role ARN as the principal; it does not have to be an IAM user ARN. Option B is wrong because s3:ListBucket is not required to read a specific object; it is only needed to list objects in the bucket. The error is Access Denied on GetObject, not on ListBucket.

Option D is wrong because while KMS encryption could cause Access Denied if the role lacks decrypt permissions, the question does not mention encryption, and the most common cause is missing IAM policy. Additionally, if the object were encrypted with KMS, the error would typically mention KMS access, but the question states the bucket policy grants read-only access, implying no encryption issue.

147
MCQmedium

Refer to the exhibit. An EC2 instance with an IAM role attached attempts to access an S3 bucket, but receives an 'AccessDenied' error. The role has an attached policy allowing s3:GetObject on the bucket. What is the most likely cause?

A.The S3 bucket policy denies access to the role.
B.The IAM policy is not attached to the role.
C.The trust policy does not allow the EC2 service to assume the role.
D.The EC2 instance does not have an instance profile associated with the role.
AnswerA

An explicit deny in the S3 bucket policy takes precedence over any allow granted by the IAM policy attached to the role. When the role attempts to access the bucket, S3 evaluates the bucket policy alongside the IAM policy; if it contains a Deny statement that applies to the role's ARN (or any principal that includes the role), the request fails with AccessDenied. This is the most direct cause here because the role and instance are otherwise correctly configured, isolating the issue to the resource policy.

Why this answer

When an IAM role has an identity-based policy allowing s3:GetObject but access is still denied, the most likely cause is an explicit Deny in the S3 bucket policy, because in AWS an explicit Deny anywhere in the evaluation chain overrides any Allow. The bucket policy is a resource-based policy evaluated alongside the identity-based policy, and a Deny there will block the role even though the IAM policy grants permission.

Exam trap

SCS-C02 often tests the policy evaluation order, and the trap is assuming the IAM identity policy is the only relevant policy — candidates forget that an explicit Deny in a resource-based policy (like an S3 bucket policy) overrides any Allow.

How to eliminate wrong answers

Option B is wrong because the question states the role has an attached policy allowing s3:GetObject — if the policy weren't attached, the role wouldn't have the permission at all, but the scenario explicitly says it does. Option C is wrong because if the trust policy didn't allow EC2 to assume the role, the instance wouldn't have credentials at all and would receive a credential/assume-role error, not an S3 AccessDenied. Option D is wrong because without an instance profile, the EC2 instance couldn't retrieve temporary credentials from the metadata service, again producing a credential error rather than an S3 authorization denial.

148
MCQeasy

A company wants to allow its users to assume an IAM role in a different AWS account. What must the company configure to enable cross-account access?

A.In the source account, create an S3 bucket policy that allows access from the target account.
B.In the target account, create an IAM role with a trust policy that allows the source account, and attach a permissions policy to that role. In the source account, allow users to call sts:AssumeRole.
C.In the target account, create an IAM user and share the access keys securely with the source account users.
D.In the target account, attach a trust policy to an IAM group that allows the source account.
AnswerB

Cross-account access requires two sides: the target account's role trust policy naming the source account as principal, plus a permissions policy granting the needed actions. The source account must additionally let its users call sts:AssumeRole, otherwise the role cannot be assumed.

Why this answer

Cross-account access requires creating an IAM role in the target account with a trust policy that specifies the source account as a trusted entity, and attaching a permissions policy that defines what actions the role can perform. The source account must then have a policy that allows its users to call sts:AssumeRole for that role. Option A is incorrect because S3 bucket policies are used for resource-based access, not for role assumption.

Option C is incorrect because sharing access keys violates security best practices and does not provide the controlled, temporary access that IAM roles offer. Option D is incorrect because trust policies are attached to roles, not IAM groups.

149
MCQhard

A developer is creating an AWS Lambda function that needs to read items from a DynamoDB table. The function is deployed in a VPC with no internet access. What is the MOST secure way to grant the Lambda function access to DynamoDB?

A.Attach a public IP to the Lambda function and use an IAM role with DynamoDB permissions.
B.Create an API Gateway REST API with a VPC link and DynamoDB integration.
C.Use a resource-based policy on the DynamoDB table allowing access from the Lambda function's ARN.
D.Create a VPC endpoint for DynamoDB and attach an IAM execution role to the Lambda function with the necessary permissions.
AnswerD

Creating a gateway VPC endpoint for DynamoDB gives the Lambda function's subnet a private route to the DynamoDB service, avoiding the public internet and any need for a NAT gateway. The Lambda execution role should carry an identity policy with the specific DynamoDB actions and resource (table ARN) so the function is both network-reachable and authorized to perform the operation. This combines the correct network path with the correct IAM authorization, and the endpoint works through a route-table prefix list rather than an ENI in the function's subnet.

Why this answer

A VPC endpoint for DynamoDB allows private connectivity from within a VPC to DynamoDB without requiring an internet gateway, NAT device, or VPN. Attaching an IAM execution role to the Lambda function with the necessary DynamoDB permissions grants the function the required access. This combination is the most secure because it keeps traffic within the AWS network and uses least privilege.

Exam trap

The trap is thinking that a resource-based policy on DynamoDB or an API Gateway integration is needed, when the correct solution is a VPC endpoint combined with an IAM execution role; candidates might also incorrectly assume that Lambda functions can have public IPs.

How to eliminate wrong answers

Option A is wrong because attaching a public IP to a Lambda function is not possible; Lambda functions in a VPC do not have public IPs, and even if they did, using the internet to access DynamoDB is less secure and requires a NAT gateway. Option B is wrong because creating an API Gateway REST API with a VPC link and DynamoDB integration adds unnecessary complexity and does not directly grant the Lambda function access; the Lambda function would still need permissions to call API Gateway, and the integration would need to be configured. Option C is wrong because a resource-based policy on the DynamoDB table allowing access from the Lambda function's ARN is not sufficient; the Lambda function also needs an IAM execution role with permissions to access DynamoDB, and resource-based policies on DynamoDB are not used for this purpose (DynamoDB supports resource-based policies for cross-account access, but the primary method is IAM roles).

150
MCQhard

A company has an S3 bucket with a bucket policy that grants access to an IAM role. The security team wants to restrict access to only requests that originate from the company's VPC. How can this be achieved?

A.Create a new IAM role that can only be assumed by instances in the VPC.
B.Add a condition in the IAM role policy using aws:SourceVpce.
C.Add a condition in the bucket policy using aws:SourceIp with the VPC CIDR range.
D.Add a condition in the bucket policy using aws:SourceVpce with the VPC endpoint ID.
AnswerD

Adding a bucket policy condition with the aws:SourceVpce key set to the specific VPC endpoint ID is the correct approach because this condition is automatically populated when a request reaches S3 through that exact endpoint. This ensures that only requests that travel via the designated VPC endpoint are allowed, effectively bounding access to instances in the associated VPC. It is a recommended, unambiguous way to enforce network-level restrictions on S3 resources and works in tandem with IAM policies that grant permissions.

Why this answer

To restrict S3 bucket access to requests originating from a VPC, you add a condition to the bucket policy using the aws:SourceVpce condition key with the VPC endpoint ID. This ensures that only requests traversing the specified VPC endpoint (and thus originating from within the VPC) are allowed, which is the standard, secure way to enforce VPC-origin access for S3.

Exam trap

The trap is confusing IAM policy condition keys with bucket policy condition keys — candidates often pick aws:SourceVpce in an IAM role policy, but the exam expects you to know it must be in the bucket policy to enforce VPC endpoint origin.

How to eliminate wrong answers

Option A is wrong because creating an IAM role assumable only by VPC instances does not restrict S3 access to VPC-originated requests — the role could still be used from outside the VPC if credentials leak, and it doesn't enforce network origin. Option B is wrong because aws:SourceVpce is a bucket-policy condition key, not an IAM role policy condition key; using it in an IAM role policy will not enforce VPC endpoint origin for S3 access. Option C is wrong because aws:SourceIp with the VPC CIDR range is unreliable — it can be spoofed or bypassed via NAT/proxy, and it doesn't guarantee the request came through the VPC endpoint; it also fails for private IP ranges that aren't routable on the public internet.

← PreviousPage 2 of 3 · 151 questions totalNext →

Ready to test yourself?

Try a timed practice session using only IAM questions.