Skip to content

Commit

Permalink
enhancement: Set dynamoDB deletion protection to true to solve securi…
Browse files Browse the repository at this point in the history
…ty hub finding (#30)

enhancement: Set dynamoDB deletion protection to true to solve security hub finding
  • Loading branch information
kapas2004 committed Jan 23, 2024
1 parent 264bf2e commit 3130d5c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
6 changes: 3 additions & 3 deletions examples/basic/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ resource "random_string" "random" {
module "security_hub_manager" {
source = "../../"

kms_key_arn = aws_kms_key.default.arn
s3_bucket_name = "securityhub-suppressor-artifacts-${random_string.random.result}"
tags = { Terraform = true }
kms_key_arn = aws_kms_key.default.arn
s3_bucket_name = "securityhub-suppressor-artifacts-${random_string.random.result}"
tags = { Terraform = true }
}
11 changes: 6 additions & 5 deletions suppressor.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# DynamoDB table for storing suppressions list
resource "aws_dynamodb_table" "suppressor_dynamodb_table" {
name = var.dynamodb_table
billing_mode = "PAY_PER_REQUEST"
hash_key = "controlId"
stream_enabled = true
stream_view_type = "KEYS_ONLY"
name = var.dynamodb_table
billing_mode = "PAY_PER_REQUEST"
deletion_protection_enabled = var.dynamodb_deletion_protection
hash_key = "controlId"
stream_enabled = true
stream_view_type = "KEYS_ONLY"

attribute {
name = "controlId"
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
variable "dynamodb_deletion_protection" {
type = bool
default = true
description = "The DynamoDB table deletion protection option."
}

variable "dynamodb_table" {
type = string
default = "securityhub-suppression-list"
Expand Down

0 comments on commit 3130d5c

Please sign in to comment.