Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ts bucket #631

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions terraform/aws/s3v2.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
resource "aws_s3_bucket" "cargo_bay" {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CRITICAL   Check that all resources are tagged with the key - env
    Resource: aws_s3_bucket.cargo_bay | ID: acme_AWS_1614172162021

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CRITICAL   Ensure retention period for supported resources is higher than 0
    Resource: aws_s3_bucket.cargo_bay | ID: acme_aws_1647782267175

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HIGH   PCI check tag exists
    Resource: aws_s3_bucket.cargo_bay | ID: acme_aws_1629787200891

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOW   Ensure S3 Bucket has public access blocks
    Resource: aws_s3_bucket.cargo_bay | ID: BC_AWS_NETWORKING_52

How to Fix

resource "aws_s3_bucket" "bucket_good_1" {
  bucket = "bucket_good"
}

resource "aws_s3_bucket_public_access_block" "access_good_1" {
  bucket = aws_s3_bucket.bucket_good_1.id

  block_public_acls   = true
  block_public_policy = true
}

Description

When you create an S3 bucket, it is good practice to set the additional resource **aws_s3_bucket_public_access_block** to ensure the bucket is never accidentally public.

We recommend you ensure S3 bucket has public access blocks. If the public access block is not attached it defaults to False.

bucket = "cargo-bay-bridgecrew-class-7321"
tags = {
Name = "cargo-bay-bridgecrew-class-7321"
}
}

resource "aws_s3_bucket_versioning" "cargo_bay" {
Copy link

@bridgecrew bridgecrew bot Jul 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CRITICAL   Check that all resources are tagged with the key - env
    Resource: aws_s3_bucket_versioning.cargo_bay | ID: acme_AWS_1614172162021

Description

Tags Governance - in case of the matched condition below -> add a tag of env with one of the values: prod/dev1/dev2/test/stage

Copy link

@bridgecrew bridgecrew bot Jul 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CRITICAL   Ensure retention period for supported resources is higher than 0
    Resource: aws_s3_bucket_versioning.cargo_bay | ID: acme_aws_1647782267175

Description

Ensure retention period for supported resources is higher than 0

bucket = aws_s3_bucket.cargo_bay.id

versioning_configuration {
status = "Enabled"
}
}