Boss lesson · Unit 01
Who can do what
Read an access policy statement by statement, then narrow one
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?
Correct answer
Read inbox, write pics, nothing more
Why
A thief can do whatever the credentials can do. If they can only read one bucket and write another, that is the whole loss. Granting no more than the job needs is called least privilege.
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.
{
"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.