> For the complete documentation index, see [llms.txt](https://cortex-docs.paloaltonetworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cortex-docs.paloaltonetworks.com/posture-rules/cloud-saas-active-directory-posture-rules/cortex-posture-query-based-rules/detection-rules-by-name/aws-cognito-service-role-does-not-have-identity-pool-verification.md). Agents can also search and read this documentation through its [MCP server](https://cortex-docs.paloaltonetworks.com/~gitbook/mcp).

# AWS Cognito service role does not have identity pool verification

### Synopsis

| Field               | Value                                                             |
| ------------------- | ----------------------------------------------------------------- |
| Rule Type           | Detection                                                         |
| Finding Type        | AWS Cognito service role does not have identity pool verification |
| Finding ID          | 60000862                                                          |
| Generates a Finding | This detection rule also generates a finding                      |
| Severity            | Informational                                                     |
| Category            | CONFIGURATION                                                     |
| Cloud Providers     | AWS                                                               |
| Platform Module     | CSPM                                                              |
| Asset Types         | AWS\_IAM\_ROLE                                                    |

### Description

AWS Cognito service roles lacking identity pool verification represent a significant security risk. Failure to validate the 'aud' claim in the Cognito service role trust policy allows tokens intended for one audience to access resources meant for another.

The Cognito service manages user identities and access. Its service roles define permissions for accessing resources. Without 'aud' claim validation, attackers could potentially forge or manipulate tokens to gain unauthorized access to sensitive data or resources. This could lead to data breaches, account takeovers, and escalated privileges.

A misconfiguration in the 'aud' claim validation exposes the entire application's resources to unauthorized access. Enforcing this claim ensures that only valid tokens, intended for the specific application, can access its resources, maintaining strong access controls and minimizing the attack surface.

To mitigate this risk, ensure all Cognito service roles include the 'aud' claim in their trust policies. Regularly audit Cognito configurations and implement automated checks to identify and remediate any missing 'aud' claim validations. This proactive approach will strengthen security and prevent unauthorized access.

### Remediation

To mitigate the absence of 'aud' claim validation in service roles associated with Cognito identity pools, follow these steps:

1. Sign in to the AWS Management Console and open the IAM console at <https://console.aws.amazon.com/iam/>.
2. In the navigation pane of the IAM console, choose 'Roles'.
3. In the list of roles in account, choose the name of the role that is reported.
4. Choose the 'Trust relationships' tab, and then choose 'Edit trust policy'.
5. Edit the trust policy, add a condition to verify that the 'aud' claim matches the expected identity pool.
6. Click 'Update Policy'.

Refer to the below link to add the required aud validation in service roles

<https://docs.aws.amazon.com/cognito/latest/developerguide/role-based-access-control.html#creating-roles-for-role-mapping>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://cortex-docs.paloaltonetworks.com/posture-rules/cloud-saas-active-directory-posture-rules/cortex-posture-query-based-rules/detection-rules-by-name/aws-cognito-service-role-does-not-have-identity-pool-verification.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
