Skip to content

Commit

Permalink
feat: support disabling individual securityhub controls
Browse files Browse the repository at this point in the history
  • Loading branch information
Johan Steenhoven authored and Johan Steenhoven committed May 15, 2024
1 parent 8dee354 commit ee6820b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
11 changes: 11 additions & 0 deletions security_hub.tf
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,17 @@ resource "aws_securityhub_standards_subscription" "default" {
depends_on = [aws_securityhub_account.default]
}

resource "aws_securityhub_standards_control" "default" {
for_each = var.aws_security_hub.disabled_standards_arns
provider = aws.audit

standards_control_arn = each.key
control_status = "DISABLED"
disabled_reason = each.value

depends_on = [aws_securityhub_account.default]
}

resource "aws_cloudwatch_event_rule" "security_hub_findings" {
provider = aws.audit

Expand Down
5 changes: 5 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,10 @@ variable "aws_security_hub" {
create_cis_metric_filters = optional(bool, true)
product_arns = optional(list(string), [])
standards_arns = optional(list(string), null)
disabled_standards_arns = optional(object({
standards_control_arn = string
disabled_reason = string
}), null)
})
default = {
enabled = true
Expand All @@ -171,6 +175,7 @@ variable "aws_security_hub" {
create_cis_metric_filters = true
product_arns = []
standards_arns = null
disabled_standards_arns = null
}
description = "AWS Security Hub settings"

Expand Down

0 comments on commit ee6820b

Please sign in to comment.