Macie2.Client.
get_bucket_statistics
(**kwargs)¶Retrieves (queries) aggregated statistical data about all the S3 buckets that Amazon Macie monitors and analyzes for an account.
See also: AWS API Documentation
Request Syntax
response = client.get_bucket_statistics(
accountId='string'
)
{
'bucketCount': 123,
'bucketCountByEffectivePermission': {
'publiclyAccessible': 123,
'publiclyReadable': 123,
'publiclyWritable': 123,
'unknown': 123
},
'bucketCountByEncryptionType': {
'kmsManaged': 123,
's3Managed': 123,
'unencrypted': 123,
'unknown': 123
},
'bucketCountByObjectEncryptionRequirement': {
'allowsUnencryptedObjectUploads': 123,
'deniesUnencryptedObjectUploads': 123,
'unknown': 123
},
'bucketCountBySharedAccessType': {
'external': 123,
'internal': 123,
'notShared': 123,
'unknown': 123
},
'bucketStatisticsBySensitivity': {
'classificationError': {
'classifiableSizeInBytes': 123,
'publiclyAccessibleCount': 123,
'totalCount': 123,
'totalSizeInBytes': 123
},
'notClassified': {
'classifiableSizeInBytes': 123,
'publiclyAccessibleCount': 123,
'totalCount': 123,
'totalSizeInBytes': 123
},
'notSensitive': {
'classifiableSizeInBytes': 123,
'publiclyAccessibleCount': 123,
'totalCount': 123,
'totalSizeInBytes': 123
},
'sensitive': {
'classifiableSizeInBytes': 123,
'publiclyAccessibleCount': 123,
'totalCount': 123,
'totalSizeInBytes': 123
}
},
'classifiableObjectCount': 123,
'classifiableSizeInBytes': 123,
'lastUpdated': datetime(2015, 1, 1),
'objectCount': 123,
'sizeInBytes': 123,
'sizeInBytesCompressed': 123,
'unclassifiableObjectCount': {
'fileType': 123,
'storageClass': 123,
'total': 123
},
'unclassifiableObjectSizeInBytes': {
'fileType': 123,
'storageClass': 123,
'total': 123
}
}
Response Structure
The request succeeded.
The total number of buckets.
The total number of buckets that are publicly accessible due to a combination of permissions settings for each bucket.
The total number of buckets that allow the general public to have read or write access to the bucket.
The total number of buckets that allow the general public to have read access to the bucket.
The total number of buckets that allow the general public to have write access to the bucket.
The total number of buckets that Amazon Macie wasn't able to evaluate permissions settings for. Macie can't determine whether these buckets are publicly accessible.
The total number of buckets whose settings do or don't specify default server-side encryption behavior for objects that are added to the buckets.
The total number of buckets whose default encryption settings are configured to encrypt new objects with an Amazon Web Services managed KMS key or a customer managed KMS key. By default, these buckets encrypt new objects automatically using SSE-KMS encryption.
The total number of buckets whose default encryption settings are configured to encrypt new objects with an Amazon S3 managed key. By default, these buckets encrypt new objects automatically using SSE-S3 encryption.
The total number of buckets that don't specify default server-side encryption behavior for new objects. Default encryption settings aren't configured for these buckets.
The total number of buckets that Amazon Macie doesn't have current encryption metadata for. Macie can't provide current data about the default encryption settings for these buckets.
The total number of buckets whose bucket policies do or don't require server-side encryption of objects when objects are added to the buckets.
The total number of buckets that don't have a bucket policy or have a bucket policy that doesn't require server-side encryption of new objects. If a bucket policy exists, the policy doesn't require PutObject requests to include a valid server-side encryption header: the x-amz-server-side-encryption header with a value of AES256 or aws:kms, or the x-amz-server-side-encryption-customer-algorithm header with a value of AES256.
The total number of buckets whose bucket policies require server-side encryption of new objects. PutObject requests for these buckets must include a valid server-side encryption header: the x-amz-server-side-encryption header with a value of AES256 or aws:kms, or the x-amz-server-side-encryption-customer-algorithm header with a value of AES256.
The total number of buckets that Amazon Macie wasn't able to evaluate server-side encryption requirements for. Macie can't determine whether the bucket policies for these buckets require server-side encryption of new objects.
The total number of buckets that are or aren't shared with other Amazon Web Services accounts, Amazon CloudFront origin access identities (OAIs), or CloudFront origin access controls (OACs).
The total number of buckets that are shared with one or more of the following or any combination of the following: an Amazon CloudFront OAI, a CloudFront OAC, or an Amazon Web Services account that isn't in the same Amazon Macie organization.
The total number of buckets that are shared with one or more Amazon Web Services accounts in the same Amazon Macie organization. These buckets aren't shared with Amazon CloudFront OAIs or OACs.
The total number of buckets that aren't shared with other Amazon Web Services accounts, Amazon CloudFront OAIs, or CloudFront OACs.
The total number of buckets that Amazon Macie wasn't able to evaluate shared access settings for. Macie can't determine whether these buckets are shared with other Amazon Web Services accounts, Amazon CloudFront OAIs, or CloudFront OACs.
The aggregated sensitive data discovery statistics for the buckets. If automated sensitive data discovery is currently disabled for your account, the value for each statistic is 0.
The aggregated statistical data for all buckets that have a sensitivity score of -1.
The total storage size, in bytes, of all the objects that Amazon Macie can analyze in the buckets. These objects use a supported storage class and have a file name extension for a supported file or storage format.
If versioning is enabled for any of the buckets, this value is based on the size of the latest version of each applicable object in the buckets. This value doesn't reflect the storage size of all versions of all applicable objects in the buckets.
The total number of buckets that are publicly accessible due to a combination of permissions settings for each bucket.
The total number of buckets.
The total storage size, in bytes, of the buckets.
If versioning is enabled for any of the buckets, this value is based on the size of the latest version of each object in the buckets. This value doesn't reflect the storage size of all versions of the objects in the buckets.
The aggregated statistical data for all buckets that have a sensitivity score of 50.
The total storage size, in bytes, of all the objects that Amazon Macie can analyze in the buckets. These objects use a supported storage class and have a file name extension for a supported file or storage format.
If versioning is enabled for any of the buckets, this value is based on the size of the latest version of each applicable object in the buckets. This value doesn't reflect the storage size of all versions of all applicable objects in the buckets.
The total number of buckets that are publicly accessible due to a combination of permissions settings for each bucket.
The total number of buckets.
The total storage size, in bytes, of the buckets.
If versioning is enabled for any of the buckets, this value is based on the size of the latest version of each object in the buckets. This value doesn't reflect the storage size of all versions of the objects in the buckets.
The aggregated statistical data for all buckets that have a sensitivity score of 1-49.
The total storage size, in bytes, of all the objects that Amazon Macie can analyze in the buckets. These objects use a supported storage class and have a file name extension for a supported file or storage format.
If versioning is enabled for any of the buckets, this value is based on the size of the latest version of each applicable object in the buckets. This value doesn't reflect the storage size of all versions of all applicable objects in the buckets.
The total number of buckets that are publicly accessible due to a combination of permissions settings for each bucket.
The total number of buckets.
The total storage size, in bytes, of the buckets.
If versioning is enabled for any of the buckets, this value is based on the size of the latest version of each object in the buckets. This value doesn't reflect the storage size of all versions of the objects in the buckets.
The aggregated statistical data for all buckets that have a sensitivity score of 51-100.
The total storage size, in bytes, of all the objects that Amazon Macie can analyze in the buckets. These objects use a supported storage class and have a file name extension for a supported file or storage format.
If versioning is enabled for any of the buckets, this value is based on the size of the latest version of each applicable object in the buckets. This value doesn't reflect the storage size of all versions of all applicable objects in the buckets.
The total number of buckets that are publicly accessible due to a combination of permissions settings for each bucket.
The total number of buckets.
The total storage size, in bytes, of the buckets.
If versioning is enabled for any of the buckets, this value is based on the size of the latest version of each object in the buckets. This value doesn't reflect the storage size of all versions of the objects in the buckets.
The total number of objects that Amazon Macie can analyze in the buckets. These objects use a supported storage class and have a file name extension for a supported file or storage format.
The total storage size, in bytes, of all the objects that Amazon Macie can analyze in the buckets. These objects use a supported storage class and have a file name extension for a supported file or storage format.
If versioning is enabled for any of the buckets, this value is based on the size of the latest version of each applicable object in the buckets. This value doesn't reflect the storage size of all versions of all applicable objects in the buckets.
The date and time, in UTC and extended ISO 8601 format, when Amazon Macie most recently retrieved bucket or object metadata from Amazon S3 for the buckets.
The total number of objects in the buckets.
The total storage size, in bytes, of the buckets.
If versioning is enabled for any of the buckets, this value is based on the size of the latest version of each object in the buckets. This value doesn't reflect the storage size of all versions of the objects in the buckets.
The total storage size, in bytes, of the objects that are compressed (.gz, .gzip, .zip) files in the buckets.
If versioning is enabled for any of the buckets, this value is based on the size of the latest version of each applicable object in the buckets. This value doesn't reflect the storage size of all versions of the applicable objects in the buckets.
The total number of objects that Amazon Macie can't analyze in the buckets. These objects don't use a supported storage class or don't have a file name extension for a supported file or storage format.
The total storage size (in bytes) or number of objects that Amazon Macie can't analyze because the objects don't have a file name extension for a supported file or storage format.
The total storage size (in bytes) or number of objects that Amazon Macie can't analyze because the objects use an unsupported storage class.
The total storage size (in bytes) or number of objects that Amazon Macie can't analyze because the objects use an unsupported storage class or don't have a file name extension for a supported file or storage format.
The total storage size, in bytes, of the objects that Amazon Macie can't analyze in the buckets. These objects don't use a supported storage class or don't have a file name extension for a supported file or storage format.
The total storage size (in bytes) or number of objects that Amazon Macie can't analyze because the objects don't have a file name extension for a supported file or storage format.
The total storage size (in bytes) or number of objects that Amazon Macie can't analyze because the objects use an unsupported storage class.
The total storage size (in bytes) or number of objects that Amazon Macie can't analyze because the objects use an unsupported storage class or don't have a file name extension for a supported file or storage format.
Exceptions
Macie2.Client.exceptions.ValidationException
Macie2.Client.exceptions.InternalServerException
Macie2.Client.exceptions.ServiceQuotaExceededException
Macie2.Client.exceptions.AccessDeniedException
Macie2.Client.exceptions.ResourceNotFoundException
Macie2.Client.exceptions.ThrottlingException
Macie2.Client.exceptions.ConflictException