Evaluation flow

Learn about the steps IAM takes in allowing or denying a request.

Now that we’ve discussed how IAM sees the request and how policies work that control access, it’s time to look into the exact steps it takes to reach a decision whether it allows or denies the request.

Step 1: Build the request context

First, it builds the request context based on the elements we’ve discussed in the Access elements lessons. This context includes the Principal, the entity making the request, the Action, describing what is being done, the Resource, the AWS entity that is the target of the operation, and other metadata attached to the request.

Unfortunately, there is little insight we have into the result of this step. It is probably a key-value structure where each key is populated from the request.

For example, when a user sends a request to AWS to read an object from an S3 bucket, the request context will be something like this:

Principal: arn:aws:iam::<id>:user/user1
Action: s3:GetObject
Resource: <bucket>/text.txt

These values are coming directly from what is in the operation, the Principal is doing an Action on a Resource. Then IAM populates the metadata with all the other available values:

Principal: arn:aws:iam::<id>:user/user1
Action: s3:GetObject
Resource: <bucket>/text.txt
aws:SourceIp: 203.0.113.0
aws:MultiFactorAuthPresent: true
aws:MultiFactorAuthAge: 3000

The above request context contains the IP address where the request came from, aws:SourceIp, and that the user is authenticated with an MFA device, aws:MultiFactorAuthPresent and aws:MultiFactorAuthAge. In practice, the request context contains a lot more information. This includes the username and the userid of the Principal, tags attached to the resource, regardless of if the request used SSL or not.

Note: The exact values in the request context are not known. We can only assume what they are by reading the ...