Amazon S3 bucket inventory

Track object-storage ownership and data purpose.

Description

This entry lists a bucket declared with AWS::S3::Bucket.

Potential impact

An untracked bucket may retain data and incur costs beyond its intended lifetime.

Remediation

Record the owner and purpose. Review Block Public Access, bucket policies, retention, versioning and the encryption key.

Examples

Use an available unique bucket name. Both examples encrypt new objects. The second enables versioning and SSE-KMS. Existing objects keep their current encryption.

Before

yaml
Resources:
  MyBucket:
    Type: AWS::S3::Bucket
    Properties:
      BucketName: jenkins-artifacts

After

yaml
Resources:
  MyBucket:
    Type: AWS::S3::Bucket
    Properties:
      BucketName: jenkins-artifacts
      VersioningConfiguration:
        Status: Enabled
      BucketEncryption:
        ServerSideEncryptionConfiguration:
          - ServerSideEncryptionByDefault:
              SSEAlgorithm: aws:kms

References