TExcelTAD
Home › Cloud & Container Security › IAM Concepts Across AWS, Azure and GCP

IAM Concepts Across AWS, Azure and GCP

In a data centre the attacker wants a domain admin; in the cloud the attacker wants a principal with the right permissions. Identity and access management (IAM) is the cloud's real perimeter: every API call, from reading a bucket to deleting a whole account, is checked against it, and most cloud attack paths are chains of IAM grants. An auditor who reviews more than one cloud meets three vocabularies for the same few ideas. This lesson lines them up, so the rest of the course can use AWS-style JSON as its main example without leaving Azure and GCP behind.

The same four questions

Every IAM system answers: who (a principal), may do what (an action or permission), on which resource (and everything below it), under which conditions.

Idea AWS Azure Google Cloud
Human principal IAM user (discouraged), federated session via IAM Identity Center Entra ID user Google account / Cloud Identity user
Group IAM group (can't be a policy principal) Entra ID group Google group
Workload principal IAM role assumed by a service (instance profile, task role, Lambda role) managed identity, service principal service account
Permission unit action s3:GetObject action Microsoft.Storage/storageAccounts/read, data action …/blobs/read permission storage.objects.get
Bundle of permissions policy document (managed or inline) role definition (built-in or custom) role (basic, predefined, custom)
How a grant is made attach a policy to a principal, or name the principal in a resource policy role assignment = role + principal + scope binding in a resource's allow policy = role + members (+ condition)
Scope hierarchy organisation → OU → account → resource tenant → management group → subscription → resource group → resource organisation → folder → project → resource
Explicit deny Deny statements, SCPs, permission boundaries deny assignments (mostly from managed features), Azure Policy for configuration IAM deny policies

Three differences matter most in reviews:

  • Where grants live. AWS grants are mostly attached to the principal (identity policies), with resource policies as a second source. Azure and GCP grants are attached to a scope and inherited downwards: an Owner assignment on a subscription, or roles/owner on a folder, covers every resource underneath. A review must walk the hierarchy upwards.
  • Hard boundaries. An AWS account is the strongest isolation unit; cross-account access needs explicit trust on both sides. In Azure the tenant plays that role, in GCP the organisation; projects and subscriptions are softer boundaries inside it.
  • Basic roles. GCP's roles/owner, roles/editor, roles/viewer and Azure's Owner, Contributor are broad by design; Editor and Contributor can change almost everything except access itself. Finding them on workload identities is a classic finding.

The details of each are in IAM, Azure RBAC and Google Cloud IAM.

One question across three clouds

An auditor's first job is often a single question across everything: who can delete storage in production? The program normalises grants from the three clouds into one shape (principal, permission pattern, scope) and answers it, walking Azure and GCP scopes up the hierarchy. The grants are synthetic and the role contents are abbreviated to the permissions that matter here.

python · try it yourself
from fnmatch import fnmatchcase

# role -> permission patterns (abbreviated; real roles hold many more)
ROLES = {
    "azure:Owner": ["*"],
    "azure:Contributor": ["*"],          # minus Microsoft.Authorization/*/write in reality
    "azure:Storage Blob Data Reader": ["Microsoft.Storage/storageAccounts/blobServices/containers/blobs/read"],
    "gcp:roles/editor": ["*"],           # simplified: basic roles cover most services
    "gcp:roles/storage.objectViewer": ["storage.objects.get", "storage.objects.list"],
    "gcp:roles/storage.admin": ["storage.*"],
}
# Azure and GCP: grants on a scope, inherited by everything below it
grants = [
    ("azure", "ops-group", "azure:Owner", "/subscriptions/prod"),
    ("azure", "app-identity", "azure:Contributor", "/subscriptions/prod/resourceGroups/rg-app"),
    ("azure", "analyst", "azure:Storage Blob Data Reader", "/subscriptions/prod/resourceGroups/rg-data"),
    ("gcp", "ci@lab-prod.iam", "gcp:roles/editor", "folders/prod"),
    ("gcp", "backup@lab-prod.iam", "gcp:roles/storage.admin", "projects/lab-prod/buckets/backups"),
    ("gcp", "alice@lab.test", "gcp:roles/storage.objectViewer", "projects/lab-prod"),
]
# AWS: identity policies attached to principals (one statement each, for brevity)
aws = [
    ("arn:aws:iam::123456789012:role/ci-deploy", "s3:*", "arn:aws:s3:::lab-*"),
    ("arn:aws:iam::123456789012:user/alice", "s3:GetObject", "arn:aws:s3:::lab-app-uploads/*"),
    ("arn:aws:iam::123456789012:role/app-role", "s3:PutObject", "arn:aws:s3:::lab-app-uploads/*"),
]
GCP_PARENTS = {"projects/lab-prod/buckets/backups": "projects/lab-prod", "projects/lab-prod": "folders/prod"}

def covers(scope, target, cloud):
    if cloud == "azure":
        return target == scope or target.startswith(scope + "/")
    while target:                                   # gcp: walk up the resource hierarchy
        if target == scope:
            return True
        target = GCP_PARENTS.get(target)
    return False

questions = [("azure", "Microsoft.Storage/storageAccounts/delete", "/subscriptions/prod/resourceGroups/rg-data/providers/Microsoft.Storage/storageAccounts/labdata"),
             ("gcp", "storage.buckets.delete", "projects/lab-prod/buckets/backups"),
             ("aws", "s3:DeleteBucket", "arn:aws:s3:::lab-app-uploads")]
for cloud, perm, target in questions:
    print(f"{cloud}: who can {perm}?")
    if cloud == "aws":
        hits = [(p, f"{pat} on {res}") for p, pat, res in aws
                if fnmatchcase(perm.lower(), pat.lower()) and fnmatchcase(target, res)]
    else:
        hits = [(p, f"{role.split(':', 1)[1]} at {scope}") for c, p, role, scope in grants
                if c == cloud and covers(scope, target, cloud)
                and any(fnmatchcase(perm, pat) for pat in ROLES[role])]
    for principal, why in hits:
        print(f"   {principal:44} via {why}")
azure: who can Microsoft.Storage/storageAccounts/delete?
   ops-group                                    via Owner at /subscriptions/prod
gcp: who can storage.buckets.delete?
   ci@lab-prod.iam                              via roles/editor at folders/prod
   backup@lab-prod.iam                          via roles/storage.admin at projects/lab-prod/buckets/backups
aws: who can s3:DeleteBucket?
   arn:aws:iam::123456789012:role/ci-deploy     via s3:* on arn:aws:s3:::lab-*

Every answer is a review finding waiting to be judged. The Azure workload identity is not on the list only because its Contributor grant sits on a different resource group; the CI service account in GCP can delete the backup bucket because roles/editor on the prod folder is inherited two levels down, which nobody would see by looking at the bucket alone. And the AWS CI role's s3:* on lab-* covers every bucket whose name happens to start with lab-.

How IAM weaknesses are found

  • Enumerate effective access, not documents: per principal, what can it do, and per sensitive resource, who can reach it. The providers' tools do part of this (AWS IAM Access Analyzer and the policy simulator, Azure's "Check access", GCP Policy Analyzer and Policy Troubleshooter); open-source graph tools such as Cartography or PMapper build the full graph.
  • Flag broad roles on workloads: *, Owner, Contributor, roles/editor, roles/owner assigned to service identities.
  • Walk the hierarchy: grants on management groups, subscriptions, folders and the organisation are inherited by everything beneath them.

