Prepstellar

SAA-C03 · Secure Access to AWS Resources

26 cards

IAM Principals, Policies, and Least Privilege

Swipe, scroll or use ← →
  1. What least privilege actually asks for

    "Least privilege" is often repeated as an attitude. It is really a specification with three dimensions.

    Least privilege grants only the actions required for a task on specific resources under specific conditions.

    Dimension The question it answers
    Actions Which operations does this task genuinely perform?
    Resources On which specific resources?
    Conditions Under which circumstances is that acceptable?
    1 / 26
  2. What least privilege actually asks for

    A policy that leaves any of the three wide open is not least privilege, no matter how carefully the remaining one is written. Granting broad actions on every resource and promising to watch the logs afterwards is the classic version of this: monitoring reports what happened; it does not narrow what is possible.

    Two other misreadings are worth naming. Granting every action the account has ever recorded ignores the task boundary entirely. And an organization-level permissions ceiling grants nothing at all — it caps what an identity may do, so it can never be the thing that gives access.

    2 / 26
  3. Quick check

    What does least privilege require when a policy is written?

    1. AGrant broad actions on all resources and monitor afterwards

      Monitoring reports what happened; it does not narrow what the policy makes possible.

    2. BOnly the actions a task needs, on named resources

      Right. The grant covers only the required actions on specific resources under specific conditions.

    3. CEvery action the account has recorded, whatever the task

      Recorded activity is a starting point for analysis, not a licence to allow everything that ever ran.

    3 / 26

  4. Narrowing a policy from observed activity

    Writing a tight policy from scratch is hard, which is why observed behavior is such a useful input. IAM Access Analyzer can generate a fine-grained policy from services and actions recorded in access activity.

    Suppose activity shows that a production role used three actions against a single resource while its attached policy grants many services. The path is to generate the fine-grained policy from that recorded activity, test it, and then deploy the narrowed version. Generation supplies the draft; testing is what protects the task that must keep working.

    The alternatives make things worse in different ways: attaching another broad policy for redundancy widens exposure instead of reducing it, stripping every permission on the assumption that a ceiling will supply access misunderstands what a ceiling does, and granting the three actions on every resource narrows only one of the three dimensions.

    4 / 26
  5. Quick check

    Activity shows a production role used three actions on one resource, while its policy grants many services. What should the team do?

    1. AGenerate a fine-grained policy from the activity, test it, then deploy it

      Right. Recorded services and actions can seed a fine-grained policy, and testing it protects the observed task before it replaces production access.

    2. BAttach a second broad managed policy alongside it, for redundancy across services

      A second broad policy adds entitlement; the requirement was to reduce exposure.

    3. CGrant those three actions on every resource, untested

      Narrowing the actions but opening every resource leaves the resource dimension as wide as before, and deploying untested risks the task.

    5 / 26

  6. People federate, workloads assume roles

    Before choosing any object, decide who is asking: a person or a workload. The recommended answer differs, but both land on temporary credentials.

    Human users should use federation and temporary credentials rather than IAM users with long-term credentials.

    An IAM role supplies temporary credentials to a trusted user, workload, application, or AWS service. That single sentence covers people, machines, and services alike.

    6 / 26
  7. People federate, workloads assume roles

    For workloads the mechanism is especially clean. Applications on supported AWS compute services can obtain role credentials without distributing long-term IAM user credentials. Nothing has to be embedded in an image, a configuration file, or a repository.

    Requester Preferred identity What it avoids
    A person Federation, then an assumed role An IAM user with long-term credentials
    An application on supported compute A role associated with the workload A stored long-term access key

    Note what cannot fill this position: a group is a permission container and is never attached to a compute resource as an identity, and a policy on a resource does not manufacture credentials at start-up.

    7 / 26
  8. Quick check

    Which IAM identity is designed to supply temporary credentials to an AWS workload?

    1. AAn IAM user whose long-term key is stored in the workload

      Embedding a long-term key is exactly the distribution problem roles remove.

    2. BA user group attached to the compute resource

      A user group holds permissions for users; it is not an identity a compute resource runs as.

    3. CA role associated with the workload, supplying temporary credentials

      Right. Applications on supported compute services obtain role credentials without long-term IAM user credentials being distributed.

    8 / 26

  9. Keep your progress in the app

    That’s 3 of 10 quick checks. In the app they stay answered, and every lesson remembers where you left off.

  10. When an IAM user is the exception

    The preference for roles is strong, not absolute. An IAM user is appropriate for a specific use case that requires long-term credentials and cannot use an IAM role. An IAM user has an individual set of security credentials.

    The exception comes with upkeep. When an IAM user must have long-term programmatic credentials, access keys should be updated when needed and access-last-used information can support safe removal.

    9 / 26
  11. When an IAM user is the exception

    Take a legacy tool that cannot assume a role and needs an access key. The user is justified, and the maintenance follows: update the key when it needs updating, and use last-used information to decide when a key can be removed without breaking anything.

    What does not follow from a supported exception:

    • The key does not become an account root credential. Root is not a convenience upgrade.
    • The key does not move into a group to be shared. An IAM user's credentials are individual, and groups hold permissions rather than secrets.
    • The key is not left untouched forever. Long-term credentials can and should be updated.
    10 / 26
  12. Quick check

    A legacy tool cannot use roles and needs an IAM user's long-term access key. Which practice is supported?

    1. AUpdate the key when needed, and use last-used information to remove it safely

      Right. A supported long-term-credential exception still requires key updates, and access-last-used information informs safe removal.

    2. BLeave it untouched, since long-term credentials cannot be updated

      Long-term keys are updated when needed; leaving them unchanged is the risk the practice addresses.

    3. CConvert it into account root credentials so that recovery becomes simpler later on

      Root credentials must be safeguarded like other sensitive personal information, not handed to a tool for convenience.

    11 / 26

  13. The root user, and the control that belongs with it

    The account root user is the one identity with no substitute and no fallback. AWS account root user credentials should be safeguarded like other sensitive personal information. The AWS account root user cannot switch to an IAM role, so the usual "drop into a narrower role" reflex is not available here.

    When an exceptional identity has to be used, the answer is an added sign-in control rather than a redesign of the identity. MFA requires both a user's credentials and a device-generated response to complete sign-in. MFA is recommended when an IAM user or root user is required.

    Evaluate the two halves separately: the scenario tells you which identity is unavoidable, and MFA is what strengthens the sign-in for it. A group membership grants nothing to root, and naming a group in a policy on a resource is invalid for reasons covered later.

    12 / 26
  14. Quick check

    A break-glass process requires the AWS account root user. Which added sign-in control is recommended?

    1. AA console switch from root into a temporary administration role

      The root user cannot switch to an IAM role, so this control is not available.

    2. BMFA: the credentials plus a device-generated response

      Right. MFA is recommended when a root user or IAM user is required, and it adds a device-generated response to the credentials.

    3. CAdding the root user to an IAM user group that holds the permissions

      Groups are collections of IAM users receiving policy permissions; root is not managed that way.

    13 / 26

  15. Groups manage permissions; they are not identities

    A group is the answer to "several people need the same permissions", and nothing else. An IAM user group is a collection of IAM users that receives permissions from identity-based policies attached to the group.

    Attach the policy once, add users to the group, and the assignment scales without repeating itself per person.

    14 / 26
  16. Groups manage permissions; they are not identities

    Two limits define the shape of the object. IAM user groups cannot be nested and cannot be named as a Principal in a resource-based policy.

    A group is A group is not
    A collection of IAM users An authenticated principal
    A place to attach identity-based policies A session, temporary or otherwise
    A flat container A container of other groups

    That second column is where scenario questions live. Separate the permission-management container from an authenticated identity and from an assumed session before choosing among these objects, and the wrong answers stop being tempting.

    15 / 26
  17. Quick check

    What is an IAM user group?

    1. AA temporary credential session assumed by an application

      A session comes from assuming a role; a group holds no credentials at all.

    2. BA container that can hold other IAM user groups

      Groups cannot be nested, so a group never contains another group.

    3. CA collection of IAM users that receives permissions from an attached policy

      Right. It is a collection of IAM users that receives permissions from identity-based policies attached to it.

    16 / 26

  18. Two places a policy can live

    Permissions are expressed in policies, and where a policy is attached changes what it can say. Identity-based policies grant permissions to IAM users, groups, and roles, while resource-based policies are attached to resources.

    Policy type Attached to Typical use
    Identity-based An IAM user, group, or role Give an identity permission to act
    Resource-based The resource itself Let the resource grant access to a named principal
    17 / 26
  19. Two places a policy can live

    Within identity-based policies there is a second choice, about how tailored the permission set is. AWS managed policies can provide a starting point, but customer managed policies can be reduced for a specific use case.

    A managed policy is a reasonable way to get a workload running. Once the use case is mature and its real needs are known, the narrowing move is a customer managed policy scoped to that use case. A broad managed policy does not become least privilege by having been used for a long time, and moving a workload into a group while detaching its policies removes the permissions rather than tailoring them.

    18 / 26
  20. Quick check

    A team started from an AWS managed policy and now needs permissions tailored to one mature workload. What comes next?

    1. AKeep the AWS managed policy as it is

      A managed policy is a starting point; it is not automatically scoped to one workload's use case.

    2. BMove the workload into a user group and detach every policy currently attached

      Detaching policies removes access instead of narrowing it, and groups hold users rather than workloads.

    3. CWrite a customer managed policy reduced to this workload's use case

      Right. Customer managed policies can be reduced for a specific use case once that use case is understood.

    19 / 26

  21. Granting access from the resource side

    Sometimes the resource itself should do the granting. A resource-based policy can grant access by naming an authenticated principal, but an IAM user group cannot be that Principal.

    There is also a boundary on how far that delegation reaches: IAM roles and resource-based policies can delegate cross-account access only within one AWS partition.

    So a direct-resource-access design is checked in three steps, in this order:

    1. Attachment point — is the policy on the resource, where it can name a principal?
    2. Named object — is the named object an authenticated principal, and not a group?
    3. Partition — are both accounts inside one AWS partition?
    20 / 26
  22. Granting access from the resource side

    Run a valid case through it. A service resource must grant access directly to an authenticated identity in another account within the same partition: attach a resource-based policy to the resource and name the permitted principal. All three checks pass.

    Now the invalid one. A bucket policy names an IAM user group in another partition, and the design insists on keeping the group as the named identity. It fails twice over, on two independent boundaries: a group is not an authenticated principal, and delegation through roles or resource policies does not cross partitions. Neither failure rescues the other, and no policy converts a group into a role on arrival.

    21 / 26
  23. Quick check

    A resource must grant access directly to an authenticated identity in another account inside the same partition. Which placement fits?

    1. AAn identity-based policy on a user group, naming the group as the principal

      Identity-based policies attach to identities, and a group can never be named as the principal in this kind of policy.

    2. BA resource-based policy on the resource, naming the principal

      Right. The policy lives on the resource and names an authenticated principal, which supports same-partition cross-account access.

    3. CA resource policy created in a different partition, delegating across it

      Delegation through resource policies stays inside one AWS partition, so a cross-partition design cannot work.

    22 / 26

  24. Choosing the object for the need

    With the pieces separated, selection becomes mechanical. Choose a user for a supported long-term-credential exception, a group to manage permissions for multiple users, a role for temporary credentials, and a policy to express permissions.

    Mixed requirements are just two selections made independently. A build service that must not carry a long-term key needs temporary credentials, which is a role. Five operators who need one permission set managed together need a group with an identity-based policy attached. Choosing the principal first, then comparing the required permission scope with the policy choices, keeps the two halves from contaminating each other.

    23 / 26
  25. Quick check

    A build service needs temporary credentials with no long-term key, and five operators need one permission set managed together. Which combination fits?

    1. AA role for the build, and a user group with an identity-based policy for the operators

      Right. The role supplies the workload's temporary session, and the group gives one manageable permission assignment across the five users.

    2. BOne IAM user key for the build, shared with the operators

      A shared long-term key is the credential the requirement excludes, and sharing one user removes individual accountability.

    3. CA user group for the build, and a resource policy naming that group

      A group is not an identity a build service can run as, and a group cannot be named as the principal in a policy on a resource.

    24 / 26

  26. Key takeaways

    • Least privilege is specific: only the required actions, on specific resources, under specific conditions.
    • Let observed activity draft the policy: Access Analyzer can generate a fine-grained policy from recorded services and actions, and the result is tested before it replaces production access.
    • Prefer temporary credentials: people federate, workloads assume roles, and applications on supported compute services obtain role credentials without long-term keys being distributed.
    • Treat the IAM user as an exception: it fits a use case that needs long-term credentials and cannot use a role, with keys updated when needed and last-used information guiding removal.
    • Protect root and add MFA: root credentials are safeguarded like sensitive personal information, root cannot switch to a role, and MFA adds a device-generated response when root or an IAM user is required.
    • Know each object's job: a group manages permissions for multiple users but is neither an authenticated principal nor nestable; identity-based policies attach to identities and resource-based policies attach to resources; delegation stays inside one AWS partition.
    25 / 26
  27. Quick check

    A bucket policy names an IAM user group in another AWS partition. Can it work as written?

    1. AYes, because groups are authenticated principals

      A group is a collection of users for permission management and is never an authenticated principal.

    2. BNo: a group cannot be the principal, and delegation stays inside one partition

      Right. The design fails on two independent boundaries: the named object and the partition.

    3. CNo, because a policy attached to a resource can never grant access across accounts at all

      Cross-account access from a resource policy is supported within one partition, so the objection is too broad.

    26 / 26

  28. 10 quick checks · then the test

    In the app, finishing the quick checks opens this lesson’s 10-question test, and the ones you miss come back exactly when you’re about to forget them.

The whole course, on your phone

Lessons you can read, audio you can listen to on the way to work, and practice that remembers what you got wrong.