Skip to main content
Cloud basicsLesson 5 of 17

Permission Checks on One API Request (IAM)

A deploy script asks the cloud: "upload this file to storage". For every single request, the cloud checks "who are you?" and "may you do this?". IAM (Identity and Access Management) handles these checks. RBAC, which does the same inside Kubernetes, is covered in Who Can Do What (RBAC).

Caller identityNot checked
Decision-
Credential in useLong-term access key
Scriptdeploy-botAttackerLeaked keyAuthenticationWho are you?Policy evalAllowed to?Storage bucketDeploy filesProd DBCustomer dataRoleTemp credentialsAudit logWho · when · whatRequest + sig
RequestResponse / reportWatchAppears in a later step

What you will learn

  • Authentication (who) vs authorization (may you)
  • No allow means deny (default deny)
  • An explicit deny always beats an allow
  • Assuming a role to get temporary credentials
  • Why leaked long-term keys are dangerous, and least privilege

Names used in permission checks (AWS · Azure · GCP)​

ConceptAWSAzureGCP
Identity and permission managementIAMMicrosoft Entra ID · Azure RBACCloud IAM
Identity a program assumesIAM role (temporary credentials via STS)Managed IdentityService account
Organization-wide denyService control policy (SCP)Deny assignmentIAM deny policy
API call recordsCloudTrailActivity LogCloud Audit Logs

Try it yourself​

aws sts get-caller-identity # Authentication: who am I? (AWS example)
aws iam list-attached-user-policies --user-name <user> # Policies attached to the caller
aws iam simulate-principal-policy --policy-source-arn <user-arn> --action-names s3:PutObject rds:DeleteDBInstance # Allowed, explicit deny, or implicit deny
aws iam list-access-keys --user-name <user> # Long-term keys and when they were made
aws sts assume-role --role-arn <role-arn> --role-session-name demo # Temporary credentials with an expiry
aws cloudtrail lookup-events --lookup-attributes AttributeKey=AccessKeyId,AttributeValue=<key-id> --max-results 10 # Audit log for one key

Check yourself

  1. A request passes authentication, but no policy attached to the caller allows the action and no policy denies it. What happens?
  2. A broad admin policy allows deleting the production DB, but an organization-wide policy explicitly denies it. What is the result?
  3. An old long-term access key leaked to a public repository and an attacker used it. Which setup would have limited the damage most?

Further reading: What is IAM? (AWS) · Policy evaluation logic (AWS) · Who Can Do What (RBAC)