2015/10/01 - AWS CloudTrail - 4 new4 updated api methods
Returns all public keys whose private keys were used to sign the digest files within the specified time range. The public key is needed to validate digest files that were signed with its corresponding private key.
Request Syntax
client.list_public_keys( StartTime=datetime(2015, 1, 1), EndTime=datetime(2015, 1, 1), NextToken='string' )
datetime
Optionally specifies, in UTC, the start of the time range to look up public keys for CloudTrail digest files. If not specified, the current time is used, and the current public key is returned.
datetime
Optionally specifies, in UTC, the end of the time range to look up public keys for CloudTrail digest files. If not specified, the current time is used.
string
Reserved for future use.
dict
Response Syntax
{ 'PublicKeyList': [ { 'Value': b'bytes', 'ValidityStartTime': datetime(2015, 1, 1), 'ValidityEndTime': datetime(2015, 1, 1), 'Fingerprint': 'string' }, ], 'NextToken': 'string' }
Response Structure
(dict) -- Returns the objects or data listed below if successful. Otherwise, returns an error.
PublicKeyList (list) --
Contains an array of PublicKey objects.
(dict) --
Contains information about a returned public key.
Value (bytes) --
The DER encoded public key value in PKCS#1 format.
ValidityStartTime (datetime) --
The starting time of validity of the public key.
ValidityEndTime (datetime) --
The ending time of validity of the public key.
Fingerprint (string) --
The fingerprint of the public key.
NextToken (string) --
Reserved for future use.
Removes the specified tags from a trail.
Request Syntax
client.remove_tags( ResourceId='string', TagsList=[ { 'Key': 'string', 'Value': 'string' }, ] )
string
[REQUIRED]
Specifies the ARN of the trail from which tags should be removed. The format of a trail ARN is arn:aws:cloudtrail:us-east-1:123456789012:trail/MyTrail.
list
Specifies a list of tags to be removed.
(dict) --
A custom key-value pair associated with a resource such as a CloudTrail trail.
Key (string) -- [REQUIRED]
The key in a key-value pair. The key must be must be no longer than 128 Unicode characters. The key must be unique for the resource to which it applies.
Value (string) --
The value in a key-value pair of a tag. The value must be no longer than 256 Unicode characters.
dict
Response Syntax
{}
Response Structure
(dict) --
Returns the objects or data listed below if successful. Otherwise, returns an error.
Adds one or more tags to a trail, up to a limit of 10. Tags must be unique per trail. Overwrites an existing tag's value when a new value is specified for an existing tag key. If you specify a key without a value, the tag will be created with the specified key and a value of null.
Request Syntax
client.add_tags( ResourceId='string', TagsList=[ { 'Key': 'string', 'Value': 'string' }, ] )
string
[REQUIRED]
Specifies the ARN of the trail to which one or more tags will be added. The format of a trail ARN is arn:aws:cloudtrail:us-east-1:123456789012:trail/MyTrail.
list
Contains a list of CloudTrail tags, up to a limit of 10.
(dict) --
A custom key-value pair associated with a resource such as a CloudTrail trail.
Key (string) -- [REQUIRED]
The key in a key-value pair. The key must be must be no longer than 128 Unicode characters. The key must be unique for the resource to which it applies.
Value (string) --
The value in a key-value pair of a tag. The value must be no longer than 256 Unicode characters.
dict
Response Syntax
{}
Response Structure
(dict) --
Returns the objects or data listed below if successful. Otherwise, returns an error.
Lists the tags for the trail in the current region.
Request Syntax
client.list_tags( ResourceIdList=[ 'string', ], NextToken='string' )
list
[REQUIRED]
Specifies a list of trail ARNs whose tags will be listed. The list has a limit of 20 ARNs. The format of a trail ARN is arn:aws:cloudtrail:us-east-1:123456789012:trail/MyTrail.
(string) --
string
Reserved for future use.
dict
Response Syntax
{ 'ResourceTagList': [ { 'ResourceId': 'string', 'TagsList': [ { 'Key': 'string', 'Value': 'string' }, ] }, ], 'NextToken': 'string' }
Response Structure
(dict) --
Returns the objects or data listed below if successful. Otherwise, returns an error.
ResourceTagList (list) --
A list of resource tags.
(dict) --
A resource tag.
ResourceId (string) --
Specifies the ARN of the resource.
TagsList (list) --
A list of tags.
(dict) --
A custom key-value pair associated with a resource such as a CloudTrail trail.
Key (string) --
The key in a key-value pair. The key must be must be no longer than 128 Unicode characters. The key must be unique for the resource to which it applies.
Value (string) --
The value in a key-value pair of a tag. The value must be no longer than 256 Unicode characters.
NextToken (string) --
Reserved for future use.
{'EnableLogFileValidation': 'boolean', 'KmsKeyId': 'string'}Response
{'KmsKeyId': 'string', 'LogFileValidationEnabled': 'boolean', 'TrailARN': 'string'}
Creates a trail that specifies the settings for delivery of log data to an Amazon S3 bucket.
Request Syntax
client.create_trail( Name='string', S3BucketName='string', S3KeyPrefix='string', SnsTopicName='string', IncludeGlobalServiceEvents=True|False, EnableLogFileValidation=True|False, CloudWatchLogsLogGroupArn='string', CloudWatchLogsRoleArn='string', KmsKeyId='string' )
string
[REQUIRED]
Specifies the name of the trail. The name must meet the following requirements:
Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)
Start with a letter or number, and end with a letter or number
Be between 3 and 128 characters
Have no adjacent periods, underscores or dashes. Names like my-_namespace and my--namespace are invalid.
Not be in IP address format (for example, 192.168.5.4)
string
[REQUIRED]
Specifies the name of the Amazon S3 bucket designated for publishing log files. See Amazon S3 Bucket Naming Requirements.
string
Specifies the Amazon S3 key prefix that comes after the name of the bucket you have designated for log file delivery. For more information, see Finding Your CloudTrail Log Files. The maximum length is 200 characters.
string
Specifies the name of the Amazon SNS topic defined for notification of log file delivery. The maximum length is 256 characters.
boolean
Specifies whether the trail is publishing events from global services such as IAM to the log files.
boolean
Specifies whether log file integrity validation is enabled. The default is false.
string
Specifies a log group name using an Amazon Resource Name (ARN), a unique identifier that represents the log group to which CloudTrail logs will be delivered. Not required unless you specify CloudWatchLogsRoleArn.
string
Specifies the role for the CloudWatch Logs endpoint to assume to write to a user's log group.
string
Specifies the KMS key ID to use to encrypt the logs delivered by CloudTrail. The value can be a an alias name prefixed by "alias/", a fully specified ARN to an alias, a fully specified ARN to a key, or a globally unique identifier.
Examples:
alias/MyAliasName
arn:aws:kms:us-east-1:123456789012:alias/MyAliasName
arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012
12345678-1234-1234-1234-123456789012
dict
Response Syntax
{ 'Name': 'string', 'S3BucketName': 'string', 'S3KeyPrefix': 'string', 'SnsTopicName': 'string', 'IncludeGlobalServiceEvents': True|False, 'TrailARN': 'string', 'LogFileValidationEnabled': True|False, 'CloudWatchLogsLogGroupArn': 'string', 'CloudWatchLogsRoleArn': 'string', 'KmsKeyId': 'string' }
Response Structure
(dict) -- Returns the objects or data listed below if successful. Otherwise, returns an error.
Name (string) --
Specifies the name of the trail.
S3BucketName (string) --
Specifies the name of the Amazon S3 bucket designated for publishing log files.
S3KeyPrefix (string) --
Specifies the Amazon S3 key prefix that comes after the name of the bucket you have designated for log file delivery. For more information, see Finding Your CloudTrail Log Files.
SnsTopicName (string) --
Specifies the name of the Amazon SNS topic defined for notification of log file delivery.
IncludeGlobalServiceEvents (boolean) --
Specifies whether the trail is publishing events from global services such as IAM to the log files.
TrailARN (string) --
Specifies the ARN of the trail that was created.
LogFileValidationEnabled (boolean) --
Specifies whether log file integrity validation is enabled.
CloudWatchLogsLogGroupArn (string) --
Specifies the Amazon Resource Name (ARN) of the log group to which CloudTrail logs will be delivered.
CloudWatchLogsRoleArn (string) --
Specifies the role for the CloudWatch Logs endpoint to assume to write to a user's log group.
KmsKeyId (string) --
Specifies the KMS key ID that encrypts the logs delivered by CloudTrail. The value is a fully specified ARN to a KMS key in the format:
arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012
{'trailList': {'KmsKeyId': 'string', 'LogFileValidationEnabled': 'boolean', 'TrailARN': 'string'}}
Retrieves settings for the trail associated with the current region for your account.
Request Syntax
client.describe_trails( trailNameList=[ 'string', ] )
list
Specifies a list of trail names, trail ARNs, or both, of the trails to describe. The format of a trail ARN is arn:aws:cloudtrail:us-east-1:123456789012:trail/MyTrail. If an empty list is specified, information for the trail in the current region is returned.
(string) --
dict
Response Syntax
{ 'trailList': [ { 'Name': 'string', 'S3BucketName': 'string', 'S3KeyPrefix': 'string', 'SnsTopicName': 'string', 'IncludeGlobalServiceEvents': True|False, 'TrailARN': 'string', 'LogFileValidationEnabled': True|False, 'CloudWatchLogsLogGroupArn': 'string', 'CloudWatchLogsRoleArn': 'string', 'KmsKeyId': 'string' }, ] }
Response Structure
(dict) --
Returns the objects or data listed below if successful. Otherwise, returns an error.
trailList (list) --
The list of trail objects.
(dict) --
The settings for a trail.
Name (string) --
Name of the trail set by calling CreateTrail. The maximum length is 128 characters.
S3BucketName (string) --
Name of the Amazon S3 bucket into which CloudTrail delivers your trail files. See Amazon S3 Bucket Naming Requirements.
S3KeyPrefix (string) --
Specifies the Amazon S3 key prefix that comes after the name of the bucket you have designated for log file delivery. For more information, see Finding Your CloudTrail Log Files.The maximum length is 200 characters.
SnsTopicName (string) --
Name of the existing Amazon SNS topic that CloudTrail uses to notify the account owner when new CloudTrail log files have been delivered. The maximum length is 256 characters.
IncludeGlobalServiceEvents (boolean) --
Set to True to include AWS API calls from AWS global services such as IAM. Otherwise, False.
TrailARN (string) --
The Amazon Resource Name of the trail. The TrailARN format is arn:aws:cloudtrail:us-east-1:123456789012:trail/MyTrail.
LogFileValidationEnabled (boolean) --
Specifies whether log file validation is enabled.
CloudWatchLogsLogGroupArn (string) --
Specifies an Amazon Resource Name (ARN), a unique identifier that represents the log group to which CloudTrail logs will be delivered.
CloudWatchLogsRoleArn (string) --
Specifies the role for the CloudWatch Logs endpoint to assume to write to a user's log group.
KmsKeyId (string) --
Specifies the KMS key ID that encrypts the logs delivered by CloudTrail. The value is a fully specified ARN to a KMS key in the format:
arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012
{'LatestDeliveryAttemptSucceeded': 'string', 'LatestDeliveryAttemptTime': 'string', 'LatestDigestDeliveryError': 'string', 'LatestDigestDeliveryTime': 'timestamp', 'LatestNotificationAttemptSucceeded': 'string', 'LatestNotificationAttemptTime': 'string', 'TimeLoggingStarted': 'string', 'TimeLoggingStopped': 'string'}
Returns a JSON-formatted list of information about the specified trail. Fields include information on delivery errors, Amazon SNS and Amazon S3 errors, and start and stop logging times for each trail. This operation returns trail status from a single region. To return trail status from all regions, you must call the operation on each region.
Request Syntax
client.get_trail_status( Name='string' )
string
[REQUIRED]
Specifies the name or the CloudTrail ARN of the trail for which you are requesting status. The format of a trail ARN is arn:aws:cloudtrail:us-east-1:123456789012:trail/MyTrail.
dict
Response Syntax
{ 'IsLogging': True|False, 'LatestDeliveryError': 'string', 'LatestNotificationError': 'string', 'LatestDeliveryTime': datetime(2015, 1, 1), 'LatestNotificationTime': datetime(2015, 1, 1), 'StartLoggingTime': datetime(2015, 1, 1), 'StopLoggingTime': datetime(2015, 1, 1), 'LatestCloudWatchLogsDeliveryError': 'string', 'LatestCloudWatchLogsDeliveryTime': datetime(2015, 1, 1), 'LatestDigestDeliveryTime': datetime(2015, 1, 1), 'LatestDigestDeliveryError': 'string', 'LatestDeliveryAttemptTime': 'string', 'LatestNotificationAttemptTime': 'string', 'LatestNotificationAttemptSucceeded': 'string', 'LatestDeliveryAttemptSucceeded': 'string', 'TimeLoggingStarted': 'string', 'TimeLoggingStopped': 'string' }
Response Structure
(dict) --
Returns the objects or data listed below if successful. Otherwise, returns an error.
IsLogging (boolean) --
Whether the CloudTrail is currently logging AWS API calls.
LatestDeliveryError (string) --
Displays any Amazon S3 error that CloudTrail encountered when attempting to deliver log files to the designated bucket. For more information see the topic Error Responses in the Amazon S3 API Reference.
LatestNotificationError (string) --
Displays any Amazon SNS error that CloudTrail encountered when attempting to send a notification. For more information about Amazon SNS errors, see the Amazon SNS Developer Guide.
LatestDeliveryTime (datetime) --
Specifies the date and time that CloudTrail last delivered log files to an account's Amazon S3 bucket.
LatestNotificationTime (datetime) --
Specifies the date and time of the most recent Amazon SNS notification that CloudTrail has written a new log file to an account's Amazon S3 bucket.
StartLoggingTime (datetime) --
Specifies the most recent date and time when CloudTrail started recording API calls for an AWS account.
StopLoggingTime (datetime) --
Specifies the most recent date and time when CloudTrail stopped recording API calls for an AWS account.
LatestCloudWatchLogsDeliveryError (string) --
Displays any CloudWatch Logs error that CloudTrail encountered when attempting to deliver logs to CloudWatch Logs.
LatestCloudWatchLogsDeliveryTime (datetime) --
Displays the most recent date and time when CloudTrail delivered logs to CloudWatch Logs.
LatestDigestDeliveryTime (datetime) --
Specifies the date and time that CloudTrail last delivered a digest file to an account's Amazon S3 bucket.
LatestDigestDeliveryError (string) --
Displays any Amazon S3 error that CloudTrail encountered when attempting to deliver a digest file to the designated bucket. For more information see the topic Error Responses in the Amazon S3 API Reference.
LatestDeliveryAttemptTime (string) --
This field is deprecated.
LatestNotificationAttemptTime (string) --
This field is deprecated.
LatestNotificationAttemptSucceeded (string) --
This field is deprecated.
LatestDeliveryAttemptSucceeded (string) --
This field is deprecated.
TimeLoggingStarted (string) --
This field is deprecated.
TimeLoggingStopped (string) --
This field is deprecated.
{'EnableLogFileValidation': 'boolean', 'KmsKeyId': 'string'}Response
{'KmsKeyId': 'string', 'LogFileValidationEnabled': 'boolean', 'TrailARN': 'string'}
Updates the settings that specify delivery of log files. Changes to a trail do not require stopping the CloudTrail service. Use this action to designate an existing bucket for log delivery. If the existing bucket has previously been a target for CloudTrail log files, an IAM policy exists for the bucket.
Request Syntax
client.update_trail( Name='string', S3BucketName='string', S3KeyPrefix='string', SnsTopicName='string', IncludeGlobalServiceEvents=True|False, EnableLogFileValidation=True|False, CloudWatchLogsLogGroupArn='string', CloudWatchLogsRoleArn='string', KmsKeyId='string' )
string
[REQUIRED]
Specifies the name of the trail or trail ARN. If Name is a trail name, the string must meet the following requirements:
Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)
Start with a letter or number, and end with a letter or number
Be between 3 and 128 characters
Have no adjacent periods, underscores or dashes. Names like my-_namespace and my--namespace are invalid.
Not be in IP address format (for example, 192.168.5.4)
If Name is a trail ARN, it must be in the format arn:aws:cloudtrail:us-east-1:123456789012:trail/MyTrail.
string
Specifies the name of the Amazon S3 bucket designated for publishing log files. See Amazon S3 Bucket Naming Requirements.
string
Specifies the Amazon S3 key prefix that comes after the name of the bucket you have designated for log file delivery. For more information, see Finding Your CloudTrail Log Files. The maximum length is 200 characters.
string
Specifies the name of the Amazon SNS topic defined for notification of log file delivery. The maximum length is 256 characters.
boolean
Specifies whether the trail is publishing events from global services such as IAM to the log files.
boolean
Specifies whether log file validation is enabled. The default is false.
string
Specifies a log group name using an Amazon Resource Name (ARN), a unique identifier that represents the log group to which CloudTrail logs will be delivered. Not required unless you specify CloudWatchLogsRoleArn.
string
Specifies the role for the CloudWatch Logs endpoint to assume to write to a user's log group.
string
Specifies the KMS key ID to use to encrypt the logs delivered by CloudTrail. The value can be a an alias name prefixed by "alias/", a fully specified ARN to an alias, a fully specified ARN to a key, or a globally unique identifier.
Examples:
alias/MyAliasName
arn:aws:kms:us-east-1:123456789012:alias/MyAliasName
arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012
12345678-1234-1234-1234-123456789012
dict
Response Syntax
{ 'Name': 'string', 'S3BucketName': 'string', 'S3KeyPrefix': 'string', 'SnsTopicName': 'string', 'IncludeGlobalServiceEvents': True|False, 'TrailARN': 'string', 'LogFileValidationEnabled': True|False, 'CloudWatchLogsLogGroupArn': 'string', 'CloudWatchLogsRoleArn': 'string', 'KmsKeyId': 'string' }
Response Structure
(dict) -- Returns the objects or data listed below if successful. Otherwise, returns an error.
Name (string) --
Specifies the name of the trail.
S3BucketName (string) --
Specifies the name of the Amazon S3 bucket designated for publishing log files.
S3KeyPrefix (string) --
Specifies the Amazon S3 key prefix that comes after the name of the bucket you have designated for log file delivery. For more information, see Finding Your CloudTrail Log Files.
SnsTopicName (string) --
Specifies the name of the Amazon SNS topic defined for notification of log file delivery.
IncludeGlobalServiceEvents (boolean) --
Specifies whether the trail is publishing events from global services such as IAM to the log files.
TrailARN (string) --
Specifies the ARN of the trail that was updated.
LogFileValidationEnabled (boolean) --
Specifies whether log file integrity validation is enabled.
CloudWatchLogsLogGroupArn (string) --
Specifies the Amazon Resource Name (ARN) of the log group to which CloudTrail logs will be delivered.
CloudWatchLogsRoleArn (string) --
Specifies the role for the CloudWatch Logs endpoint to assume to write to a user's log group.
KmsKeyId (string) --
Specifies the KMS key ID that encrypts the logs delivered by CloudTrail. The value is a fully specified ARN to a KMS key in the format:
arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012