Skip to content

Latest commit

 

History

History
26 lines (17 loc) · 786 Bytes

bucket_versioning.md

File metadata and controls

26 lines (17 loc) · 786 Bytes

Bucket does not have versioning enabled

In the code example S3 bucket does not have versioning enabled

resource "aws_s3_bucket" "insecure_example" {

}

Why it's vulnerable?

Versioning in Amazon S3 is a means of keeping multiple variants of an object in the same bucket. You can use the S3 Versioning feature to preserve, retrieve, and restore every version of every object stored in your buckets. With versioning you can recover more easily from both unintended user actions and application failures. Deleted or modified data would not be recoverable.

How to fix?

Enable versioning to protect against accidental/malicious removal or modification

resource "aws_s3_bucket" "secure_example" {

    versioning {
        enabled = true
    }
}