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

fixes to match BridgeCrew compliance checks #51

Merged
merged 3 commits into from
Jan 26, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
*.tfstate
*.tfstate.backup
*.terraform.tfstate*
**/.terraform.lock.hcl

# Module directory
.terraform
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@

-->

Terraform module to provision S3-backed Websites
Terraform module to provision S3-backed Websites.
**This module provision S3 bucket globally accessible for unauthenticated users because it is used for hosting static websites.** (Normally AWS S3 buckets must not be publicly accessible for WRITE/READ actions in order to protect S3 data from unauthorized users)


---
Expand Down Expand Up @@ -137,7 +138,6 @@ Available targets:
| terraform | >= 0.12.26 |
| aws | >= 2.0 |
| local | >= 1.2 |
| null | >= 2.0 |

## Providers

Expand Down Expand Up @@ -186,7 +186,7 @@ Available targets:
| routing\_rules | A json array containing routing rules describing redirect behavior and when redirects are applied | `string` | `""` | no |
| stage | Stage, e.g. 'prod', 'staging', 'dev', OR 'source', 'build', 'test', 'deploy', 'release' | `string` | `null` | no |
| tags | Additional tags (e.g. `map('BusinessUnit','XYZ')` | `map(string)` | `{}` | no |
| versioning\_enabled | Enable or disable versioning | `bool` | `false` | no |
| versioning\_enabled | Enable or disable versioning | `bool` | `true` | no |

## Outputs

Expand Down
3 changes: 2 additions & 1 deletion README.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ related:
url: "https://github.com/cloudposse/terraform-aws-lb-s3-bucket"
# Short description of this project
description: |-
Terraform module to provision S3-backed Websites
Terraform module to provision S3-backed Websites.
**This module provision S3 bucket globally accessible for unauthenticated users because it is used for hosting static websites.** (Normally AWS S3 buckets must not be publicly accessible for WRITE/READ actions in order to protect S3 data from unauthorized users)
maximmi marked this conversation as resolved.
Show resolved Hide resolved
# How to use this project
usage: |-
#### Create s3 website bucket
Expand Down
3 changes: 1 addition & 2 deletions docs/terraform.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
| terraform | >= 0.12.26 |
| aws | >= 2.0 |
| local | >= 1.2 |
| null | >= 2.0 |

## Providers

Expand Down Expand Up @@ -55,7 +54,7 @@
| routing\_rules | A json array containing routing rules describing redirect behavior and when redirects are applied | `string` | `""` | no |
| stage | Stage, e.g. 'prod', 'staging', 'dev', OR 'source', 'build', 'test', 'deploy', 'release' | `string` | `null` | no |
| tags | Additional tags (e.g. `map('BusinessUnit','XYZ')` | `map(string)` | `{}` | no |
| versioning\_enabled | Enable or disable versioning | `bool` | `false` | no |
| versioning\_enabled | Enable or disable versioning | `bool` | `true` | no |

## Outputs

Expand Down
7 changes: 5 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,17 @@ module "logs" {

module "default_label" {
source = "cloudposse/label/null"
version = "0.22.0"
version = "0.22.1"
attributes = ["origin"]
context = module.this.context
}

resource "aws_s3_bucket" "default" {
bucket = var.hostname
#bridgecrew:skip=BC_AWS_S3_1:The bucket used for a public static website. (https://docs.bridgecrew.io/docs/s3_1-acl-read-permissions-everyone)
#bridgecrew:skip=BC_AWS_S3_14:Skipping `Ensure all data stored in the S3 bucket is securely encrypted at rest` check until bridgecrew will support dynamic blocks (https://github.com/bridgecrewio/checkov/issues/776).
#bridgecrew:skip=CKV_AWS_52:Skipping `Ensure S3 bucket has MFA delete enabled` due to issue using `mfa_delete` by terraform (https://github.com/hashicorp/terraform-provider-aws/issues/629).
acl = "public-read"
bucket = var.hostname
tags = module.default_label.tags
force_destroy = var.force_destroy

Expand Down
2 changes: 1 addition & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ variable "noncurrent_version_expiration_days" {

variable "versioning_enabled" {
type = bool
default = false
default = true
description = "Enable or disable versioning"
}

Expand Down
4 changes: 0 additions & 4 deletions versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,5 @@ terraform {
source = "hashicorp/local"
version = ">= 1.2"
}
null = {
source = "hashicorp/null"
version = ">= 2.0"
}
}
}