← Home ← Codex ← DEBT ← Engine
Browse by Category
+ added · updated 7d
← Back to glossary

Cloud IAM Roles

Cloud CWE-732 OWASP A01:2021-Broken Access Control CVSS 8.1 Intermediate
debt(d5/e5/b7/t7)
d5 Detectability Operational debt — how invisible misuse is to your safety net

Closest to 'specialist tool catches it' (d5), wildcard grants and static keys are caught by IaC scanners in detection_hints.tools (checkov, tfsec, prowler, cloudsploit), but only if those specialist scans are wired into the pipeline; nothing surfaces in normal compilation or default linting.

e5 Effort Remediation debt — work required to fix once spotted

Closest to 'touches multiple files / significant refactor in one component' (e5), the quick_fix requires enumerating minimal explicit actions on named ARNs and rewiring workloads to assume roles instead of static keys — more than a one-liner, spanning policy definitions and application credential handling.

b7 Burden Structural debt — long-term weight of choosing wrong

Closest to 'strong gravitational pull' (b7), IAM roles apply across web/cli/queue-worker contexts and are the security boundary the whole system's access model rests on; per-workload least-privilege scoping shapes how every new service is provisioned and every change is reviewed.

t7 Trap Cognitive debt — how counter-intuitive correct behaviour is

Closest to 'serious trap' (t7), the misconception states people treat a role as a login identity with a permanent password, when it actually holds no permanent credentials and issues short-lived rotating ones on assumption — this contradicts how a normal user account works and misleads credential handling.

About DEBT scoring →

Also Known As

IAM role cloud roles identity and access management roles role-based access control cloud

TL;DR

A named bundle of permissions attached to a principal that defines which actions it can perform on which cloud resources.

Explanation

Identity and Access Management (IAM) roles are the primary mechanism cloud providers use to answer the question: who can do what to which resource? A role is a named collection of permissions (policy statements) that grants specific actions - like s3:GetObject or compute.instances.start - on specific resources, optionally constrained by conditions. Unlike a user, a role has no long-lived credentials of its own; a principal (a user, group, service account, or a workload such as an EC2 instance or Lambda function) assumes the role and receives short-lived credentials scoped to that role's permissions.

The core distinction across providers is between identity-based grants and the entity that holds them. On AWS you attach policies to roles and let services or users assume them via sts:AssumeRole. On GCP you bind a principal to a role at a resource, folder, or project level. On Azure you assign role definitions to principals at a scope. In all cases the effective permission set is the union of allow statements minus any explicit deny, evaluated against the requested action and resource.

Roles matter because they replace embedding static access keys in code or config. A workload that assumes a role gets rotating credentials automatically, so a leaked snapshot or log line does not hand an attacker a permanent key. Roles also make the principle of least privilege enforceable: you grant exactly the actions a service needs, scoped to exactly the resources it touches, rather than handing out broad admin.

The common failure mode is over-broad grants - wildcards on actions and resources - because they make the immediate task work and defer the security cost. Well-designed roles are narrow, use resource-level constraints and conditions, and are reviewed as access requirements change. Trust policies (who may assume a role) deserve as much scrutiny as permission policies, since a permissive trust relationship lets unintended principals inherit the role's power.

Common Misconception

People assume an IAM role is just a login identity with a password; in fact a role holds no permanent credentials and is assumed temporarily by a principal, issuing short-lived rotating credentials each time.

Why It Matters

Roles are the boundary between a minor incident and a full compromise: least-privilege roles limit blast radius when a workload or key is exposed, while wildcard grants turn one leaked credential into account-wide access.

Common Mistakes

  • Granting Action: "*" and Resource: "*" because it is faster than enumerating the exact permissions needed.
  • Baking static access keys into application code instead of letting the workload assume a role.
  • Writing permissive trust policies that let any principal in the account (or another account) assume a privileged role.
  • Reusing one broad role across many unrelated services instead of scoping a role per workload.
  • Never reviewing or pruning roles, so permissions accumulate long after the need disappears.

Avoid When

  • Never over-grant just to unblock a deploy - a temporary wildcard almost always becomes permanent.
  • Do not use a single shared role for many distinct workloads when each has different access needs.
  • Avoid long-lived static access keys where the platform supports assumable roles or workload identity.

When To Use

  • Granting a cloud workload (EC2, Lambda, container, service account) access to resources without embedding credentials.
  • Enforcing least privilege by scoping distinct roles per service and per environment.
  • Enabling cross-account or federated access through scoped trust policies and short-lived credentials.

Code Examples

✗ Vulnerable
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": "*",
      "Resource": "*"
    }
  ]
}
// Over-broad: this role can do anything to anything.
// A leaked credential using it compromises the whole account.
✓ Fixed
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "ReadAppUploads",
      "Effect": "Allow",
      "Action": ["s3:GetObject", "s3:PutObject"],
      "Resource": "arn:aws:s3:::my-app-uploads/*",
      "Condition": {
        "StringEquals": {"aws:RequestedRegion": "eu-west-1"}
      }
    }
  ]
}
// Scoped: only object read/write on one bucket, one region.
// Workload assumes this role and gets short-lived credentials.

Added 4 Jul 2026
Views 29
Rate this term
No ratings yet
🤖 AI Guestbook educational data only
| |
Last 30 days
0 pings S 0 pings M 0 pings T 0 pings W 0 pings T 0 pings F 0 pings S 0 pings S 0 pings M 0 pings T 0 pings W 0 pings T 0 pings F 1 ping S 5 pings S 1 ping M 1 ping T 1 ping W 0 pings T 1 ping F 1 ping S 1 ping S 0 pings M 0 pings T 0 pings W 0 pings T 1 ping F 0 pings S 0 pings S 0 pings M
No pings yet today
No pings yesterday
Google 3 Meta AI 2 Applebot 2 ChatGPT 1 Amazonbot 1 Perplexity 1 PetalBot 1 Ahrefs 1 Brave Search 1
crawler 12 crawler_json 1
🧱 FUNDAMENTALS — new to this? Start with the ground floor.
Cloud cloud The cloud refers to remote servers accessed over the internet that store data, run applications, and provide computing power instead of using your local machine.

Almost every modern application relies on cloud infrastructure. Understanding the cloud helps you deploy apps, manage costs, and build systems that can handle real-world traffic without buying physical hardware.

💡 Think of the cloud as renting computers by the hour — you pay for what you use, so always turn off what you're not using.

Ask Codex about Cloud →
DEV INTEL Tools & Severity
🟠 High ⚙ Fix effort: Medium
⚡ Quick Fix
Replace wildcard action/resource grants with the minimal explicit actions on named resource ARNs, and let workloads assume roles instead of using static keys.
📦 Applies To
infrastructure iac ci-cd cloud-config terraform cloudformation pulumi
🔗 Prerequisites
🔍 Detection Hints
"Action"\s*:\s*"\*"|"Resource"\s*:\s*"\*"|AWS_SECRET_ACCESS_KEY\s*=
Auto-detectable: ✓ Yes checkov tfsec cloudsploit prowler
⚠ Related Problems
🤖 AI Agent
Confidence: Medium False Positives: Medium ✗ Manual fix Fix: High Context: File Tests: Update
cwe-732 cwe-269


✓ schema.org compliant