Read a sample: 1. Follow the Application Identity
A developer deploys a small application that reads invoices from an Amazon S3 bucket. The code worked on a laptop. In the cloud, the same request returns an access-denied error.
The natural impulse is to open the bucket policy or add a broad permission to the application’s role. Neither step is a good starting point. Before changing permissions, the developer needs to know who actually made the request, which credentials the application used, what action it attempted, and which resource it addressed.
Those questions form the central habit of this book: follow the application identity from code to authorization.
An application can make an AWS request without containing an access key in its source code. It can also make a request under an identity different from the one its developer expected. Understanding the difference requires more than recognizing an IAM policy. It requires tracing the request through the environment in which the code runs.
This chapter introduces that trace. Later chapters examine each part in more depth, from role trust and credential providers to permission policies, secret retrieval, and access-denied troubleshooting.
Consider a Python application using Boto3, the AWS SDK for Python:
python
import boto3
s3 = boto3.client("s3")
response = s3.getobject(
Bucket="example-invoice-archive",
Key="2025/january.csv",
)
The code names an AWS service, an operation, a bucket, and an object key. It does not visibly name an IAM user or role. It also does not visibly include credentials.
Yet the request needs an authenticated identity and authorization. The SDK obtains credentials from a source available to the process and uses them to sign the request. AWS evaluates the resulting request against the applicable authorization controls.
A useful first-pass trace has five steps:
1. Operation: What does the code ask AWS to do?
2. Resource: Which specific resource does the request address?
3. Credential source: Where does the running process obtain credentials?
4. Effective identity: Which principal or role session do those credentials represent?
5. Authorization: Do the applicable policies and other controls permit this request?
For the example, the operation is GetObject, the resource is the object named 2025/january.csv in the bucket example-invoice-archive, and the relevant IAM action is s3:GetObject. The snippet alone does not establish the credential source, effective identity, or final authorization decision.
That last distinction matters. Code tells you what the application requests; it does not necessarily tell you who the application is when the request reaches AWS.
The object’s Amazon Resource Name, or ARN, is:
text
arn:aws:s3:::example-invoice-archive/2025/january.csv
The corresponding bucket ARN is different:
text
arn:aws:s3:::example-invoice-archive
An object operation and a bucket-level operation can require different actions and resource ARNs. Reading only the service name—“this application uses S3”—is not specific enough to assess access.
The developer who wrote the S3 code might sign in to the AWS Management Console using a human identity. The developer might also run the application locally with credentials from a configured profile. After deployment, the application can run using a role associated with its workload.
These are related activities, but they are not necessarily the same identity.
Imagine that Maya, a developer, can read the invoice object from her laptop. The deployed application cannot. Maya’s successful request shows that the credentials used on her laptop were authorized for that request at that time. It does not prove that the deployed workload uses those credentials or has equivalent permissions.
Likewise, a user signing in to an application is not automatically the AWS principal making the application’s service calls. A customer might authenticate to a web application, and the application might then use its own workload identity to call S3. The application remains responsible for deciding what that customer is allowed to request; AWS evaluates the service call under the AWS credentials used to sign it.
Some designs deliberately obtain distinct AWS credentials for different users or sessions. Do not assume that design merely because the application has a login screen. Follow the credentials used for the AWS request in the case you are reading.
This separation helps prevent a common reasoning error: assigning the permissions of a person to the process they built. A workload needs an appropriate identity and permissions of its own.
An IAM role is an identity with permissions, but an application does not put the role itself into an HTTP request. The application uses credentials associated with a role session. Temporary AWS credentials include an access key ID, a secret access key, and a session token. They expire and must be replaced when needed.
For many AWS-hosted workloads, the SDK can obtain and refresh temporary credentials supplied through the runtime environment. The application can then create a service client without embedding the credential values in its code. Exactly how credentials are delivered depends on the compute service and configuration.
A role therefore answers a different question from the credentials:
- The role defines an identity that can be assumed and has associated permissions.
- The temporary credentials let a particular session make signed requests.
- The SDK credential provider is the mechanism the application uses to find usable credentials.
- The authorization decision determines whether a particular signed request is allowed.
Having credentials does not imply permission to perform every action. Conversely, attaching a suitable permission to a role does not help a process that is actually using credentials for a different identity.
These distinctions will recur throughout the book. Chapter 2 focuses on who can assume a role; Chapter 3 follows…