Bitpath

Boss lesson · Unit 01

Who can do what

Read an access policy statement by statement, then narrow one

13 exercisesabout 3 min

What you practise

  • Users, roles and policies, a JSON policy read statement by statement, least privilege, a policy that is too wide found and narrowed

Try a question from this lesson

Pick one

A function resizes photos: it reads the inbox bucket and writes the pics bucket. One day its credentials leak. Which grant limits the damage most?

The ideas

Concept cards are short on purpose. In the app they appear between questions, after you have met the idea.

Concept

Users, roles, policies

A user is an identity for a person, with long-term credentials.

A role has no password or keys of its own. A person or a service assumes it and receives temporary credentials that expire. Code running in the cloud should use a role.

A policy is a JSON document that says what is allowed. Attach it to a user or role, or to a resource such as a bucket.

Until some policy allows a request, it is denied.

AWS: IAM users, roles and policies.

Concept

One statement, five words

A policy is a list of statements. Each one can use five elements.

Effect: Allow or Deny.

Action: which operations, written service:Operation.

Resource: which things, named by ARN, AWS's resource address.

Principal: who. Only in policies attached to a resource. In a policy attached to a user or role, the holder is the principal.

Condition: extra tests that must hold.

This statement lets its holder download any object in the pics bucket.

JSON
{
  "Version": "2012-10-17",
  "Statement": [{
    "Sid": "ReadPhotos",
    "Effect": "Allow",
    "Action": "s3:GetObject",
    "Resource": "arn:aws:s3:::pics/*"
  }]
}

10 more exercises in the app

  • 1× match the pairs
  • 4× multiple choice
  • 2× fill the blanks
  • 2× true or false
  • 1× order the lines

Bitpath is an iOS app in development. Join the waitlist and you get one email when it is ready to try.

One email when Bitpath is ready to try. Nothing else. Privacy