Skip to content
Tutorials Center
My learning

Topics

Lesson 10 of 38 ยท Identity and Access

Identity and Access Management Fundamentals

Learn the building blocks of cloud IAM: principals, authentication versus authorization, users, groups, roles, policies and the allow/deny decision, with a runnable evaluator.

In the cloud, almost every action is an API call, and every API call is made by some identity. Identity and Access Management (IAM) is the system that decides who that identity is and what it is allowed to do. It is the single most important area of cloud security: a perfect network design is useless if a stolen credential has administrator rights.

Providers use different names and syntax, but the concepts are shared. This lesson builds them up with a vocabulary you can map to any platform.

Authentication and authorization

  • Authentication (AuthN) answers "who are you?" It proves an identity with a password, a hardware key, a certificate or a signed token.
  • Authorization (AuthZ) answers "what may you do?" It checks the authenticated identity against policies.
  • Accounting (auditing) answers "what did you do?" It records actions in logs.

These three are often called AAA. Many breaches succeed because authentication is weak (no MFA) or authorization is too generous (admin everywhere).

Principals, resources, actions

An access decision always has four parts:

  1. Principal: who or what is asking (a person, an application, a service).
  2. Action: the operation requested, such as storage:read.
  3. Resource: what the action targets, such as one bucket or one object path.
  4. Context (conditions): extra facts like source network, time, MFA status or resource tags.

Identity types

Kinds of identity

Human users People, with MFA
Groups Sets of users
Roles Assumed, temporary
Service identities For workloads

Prefer roles and short-lived credentials over long-lived keys.

1 / 2
  • Users represent people. Best practice is to connect them to your company's identity provider (single sign-on) instead of creating separate cloud passwords.
  • Groups bundle users so you assign permissions once, for example "billing-readers".
  • Roles are identities that nobody logs in as. A user, a service or another account assumes a role and receives temporary credentials with that role's permissions.
  • Service identities (service accounts, managed identities) let a workload call other services without embedded passwords.
  • Federated identities come from outside the cloud, for example employees from your directory or a pipeline from your code host.

Policies

Permissions are written as policies, documents that list allowed or denied actions on resources, optionally with conditions. Most platforms share these ideas:

  • Default deny. Anything not explicitly allowed is refused.
  • Explicit deny wins. If any applicable policy denies, the answer is deny, even if another allows.
  • Identity-based policies attach to users, groups or roles ("this role may read that bucket").
  • Resource-based policies attach to the resource ("this bucket allows that role").
  • Guardrail policies (organization or boundary policies) set the maximum that anyone below can ever receive.

Here is a generic policy in the style most providers use. The format is illustrative, not tied to one vendor.

JSON
{
  "effect": "Allow",
  "actions": ["storage:GetObject", "storage:ListBucket"],
  "resources": ["bucket/reports", "bucket/reports/*"],
  "condition": { "mfa": true }
}
flowchart TB
    Req["Request: who, action, resource, context"] --> Deny{"Any explicit deny?"}
    Deny -->|"yes"| No["DENY"]
    Deny -->|"no"| Allow{"Any matching allow?"}
    Allow -->|"yes"| Yes["ALLOW"]
    Allow -->|"no"| No

The decision logic used by most cloud IAM engines: explicit deny, then explicit allow, otherwise deny.

Runnable example: a small policy evaluator

This evaluator implements default deny, explicit deny and wildcard matching with fnmatch. It is a model of how real engines reason, simplified for learning.

Python Evaluate requests against policies

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Check each result: reading is allowed without MFA, writing needs MFA, the secret path is denied even for read despite the first allow, and deleting was never granted.

Authentication strength

Passwords alone are weak. Strong cloud authentication layers:

  1. Single sign-on through a central identity provider so offboarding one person removes all access.
  2. Multi-factor authentication using phishing-resistant methods (hardware security keys, platform passkeys) where possible. See authentication, MFA and federation.
  3. Conditional access that considers device health, location and risk.
  4. Short sessions for sensitive consoles.

Common IAM mistakes

  • Using the account owner (root) for daily work, or leaving it without MFA.
  • Creating long-lived access keys for people and never rotating them.
  • Attaching broad managed policies "to get it working" and forgetting them.
  • Sharing one identity between several people or services, which destroys accountability.
  • Never removing access when people change teams or leave.

Protect the account owner. The root or owner identity can do things no one else can, including closing the account. Enable MFA, use a long random password stored safely, create no access keys for it and use it only for the few tasks that require it.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What is the difference between authentication and authorization?

    First the identity is established, then policies decide what that identity may do.
  2. 2. A request matches both an allow statement and an explicit deny. What happens?

    An explicit deny overrides any allow.
  3. 3. What is a role in cloud IAM?

    Roles are assumed by users or services and issue temporary credentials with the role's permissions.
  4. 4. What happens to a request that matches no allow statement?

    Cloud IAM is default deny: only what is explicitly allowed is permitted.

Summary

  • IAM decides who a caller is (authentication) and what they may do (authorization), and logs it for accountability.
  • A decision has a principal, action, resource and context; users, groups, roles and service identities are the principal types.
  • Policies use default deny, explicit deny wins, and can be identity-based, resource-based or guardrails.
  • Prefer SSO, MFA and roles with temporary credentials, and protect the root identity.

Next: Least Privilege and Policy Design