Identity propagation with Athena workgroups
In Amazon Athena, when a caller's credentials carry an identity context, an IAM workgroup that runs Athena SQL uses it to propagate the caller's identity to downstream Amazon services. You don't change a workgroup setting or the client to use this.
Athena supports identity propagation for IAM workgroups in Amazon Commercial Regions, China Regions, and Amazon GovCloud (US) Region.
About the identity context
An identity context is information bound to the caller's Amazon credentials that identifies the user from their identity source, so that Amazon services can authorize and log the request on the user rather than only on the IAM role.
An IAM workgroup can carry an identity context from either of the following sources:
-
Trusted identity propagation with IAM Identity Center – The context identifies the IAM Identity Center user and their groups, carried in identity-enhanced credentials from EMR Studio, SageMaker Unified Studio, or the Athena JDBC and ODBC drivers. For an overview, see Trusted identity propagation overview in the Amazon IAM Identity Center User Guide.
-
Trusted identity propagation with IAM federation – In IAM federation, when a user or workload federates through your OpenID Connect (OIDC) or SAML identity provider, IAM attaches the identity context to the federated role session from the claims you map, and the caller can't change it for the session. The context carries condition keys that identify the user, such as
aws:OriginIdentity/Subject, and optional identity provider claims underaws:TransactionContext/IdentityProvider/; you can use these keys in IAM policies, and Amazon CloudTrail can record them for services that support it. For more information, see Trusted identity propagation for IAM federation in the IAM User Guide.
Downstream Amazon services use the identity context to authorize and log requests on the user rather than only on the IAM role. For either source, the context is available as condition keys in IAM policies, and Amazon CloudTrail can record the user identity for services that support it. When the identity context comes from IAM Identity Center, Lake Formation can also grant access directly to IAM Identity Center users and groups.
For more information about each identity source, see Trusted identity propagation overview and IAM Identity Center information in CloudTrail in the Amazon IAM Identity Center User Guide for IAM Identity Center, and Trusted identity propagation for IAM federation and Amazon services that support TIP in the IAM User Guide for IAM federation.
How Athena IAM workgroups use the identity context
When a user runs a query in an IAM workgroup, the identity flows through Athena as follows:
-
A client or driver sends the user's credentials, which carry the identity context (identity-enhanced credentials from IAM Identity Center, or federated session credentials from IAM federation), to Athena.
-
Athena authorizes the query on the caller's IAM role permissions and runs it in the IAM workgroup.
-
For the downstream access that the query needs, Athena uses the caller's forward access session (FAS) credentials to reach Amazon S3 (data reads and query-result writes), the Amazon Glue Data Catalog, and Lake Formation. The workgroup-level option to store query results in identity-based Amazon S3 locations governed by Amazon S3 Access Grants applies to IAM Identity Center enabled workgroups.
-
When the identity context comes from IAM Identity Center, Lake Formation can authorize access based on the IAM Identity Center user or group. This requires Lake Formation to be set up for IAM Identity Center identities; see Integrating IAM Identity Center in the Amazon Lake Formation Developer Guide.
Identity propagation applies to Athena SQL workgroups. Athena for Spark workgroups don't accept propagated identities.
With IAM workgroups, you can use identities from an IAM Identity Center instance regardless of whether you turn on the simplified experience for trusted identity propagation.
Athena also offers IAM Identity Center enabled workgroups, which accept IAM Identity Center users only and use an application-based setup. For more information, see Use IAM Identity Center enabled Athena workgroups.