How it is fixed

  • Grant at the narrowest scope that works, with predefined or custom narrow roles instead of basic ones.
  • Give each workload its own identity; never share one service account between applications.
  • Prefer groups for humans and short-lived federated sessions over long-lived user keys (Role Assumption and Federation).
  • Put guardrails above the account or project: SCPs, Azure Policy, organisation policies and deny policies (the next-but-one lesson).

Pitfalls

  • Reviewing a resource's own grants and missing inherited ones from folders or subscriptions.
  • Treating Azure Contributor as harmless because it "can't change access": it can usually read secrets and keys from the resources it manages, run commands on VMs and change their identities.
  • Matching AWS actions case-sensitively: action names are case-insensitive, ARNs are case-sensitive.

Practice

1. Add a GCP binding giving dev@lab-dev.iam roles/storage.admin on projects/lab-dev. Does it appear in the answer for the backups bucket?

No: projects/lab-dev is not an ancestor of projects/lab-prod/buckets/backups. Grants only flow down their own branch of the hierarchy.

2. Which Azure grant would you change first, and to what?

ops-group as Owner on the whole production subscription: split it into narrower roles at resource-group scope and make Owner an eligible, time-limited role (Entra ID Privileged Identity Management) instead of a standing one.

3. Why is the AWS pattern arn:aws:s3:::lab-* risky even if all current lab- buckets are meant for CI?

Bucket names are global, and any bucket created later with that prefix, including the audit-log bucket lab-trail-123456789012, is covered automatically. List the exact buckets.

Test yourself

In Azure and GCP, where is a grant attached?

  1. Always to the user object
  2. To a scope (subscription, resource group, folder, project, resource), inherited by everything below
  3. Only to the organisation
  4. To the network

Why can ci@lab-prod.iam delete the backups bucket in the program?

  1. It has a bucket-level binding
  2. roles/editor on folders/prod is inherited by the project and the bucket
  3. GCP has no access control on buckets
  4. It is the bucket owner

Which AWS unit is the strongest isolation boundary?

  1. A region
  2. An IAM group
  3. An account
  4. A VPC