OSS Bucket Versioning Disabled

  • Query id: 70919c0b-2548-4e6b-8d7a-3d84ab6dabba
  • Query name: OSS Bucket Versioning Disabled
  • Platform: Terraform
  • Severity: Medium
  • Category: Backup
  • URL: Github

Description

OSS Bucket should have versioning enabled
Documentation

Code samples

Code samples with security vulnerabilities

Positive test num. 1 - tf file
resource "alicloud_oss_bucket" "bucket-versioning2" {
  bucket = "bucket-170309-versioning"
  acl    = "private"

  versioning {
    status = "Suspended"
  }
}
Positive test num. 2 - tf file
resource "alicloud_oss_bucket" "bucket-versioning3" {
  bucket = "bucket-170309-versioning"
  acl    = "private"
}

Code samples without security vulnerabilities

Negative test num. 1 - tf file
resource "alicloud_oss_bucket" "bucket-versioning1" {
  bucket = "bucket-170309-versioning"
  acl    = "private"

  versioning {
    status = "Enabled"
  }
}