Log Verified Access API calls using AWS CloudTrail - AWS Verified Access

Log Verified Access API calls using AWS CloudTrail

AWS Verified Access is integrated with AWS CloudTrail, a service that provides a record of actions taken by a user, role, or an AWS service in Verified Access. CloudTrail captures all API calls for Verified Access as events. The calls captured include calls from the Verified Access console and code calls to the Verified Access API operations. If you create a trail, you can enable continuous delivery of CloudTrail events to an Amazon S3 bucket, including events for Verified Access. If you don't configure a trail, you can still view the most recent events in the CloudTrail console in Event history. Using the information collected by CloudTrail, you can determine the request that was made to Verified Access, the IP address from which the request was made, who made the request, when it was made, and additional details.

To learn more about CloudTrail, see the AWS CloudTrail User Guide.

Verified Access information in CloudTrail

CloudTrail is enabled on your AWS account when you create the account. When activity occurs in Verified Access, 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 Verified Access, create a trail. A trail enables CloudTrail to deliver log files to an Amazon S3 bucket. By default, when you create a trail in the console, the trail applies to all AWS 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 the following:

All Verified Access actions are logged by CloudTrail and are documented in the Amazon EC2 API Reference. For example, calls to the CreateVerifiedAccessInstance, DeleteVerifiedAccessInstance and ModifyVerifiedAccessInstance actions generate entries in the 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 user or AWS Identity and Access Management (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 CloudTrail userIdentity element.

Understand Verified Access log file entries

A trail is a configuration that enables delivery of events as log files to an Amazon S3 bucket that you specify. CloudTrail log files contain one or more log entries. An event represents a single request from any source. It includes information about the requested action, the date and time of the action, request parameters, and so on. CloudTrail log files aren't an ordered stack trace of the public API calls, so they don't appear in any specific order.

The following example shows a CloudTrail log entry for the CreateVerifiedAccessInstance action.

{ "eventVersion": "1.08", "userIdentity": { "type": "IAMUser", "principalId": "AIDAIKK4OOINJWEXAMPLE:jdoe", "arn": "arn:aws:iam::123456789012:user/jdoe", "accountId": "123456789012", "accessKeyId": "AKIAIOSFODNN7EXAMPLE", "userName": "jdoe" }, "eventTime": "2022-11-18T20:44:04Z", "eventSource": "ec2.amazonaws.com", "eventName": "CreateVerifiedAccessInstance", "awsRegion": "us-west-2", "sourceIPAddress": "198.51.100.1", "userAgent": "console.amazonaws.com", "requestParameters": { "CreateVerifiedAccessInstanceRequest": { "Description": "", "ClientToken": "85893b1e-49f6-4d24-97de-280c664edf1b" } }, "responseElements": { "CreateVerifiedAccessInstanceResponse": { "verifiedAccessInstance": { "creationTime": "2022-11-18T20:44:04", "description": "", "verifiedAccessInstanceId": "vai-0d79d91875542c549", "verifiedAccessTrustProviderSet": "" }, "requestId": "2eae195d-6bfd-46d7-b46e-a68cb791de09" } }, "requestID": "2eae195d-6bfd-46d7-b46e-a68cb791de09", "eventID": "297d6529-1144-40f6-abf8-3a76f18d88f0", "readOnly": false, "eventType": "AwsApiCall", "managementEvent": true, "recipientAccountId": "123456789012", "eventCategory": "Management" }