Amazon WorkDocs
Administration Guide

Logging Amazon WorkDocs API Calls Using AWS CloudTrail

Amazon WorkDocs is integrated with CloudTrail, a service that captures API calls made by or on behalf of Amazon WorkDocs in your AWS account and delivers the log files to an Amazon S3 bucket that you specify. CloudTrail captures API calls from the Amazon WorkDocs console. Using the information collected by CloudTrail, you can determine what request was made to Amazon WorkDocs, the source IP address from which the request was made, who made the request, when it was made, and so on. For more information about CloudTrail, including how to configure and enable it, see the AWS CloudTrail User Guide.

Amazon WorkDocs Information in CloudTrail

When CloudTrail logging is enabled in your AWS account, API calls made to Amazon WorkDocs actions are tracked in log files. Amazon WorkDocs records are written together with other AWS service records in a log file. CloudTrail determines when to create and write to a new file based on a time period and file size.

Every log entry contains information about who generated the request. The user identity information in the log helps you determine whether the request was made with root or IAM user credentials, with temporary security credentials for a role or federated user, or by another AWS service. For more information, see the userIdentity field in the CloudTrail Event Reference.

You can store your log files in your bucket for as long as you want, but you can also define Amazon S3 lifecycle rules to archive or delete log files automatically. By default, your log files are encrypted by using Amazon S3 server-side encryption (SSE).

You can choose to have CloudTrail publish Amazon SNS notifications when new log files are delivered if you want to take quick action upon log file delivery. For more information, see Configuring Amazon SNS Notifications.

You can also aggregate Amazon WorkDocs log files from multiple AWS regions and multiple AWS accounts into a single Amazon S3 bucket. For more information, see Aggregating CloudTrail Log Files to a Single Amazon S3 Bucket.

Understanding Amazon WorkDocs Log File Entries

CloudTrail log files can contain one or more log entries where each entry is made up of multiple JSON-formatted events. A log entry represents a single request from any source and includes information about the requested action, any parameters, the date and time of the action, and so on. The log entries are not guaranteed to be in any particular order. That is, they are not an ordered stack trace of the public API calls.

There are two different types of CloudTrail entries that Amazon WorkDocs generates, those from the control plane and those from the data plane. The important difference between the two is that the user identity for control plane entries is an IAM user, while the user identity for data plane entries is the Amazon WorkDocs directory user.

Sensitive information, such as passwords, authentication tokens, file comments, and file contents are redacted in the log entries.

The following example shows two CloudTrail log entries for Amazon WorkDocs: the first record is for a control plane action and the second is for a data plane action.

{ Records : [ { "eventVersion" : "1.01", "userIdentity" : { "type" : "IAMUser", "principalId" : "user_id", "arn" : "user_arn", "accountId" : "account_id", "accessKeyId" : "access_key_id", "userName" : "user_name" }, "eventTime" : "event_time", "eventSource" : "", "eventName" : "RemoveUserFromGroup", "awsRegion" : "region", "sourceIPAddress" : "ip_address", "userAgent" : "user_agent", "requestParameters" : { "directoryId" : "directory_id", "userSid" : "user_sid", "group" : "group" }, "responseElements" : null, "requestID" : "request_id", "eventID" : "event_id" }, { "eventVersion" : "1.01", "userIdentity" : { "type" : "Unknown", "principalId" : "user_id", "accountId" : "account_id", "userName" : "user_name" }, "eventTime" : "event_time", "eventSource" : "", "eventName" : "LogoutUser", "awsRegion" : "region", "sourceIPAddress" : "ip_address", "userAgent" : "user_agent", "requestParameters" : { "AuthenticationToken" : "**-redacted-**" }, "responseElements" : null, "requestID" : "request_id", "eventID" : "event_id" } ] }