Bitzu

CLF-C02 ยท Identity and access management

IAM policies and least privilege

AWS managed versus customer managed versus inline policies, identity-based versus resource-based policies, and granting only the permissions needed.

Key points

  • Identity-based policies attach to users, groups or roles:
  • AWS managed: written and updated by AWS, cannot be edited.
  • Customer managed: you write them, reusable across identities.
  • Inline: embedded in one identity, deleted with it.
  • Resource-based policies: on a resource such as an S3 bucket, name allowed principals.
  • An explicit Deny always beats an Allow.
  • Least privilege: only the actions and resources a task needs.

Source: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_managed-vs-inline.html

Practice questions

Single choice

Which type of policy is created and maintained by AWS and cannot be edited by the customer?

  1. Customer managed policy
  2. AWS managed policy
  3. Inline policy
  4. Role trust policy
Show answer

Answer: B. AWS managed policy

AWS managed policies are standalone policies owned by AWS; AWS updates them, and you can only attach or detach them. Customer managed and inline policies are both written and edited by you.

Select all that apply

Which statements correctly describe resource-based policies?

  1. They are attached to a resource such as an Amazon S3 bucket
  2. They are attached directly to IAM users and groups
  3. They specify which principals may access the resource
  4. They are inline only and cannot be managed policies
  5. They are maintained by AWS and updated automatically
Show answer

Answer: A. They are attached to a resource such as an Amazon S3 bucket, C. They specify which principals may access the resource, D. They are inline only and cannot be managed policies

Resource-based policies are attached to resources such as S3 buckets or SQS queues, they specify which principals get access, and they are always inline. They are not attached to users, and AWS does not publish managed resource-based policies.

True or false

If one policy allows an action and another policy explicitly denies the same action, the request is allowed because at least one Allow exists.

Show answer

Answer: False

False. AWS checks for an explicit Deny first; if any applicable policy denies the action, the request is denied no matter how many Allow statements exist.

Practice 8 questions on this topic in Bitzu

Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.

Download on the App StoreGet it on Google Play

More CLF-C02 topics in this module