IAM users, roles and policies: SOA-C03 study notes and practice questions
What to know about IAM users, roles and policies for the SOA-C03 exam, from the Security and Compliance domain (16% of the exam guide), then 2 free questions to test it. Part of the SOA-C03 study guide.
A logistics broker's operations engineers sign in as IAM users with AdministratorAccess.
After an accidental mass termination of EC2 instances, the security team requires that ec2:TerminateInstances and ec2:StopInstances succeed only when the caller signed in with MFA.
Engineers must keep all their other permissions, whether or not they used MFA.
Which policy change should a CloudOps engineer make for the engineers' group?
Choose one answer.
AA. Update the account password policy to require MFA for every IAM user who calls EC2 stop or terminate actions.
BB. Add a policy that allows the two actions only with the condition Bool aws:MultiFactorAuthPresent true.
CC. Add a policy that denies the two actions with the condition BoolIfExists aws:MultiFactorAuthPresent false.
DD. Remove AdministratorAccess and require engineers to assume a role through IAM Identity Center for every task they perform.
B. Wrong: An extra Allow does nothing while AdministratorAccess already allows the actions without MFA. Only an explicit Deny can take away a permission another policy grants. Learn more: Policy evaluation logic (opens in a new tab)
C. Right: Correct. An explicit Deny overrides the Allow in AdministratorAccess. BoolIfExists also denies requests where the key is missing, such as calls made with long-term access keys, so only MFA-authenticated calls succeed. Learn more: AWS global condition context keys (opens in a new tab)
Explicit Deny statements always win in IAM policy evaluation, so they are the way to restrict an action that a broad policy allows. aws:MultiFactorAuthPresent shows whether the caller authenticated with MFA, and BoolIfExists treats a missing key, as with long-term access keys, as not authenticated with MFA. Allow statements with conditions cannot remove permissions granted elsewhere.
A dental chain has hired a third-party monitoring company that needs read-only access to CloudWatch metrics and alarms in the chain's production account.
The vendor uses its own AWS account to access the accounts of hundreds of customers.
The chain's security team does not want long-term credentials shared, and it wants protection against another vendor customer tricking the vendor into accessing the chain's account.
What should a CloudOps engineer set up?
Choose one answer.
AA. An IAM user with CloudWatchReadOnlyAccess whose access keys are given to the vendor and rotated every 90 days.
BB. An IAM role with CloudWatchReadOnlyAccess that trusts the vendor's account, with no conditions in the trust policy.
CC. A resource-based policy on the account's CloudWatch metrics that grants the vendor's account read access to all namespaces.
DD. An IAM role with read-only CloudWatch access that trusts the vendor's account and requires an external ID.
Show the answer and explanation
Answer: D
A. Wrong: Access keys are long-term credentials, which the security team does not want to share. Rotation reduces the risk but does not remove it. Learn more: IAM users (opens in a new tab)
B. Wrong: This avoids long-term keys, but any principal the vendor's account allows could assume the role. Without an external ID, another customer could trick the vendor into using the chain's role. Learn more: The confused deputy problem (opens in a new tab)
C. Wrong: CloudWatch metrics and alarms do not support resource-based policies that grant cross-account read access. Cross-account access goes through IAM roles. Learn more: IAM roles (opens in a new tab)
Third-party access should use a cross-account IAM role, so the vendor gets temporary credentials and nothing long-lived is shared. Because the vendor serves many customers, the trust policy should require an external ID that is unique to this customer. That prevents the confused deputy problem.
Want more on IAM users, roles and policies? The 5 full-length practice sets have 10 more IAM users, roles and policies questions, 325 in all, none of them in the free exam. One payment of $14.99, no subscription. See the practice sets →