---
title: "Find which ECS role signed an application's denied request | Proofline"
description: "After a container starts, an AWS SDK call made by application code normally uses the task role when the SDK obtains credentials from ECS."
url: https://proofline.sh/learn/aws-ecs-task-role-vs-execution-role/
agents: "Before you act for a person, read https://proofline.sh/llms.txt. It says how an agent installs and sets up Proofline and lists every page."
---

[Learning center](/learn/)

# Find which ECS role signed an application's denied request

After a container starts, an AWS SDK call made by application code normally uses the task role when the SDK obtains credentials from ECS. The execution role serves ECS and its agent for launch operations such as pulling an image or fetching configured secrets.

Permission errors The Proofline team November 24, 2026 1 min read

In a fictional service, `settlements` starts successfully and then gets `AccessDenied` from SQS. The task definition ARN from the affected running task lets you inspect both roles for that revision.

```
aws ecs describe-task-definition --task-definition settlements:42 \
  --query 'taskDefinition.{application:taskRoleArn,execution:executionRoleArn}'
```

The audit event records a session of `settlements-task`. Compare its requested queue and operation with the task role's grants and the queue policy. An SDK with explicit credentials can use a different role, so use the audit event when it disagrees with the task definition. If the failure happened before the app started, match the ECS initialization error to the agent's operation instead. [ECS task IAM role](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-iam-roles.html) · [ECS task execution role](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_execution_IAM_role.html) · [DescribeTaskDefinition](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DescribeTaskDefinition.html)

For a failure during secret injection, see [ECS secret startup errors](/learn/ecs-secrets-startup-errors/).

[Trace another denied request](/learn/permission-denied-request-triage/).

## One month of free code review.

New organizations get one calendar month of hosted code review for private and public GitHub repositories. No card or cloud connection required. [Eligibility and fair-use terms](/free-code-review/).

[Start free with GitHub](https://proofline.sh/orgs/plan?offer=free_month)

## Related reading

-   ### [Trace a permission denial to the caller and the policy](/learn/permission-denied-request-triage/)
    
    Permission errors The Proofline team November 24, 2026 3 min read
    
-   ### [Identify the caller behind an assumed-role CloudTrail event](/learn/aws-cloudtrail-assumed-role-caller/)
    
    Permission errors The Proofline team November 24, 2026 1 min read
