

# Audit identity with simplified trusted identity propagation

For supported workloads, each action that Amazon EMR Serverless takes on the user's behalf is attributable to the individual user. Amazon EMR Serverless records the identity in its own AWS CloudTrail management events, such as `StartJobRun`, and downstream services record it in theirs.

## Identity in AWS CloudTrail
<a name="emr-serverless-tip-simplified-cloudtrail"></a>

CloudTrail records the role session that made the call in the `userIdentity` element, and identifies the workforce user in the `onBehalfOf` section. The recorded `onBehalfOf` fields depend on the path:
+ On the IAM Identity Center path, `onBehalfOf` records the Identity Center `userId`, the `identityStoreArn`, the `identityCenterInstanceArn`, the `subject`, the `subjectType`, which is `user`, and the `issuer`, which is the Identity Center instance ARN.
+ On the IAM federation path, `onBehalfOf` records the `subject`, the `subjectType`, which is `user`, the `issuer`, and the `federatedProviderArn`, which is the ARN of the IAM SAML or OIDC provider.

For the full list of fields, see [CloudTrail userIdentity element](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-event-reference-user-identity.html) in the *AWS CloudTrail User Guide*.

The following example shows the `userIdentity` element for a workload on the IAM Identity Center path.

```json
"userIdentity": {
  "type": "AssumedRole",
  "principalId": "AROAEXAMPLE:example-user-1",
  "arn": "arn:aws:sts::111122223333:assumed-role/DataAnalystRole/example-user-1",
  "accountId": "111122223333",
  "sessionContext": {
    "sessionIssuer": {
      "type": "Role",
      "principalId": "AROAEXAMPLE",
      "arn": "arn:aws:iam::111122223333:role/DataAnalystRole",
      "accountId": "111122223333",
      "userName": "DataAnalystRole"
    }
  },
  "onBehalfOf": {
    "userId": "544894e8-80c1-707f-60e3-3ba6510dfac1",
    "identityStoreArn": "arn:aws:identitystore::111122223333:identitystore/d-1234567890",
    "identityCenterInstanceArn": "arn:aws:sso:::instance/ssoins-1234567890abcdef",
    "subject": "example-user-1",
    "subjectType": "user",
    "issuer": "arn:aws:sso:::instance/ssoins-1234567890abcdef"
  }
}
```

The following example shows the `userIdentity` element for a workload on the IAM federation path.

```json
"userIdentity": {
  "type": "AssumedRole",
  "principalId": "AROAEXAMPLE:example-user-1",
  "arn": "arn:aws:sts::111122223333:assumed-role/DataAnalystRole/example-user-1",
  "accountId": "111122223333",
  "sessionContext": {
    "sessionIssuer": {
      "type": "Role",
      "principalId": "AROAEXAMPLE",
      "arn": "arn:aws:iam::111122223333:role/DataAnalystRole",
      "accountId": "111122223333",
      "userName": "DataAnalystRole"
    }
  },
  "onBehalfOf": {
    "subject": "example-user-1",
    "subjectType": "user",
    "issuer": "idp.example.com",
    "federatedProviderArn": "arn:aws:iam::111122223333:oidc-provider/idp.example.com"
  }
}
```

**Note**  
With simplified trusted identity propagation, identity propagation between services appears as standard `AssumeRole` events rather than the `CreateTokenWithIAM` and `IntrospectTokenWithIAM` token-exchange events that the earlier version used. If your security information and event management (SIEM) rules look for those token-exchange events, update them.

## Identity in system tables
<a name="emr-serverless-tip-simplified-system-tables"></a>

The propagated identity is also available in system tables on Amazon EMR Serverless releases 8.2 and higher. System tables require Amazon EMR release 8.2 and higher. On Amazon EMR Serverless releases 7.8 to 8.1, simplified trusted identity propagation works, but the identity fields are not queryable in system tables. For more information, see [Use Amazon EMR system tables](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-system-tables.html) in the *Amazon EMR Management Guide*.