ดูแล infrastructure ของ IAM service — รับผิดชอบ availability, global infrastructure, compliance validation และ protection ของ IAM service เอง
Your Responsibility (Security IN the Cloud)
สร้าง/จัดการ Users, Groups, Roles, Policies — enable MFA, monitor user activity, rotate keys, ลบ user ที่ไม่ใช้แล้ว และติดตามจาก CloudTrail
•AWS: infrastructure, IAM service availability, global compliance
•You: manage Users / Groups / Roles / Policies
•You: enable MFA บนทุก account
•You: assign permission ตาม Least Privilege
•You: monitor user activity (CloudTrail) และ review credentials ประจำ
•You: rotate access keys และตั้ง password policy
ทดสอบ
คำถามทบทวน
26 ข้อ — เลือกคำตอบเพื่อดูเฉลยและคำอธิบาย
ข้อ 1 / 10คะแนน 0
Following AWS best practices, how should the AWS account root user be managed?
Question 1 / 26
Following AWS best practices, how should the AWS account root user be managed?
A.Use the root user for all daily administrative work to keep things simple.
B.Enable MFA on the root user, lock away the credentials, and create separate IAM users for everyday tasks.✓ Correct
C.Share root user credentials with the team so everyone has full access when needed.
D.Delete the root user after creating an IAM user with AdministratorAccess.
Explanation
The root user has full, unrestricted access and cannot be deleted. AWS recommends enabling MFA on the root, securely storing the credentials, and creating IAM users (typically with appropriate group permissions) for everyday work. The root user should only be used for the few tasks that strictly require it (e.g., changing account settings, closing the account).
Question 2 / 26
Which statement about IAM Groups is correct?
A.Groups can contain other groups (nested groups).
B.An IAM user can belong to multiple groups, but groups cannot contain other groups.✓ Correct
C.Groups can contain both users and IAM roles.
D.A group must contain at least one user, otherwise it is automatically deleted.
Explanation
IAM Groups can only contain IAM users, not other groups (no nesting). A single user can be a member of multiple groups, and a group can also exist with no users. Groups cannot contain roles.
Question 3 / 26
An EC2 instance needs to read objects from an S3 bucket. What is the AWS-recommended way to grant this access?
A.Create an IAM user, generate an access key, and store it on the EC2 instance.
B.Use the AWS account root credentials in the application code.
C.Create an IAM role with the required S3 permissions and attach it to the EC2 instance.✓ Correct
D.Hard-code an access key and secret key into the application source code.
Explanation
IAM roles attached to EC2 instances provide temporary, automatically-rotated credentials via the instance metadata service. This is more secure than long-lived access keys and is the AWS-recommended pattern. Hard-coding keys or using root credentials are anti-patterns.
Question 4 / 26
What does the principle of "Least Privilege" mean in IAM?
A.Granting AdministratorAccess to all users for convenience.
B.Granting only the permissions required to perform a task — no more, no less.✓ Correct
C.Granting permissions only to the root user.
D.Granting no permissions to anyone by default.
Explanation
Least Privilege means giving an identity only the permissions it needs to perform its intended task. This limits the blast radius of compromised credentials and is a core IAM best practice.
Question 5 / 26
Which of the following are valid MFA device options supported by AWS IAM? (Select the most complete answer.)
A.Only hardware key fobs are supported; virtual MFA apps are not allowed.
B.MFA can only be enabled on the root user, not on IAM users.
C.Virtual MFA devices (Google Authenticator, Authy), U2F security keys (e.g., YubiKey), and hardware MFA devices (key fobs) are all supported.✓ Correct
D.MFA replaces the password — you no longer need to enter a password after enabling MFA.
Explanation
AWS supports virtual MFA devices (e.g., Google Authenticator, Authy), U2F security keys like YubiKey, and hardware key fobs. MFA is in addition to the password, not a replacement: it is something you have (device) plus something you know (password).
Question 6 / 26
Which statement best describes the difference between an IAM user and an IAM role?
A.Users and roles are identical and interchangeable.
B.An IAM user represents a specific person/service with long-term credentials, while an IAM role is assumed by trusted entities and provides temporary credentials.✓ Correct
C.Roles can only be used by AWS services, never by humans.
D.Users get temporary credentials, roles get permanent credentials.
Explanation
IAM users are identities tied to a person or application with long-term credentials (password and/or access keys). IAM roles are not tied to a specific identity; trusted entities (users, services, federated users) assume the role and receive temporary credentials via STS.
Question 7 / 26
In which region should you create IAM users, groups, and roles?
A.Only in the us-east-1 region.
B.In the region closest to your users.
C.IAM is a global service — IAM resources are not region-specific.✓ Correct
D.In every region you plan to use.
Explanation
IAM is a global service. Users, groups, roles, and policies are not tied to any region — they are available across all AWS regions in the account.
Question 8 / 26
Which IAM policy element specifies whether the statement allows or denies access?
A.Action
B.Resource
C.Effect✓ Correct
D.Principal
Explanation
The Effect element of a policy statement is either Allow or Deny. Action specifies what API operations are covered, Resource specifies what objects, and Principal (in resource-based policies) specifies who.
Question 9 / 26
What does an explicit Deny in an IAM policy do when there is also an explicit Allow for the same action?
A.The explicit Allow always overrides the Deny.
B.The explicit Deny always overrides any Allow — access is denied.✓ Correct
C.The most recent statement wins.
D.The two statements cancel out and a prompt is shown.
Explanation
IAM evaluation logic: by default everything is denied; an explicit Allow grants access; but an explicit Deny always overrides any Allow. This is why Deny statements are powerful for guardrails.
Question 10 / 26
An auditor needs a report showing the status of all IAM users in the account, including their MFA status, password age, and access key usage. Which IAM feature should be used?
A.IAM Access Advisor
B.IAM Credentials Report✓ Correct
C.AWS Config
D.AWS CloudTrail
Explanation
The IAM Credentials Report is an account-level CSV report listing every user and the status of their credentials (password, access keys, MFA, etc.). Access Advisor is per-user and shows which services they have actually used.
Question 11 / 26
Which IAM tool helps you identify unused permissions on an IAM user, group, or role so you can apply Least Privilege?
A.IAM Access Advisor✓ Correct
B.IAM Credentials Report
C.AWS Trusted Advisor
D.AWS Inspector
Explanation
IAM Access Advisor shows which AWS services an identity has been granted access to and when those services were last accessed. It is used to detect and remove permissions that are not actually being used.
Question 12 / 26
A company wants users to log in using their existing corporate Active Directory accounts instead of creating IAM users. Which IAM concept enables this?
A.IAM Groups
B.Identity federation with IAM roles✓ Correct
C.Resource-based policies
D.Service Control Policies
Explanation
Identity federation lets external identity providers (such as Active Directory via SAML 2.0, or social IdPs) sign in to AWS by assuming an IAM role. This avoids the need to create individual IAM users for each employee.
Question 13 / 26
Which two methods can an IAM user use to access AWS programmatically? (Select the most accurate answer.)
A.Email and SMS
B.Access Key ID + Secret Access Key (used by CLI/SDK), and the Console password (used in the browser)✓ Correct
C.Only the AWS Management Console password
D.Only access keys
Explanation
Console access uses a username and password (with optional MFA). Programmatic access (CLI, SDK, REST API) uses an Access Key ID and Secret Access Key. A user may have both, only one, or neither.
Question 14 / 26
Which of the following does an IAM password policy NOT allow you to configure?
A.Minimum password length
B.Required character types (uppercase, lowercase, numbers, symbols)
C.Password expiration period
D.Automatic deletion of users with weak passwords✓ Correct
Explanation
An IAM password policy controls password length, required character types, expiration, prevention of reuse, and whether users can change their own password. It does not delete users — only enforces password requirements.
Question 15 / 26
Under the AWS Shared Responsibility Model, who is responsible for managing IAM users, groups, roles, and policies inside an AWS account?
A.AWS — they fully manage IAM identities for customers.
B.The customer — IAM identity management is the customer's responsibility.✓ Correct
C.It is shared 50/50 between AWS and the customer.
D.An AWS Partner Network (APN) partner only.
Explanation
AWS is responsible for the security OF the IAM service itself (infrastructure, availability). The customer is responsible for security IN the cloud — creating and managing users/groups/roles/policies, enabling MFA, rotating keys, and assigning least-privilege permissions.
Question 16 / 26
What is the difference between an AWS managed policy and a customer managed policy?
A.AWS managed policies can be edited by the customer; customer managed policies cannot.
B.AWS managed policies are created and maintained by AWS; customer managed policies are created and maintained by the customer.✓ Correct
C.Customer managed policies cost extra, AWS managed policies are free.
D.There is no difference — both terms refer to the same thing.
Explanation
AWS managed policies (e.g., AdministratorAccess, ReadOnlyAccess) are created and maintained by AWS and cannot be modified by the customer. Customer managed policies are created by the customer, fully editable, and can be reused across multiple identities.
Question 17 / 26
Where are IAM access keys safely stored? (Choose the best practice.)
A.Embedded directly in application source code.
B.In a public Git repository for easy sharing.
C.Only displayed once at creation — store in a password manager or secrets manager and never share.✓ Correct
D.Emailed to all team members.
Explanation
An IAM access key (Access Key ID + Secret Access Key) is shown only once when created. The secret should be stored in a password manager or a secrets management service (e.g., AWS Secrets Manager) and never embedded in source code or shared publicly.
Question 18 / 26
Which of the following BEST describes an inline policy?
A.A policy embedded directly into a single user, group, or role and not reusable elsewhere.✓ Correct
B.A policy created and maintained by AWS.
C.A policy that automatically denies all access.
D.A policy attached to multiple identities for reuse.
Explanation
An inline policy is embedded directly into a single principal (user, group, or role). It has a strict 1:1 relationship with that principal and cannot be reused. Managed policies (AWS or customer) are reusable across many identities.
Question 19 / 26
Which CLF-C02 statement about IAM Roles is FALSE?
A.Roles use temporary security credentials issued by STS.
B.Roles can be assumed by AWS services, IAM users, or federated users.
C.Roles have permanent access keys that must be rotated regularly.✓ Correct
D.Roles enable cross-account access without sharing long-term credentials.
Explanation
Roles do NOT have permanent access keys. They issue temporary credentials (via AWS STS) when assumed. The other statements are true.
Question 20 / 26
A developer wants to grant a Lambda function permission to write to a DynamoDB table. What is the recommended approach?
A.Create an IAM user for the Lambda function and embed its access keys.
B.Attach an IAM execution role with DynamoDB write permissions to the Lambda function.✓ Correct
C.Use the AWS account root credentials in the function code.
D.Make the DynamoDB table public.
Explanation
Lambda functions use an execution role — an IAM role assumed by the Lambda service that grants only the permissions the function needs (e.g., dynamodb:PutItem). This avoids long-lived credentials and follows least privilege.
Question 21 / 26
Which of the following is NOT a valid IAM policy type?
A.Identity-based policy
B.Resource-based policy
C.Permissions boundary
D.Region-based policy✓ Correct
Explanation
Region-based policy is not a thing in IAM. Identity-based, resource-based, permissions boundaries, Service Control Policies (SCPs in AWS Organizations), session policies, and ACLs are all valid IAM policy types.
Question 22 / 26
An organization wants to set the maximum permissions that an IAM user can ever have, even if attached policies grant more. Which feature should they use?
A.Inline policy
B.Permissions boundary✓ Correct
C.Group policy
D.Trust policy
Explanation
A permissions boundary defines the maximum permissions an identity-based policy can grant to an IAM user or role. Even if the attached policies allow more, the effective permissions are intersected with the boundary.
Question 23 / 26
Which of the following is the recommended way to allow an application running outside of AWS (e.g., on-premises) to access AWS APIs?
A.Embed the AWS account root credentials in the application.
B.Create an IAM user with programmatic access and use access keys, or use IAM Roles Anywhere/identity federation for short-lived credentials.✓ Correct
C.Make all S3 buckets public.
D.Disable IAM entirely.
Explanation
For on-premises workloads you can either (a) create an IAM user with access keys (rotate them regularly) or (b) use IAM Roles Anywhere or identity federation to obtain temporary credentials — the latter is preferred. Never use root credentials.
Question 24 / 26
What happens if an IAM user has no policies attached at all?
A.They get full administrator access by default.
B.They get read-only access by default.
C.They have no permissions and cannot perform any AWS actions until a policy is attached.✓ Correct
D.They inherit the root user's permissions.
Explanation
IAM follows an implicit deny model. Without an explicit Allow from an attached policy (directly, via group, or via assumed role), the user has no permissions.
Question 25 / 26
Which statement about IAM access keys is TRUE?
A.An IAM user can have up to 5 active access keys at once.
B.An IAM user can have a maximum of 2 access keys, which helps with seamless rotation.✓ Correct
C.Access keys never expire and never need to be rotated.
D.Access keys can only be used in the AWS Management Console.
Explanation
An IAM user can have up to 2 access keys simultaneously. This allows rotation: create the new key, update applications, then deactivate and delete the old key — all without downtime. Access keys are used for CLI/SDK/API access, not the Console.
Question 26 / 26
What is the purpose of the Principal element in an IAM resource-based policy?
A.It specifies the AWS service being accessed.
B.It specifies who (which user, role, account, or service) is allowed or denied access to the resource.✓ Correct
C.It specifies the region the resource lives in.
D.It specifies the cost of the action.
Explanation
Principal in a resource-based policy specifies who the policy applies to — e.g., a specific AWS account, IAM user/role ARN, or AWS service principal. Identity-based policies do not use Principal because the principal is implied by who the policy is attached to.