Skip to content
Cloud Governance Tools

Deny unauthenticated access to Cognito identity pools

Deny unauthenticated access to Cognito identity pools is an AWS guardrail written in resource control policies. Denies GetId, GetCredentialsForIdentity and GetOpenIdToken for unauthenticated (guest) identities in Cognito identity pools. What it breaks: applications that rely on guest access to an identity pool can no longer obtain credentials; only authenticated users can.

More public exposure guardrails ยท About Resource control policies

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "DenyUnauthenticatedIdentityPoolAccess",
      "Effect": "Deny",
      "Principal": "*",
      "Action": [
        "cognito-identity:GetId",
        "cognito-identity:GetCredentialsForIdentity",
        "cognito-identity:GetOpenIdToken"
      ],
      "Resource": "*",
      "Condition": {
        "StringLike": {
          "cognito-identity-unauth:IdentityPoolArn": "*"
        }
      }
    }
  ]
}
Blocks
Denies GetId, GetCredentialsForIdentity and GetOpenIdToken for unauthenticated (guest) identities in Cognito identity pools.
Breaks
Applications that rely on guest access to an identity pool can no longer obtain credentials; only authenticated users can. (source)
Test before applying
As for every Resource control policies guardrail: how to test before enforcing
Mechanism
Resource control policies (RCPs): Resources of supported services in member accounts, for any principal calling them; not resources in the management account and not service-linked roles.
Taken from
open source set, MIT-0 (README states MIT-0; LICENSE file fetched, MIT-0 text, Copyright Amazon.com, Inc.): https://raw.githubusercontent.com/aws-samples/resource-control-policy-examples/main/LICENSE

What the policy text names

It names 3 actions or patterns: cognito-identity:GetId, cognito-identity:GetCredentialsForIdentity, cognito-identity:GetOpenIdToken. Its conditions test cognito-identity-unauth:IdentityPoolArn.

What the source says

cognito-identity-unauth:IdentityPoolArn (read 10 Nov 2026).

On what it breaks: "ensuring only authenticated users can obtain credentials."

Sources

  1. Deny unauthenticated access to Cognito identity pools, read 10 Nov 2026
  2. What it breaks, read 10 Nov 2026
  3. How to test it first, read 10 Nov 2026

Last reviewed 16 Nov 2026.