The idea
In the cloud, every request, such as "read this file", is checked. Identity and access management (IAM) asks two questions: who is asking (authentication), and are they allowed to do this (authorization)?
An identity that can send requests is called a principal. It can be a person or a program. Alice is an IAM user: an identity for one person. The app server is a program; we give it an identity at the end.
Who: authentication
Alice signs in with her password plus a one-time code from her phone. Using two kinds of proof is multi-factor authentication (MFA). She gets credentials that prove who she is. Nobody has said yet what she may do.
What: authorization
What Alice may do is written in a policy: a JSON document attached to her. Each statement has an Effect (Allow or Deny), an Action (what can be done) and a Resource (to what). Hers has two statements.
Alice asks to read photos/cat.jpg (the action s3:GetObject). Her credentials pass the "who?" check. Then her policy is checked: statement 1 allows reading anything in photos and nothing denies it, so she gets the file.
Next she tries to delete the same photo (s3:DeleteObject). Statement 2 denies that action on every resource ("*"). An explicit Deny always wins, even over an Allow, so the request is refused and nothing is deleted.
Then she asks to read payroll/pay.csv (s3:GetObject). No statement allows reading the payroll bucket. In IAM everything starts denied: unless a policy allows an action, the answer is no. This is called an implicit deny.
The check follows one rule. First, if any statement denies the request, deny. Otherwise, if a statement allows it, allow. Otherwise, deny. A tiny Python version of that rule gives the same three answers.
Good habits
Alice can read photos, but cannot delete them or open payroll. Giving each identity only the permissions its job needs, and nothing more, is called least privilege. If her password ever leaks, the damage stays small.
The app server must read photos too, but a password stored on a server can be stolen. Instead it uses a role: an identity with a policy but no password. AWS gives it temporary credentials that expire and are renewed automatically.
Google Cloud and Microsoft Azure use other names: roles are granted to principals in an allow policy, or by a role assignment. The idea is the same everywhere: prove who you are, then check what you are allowed to do.
What happens
;; step 1/11 · iam every request to a cloud service is checked 1. authentication who is asking? 2. authorization may they do this, to that? IAM = identity and access management
The figure follows AWS IAM, simplified. Real evaluation also weighs resource-based policies, permissions boundaries, session policies and organization-wide controls, and statements can add Conditions. The rule "explicit deny wins, else an allow, else deny" still holds. The policy card is valid JSON and also a valid Python dict. The Python rule uses fnmatchcase for the * wildcard; real IAM matches action names without regard to case and does not use fnmatch.