Amazon Cognito information in CloudTrail - Amazon Cognito

Amazon Cognito information in CloudTrail

CloudTrail is turned on in your AWS account when you create the account. When supported event activity occurs in Amazon Cognito, that activity is recorded in a CloudTrail event along with other AWS service events in Event history. You can view, search, and download recent events in your AWS account. For more information, see Viewing events with CloudTrail event history.

For an ongoing record of events in your AWS account, including events for Amazon Cognito, create a trail. A CloudTrail trail delivers log files to an Amazon S3 bucket. By default, when you create a trail in the console, the trail applies to all Regions. The trail logs events from all Regions in the AWS partition and delivers the log files to the Amazon S3 bucket that you specify. Additionally, you can configure other AWS services to further analyze and act upon the event data collected in CloudTrail logs. For more information, see:

Amazon Cognito User Pools

Amazon Cognito supports logging for all of the actions listed on the User pool actions page as events in CloudTrail log files. Amazon Cognito also logs the following request types to your hosted UI as events in CloudTrail.

Hosted UI operations in Cloudtrail
Operation Description
Login_GET, CognitoAuthentication A user views or submits credentials to your Login endpoint.
OAuth2_Authorize_GET A user views your Authorize endpoint.
OAuth2Response_GET, OAuth2Response_POST A user submits an IdP token to your /oauth2/idpresponse endpoint.
SAML2Response_POST A user submits an IdP SAML assertion to your /saml2/idpresponse endpoint.
Login_OIDC_SAML_POST A user enters a username at your Login endpoint and matches with an IdP identifier.
Token_POST A user submits an authorization code to your Token endpoint.
Signup_GET, Signup_POST A user submits sign-up information to your /signup endpoint.
Confirm_GET, Confirm_POST A user submits a confirmation code in the hosted UI.
ResendCode_POST A user submits a request to resend a confirmation code in the hosted UI.
ForgotPassword_GET, ForgotPassword_POST A user submits a request to reset their password to your /forgotPassword endpoint.
ConfirmForgotPassword_GET, ConfirmForgotPassword_POST A user submits a code to your /confirmForgotPassword endpoint that confirms their ForgotPassword request.
ResetPassword_GET, ResetPassword_POST A user submits a new password in the hosted UI.
Mfa_GET, Mfa_POST A user submits a multi-factor authentication (MFA) code in the hosted UI.
MfaOption_GET, MfaOption_POST A user chooses their preferred method for MFA in the hosted UI.
Logout A user signs out at your /logout endpoint.
SAML2Logout_POST A user signs out at your /saml2/logout endpoint.
Error_GET A user views an error page in the hosted UI.
UserInfo_GET, UserInfo_POST A user or IdP exchanges information with your UserInfo endpoint.
Confirm_With_Link_GET A user submits a confirmation based on a link that Amazon Cognito sent in an email message.
Event_Feedback_GET A user submits feedback to Amazon Cognito about an advanced security features event.
Note

Amazon Cognito records UserSub but not UserName in CloudTrail logs for requests that are specific to a user. You can find a user for a given UserSub by calling the ListUsers API, and using a filter for sub.

Amazon Cognito Federated Identities

Amazon Cognito Sync

Amazon Cognito supports logging for all of the actions listed on the Amazon Cognito Sync actions page as events in CloudTrail log files.

Every event or log entry contains information about who generated the request. The identity information helps you determine the following:

  • Whether the request was made with root or IAM user credentials.

  • Whether the request was made with temporary security credentials for a role or federated user.

  • Whether the request was made by another AWS service.

For more information, see the CloudTrail userIdentity element.