-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
80 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
module "cwe" { | ||
source = "git::https://github.com/cloudmitigator/reflex-engine.git//modules/cwe?ref=v0.6.0" | ||
name = "RdsDeletionProtectionDisabled" | ||
description = "Rule to detect if deletion protection is disabled for RDS Instance." | ||
|
||
event_pattern = <<PATTERN | ||
{ | ||
"source": [ | ||
"aws.rds" | ||
], | ||
"detail-type": [ | ||
"AWS API Call via CloudTrail" | ||
], | ||
"detail": { | ||
"eventSource": [ | ||
"rds.amazonaws.com" | ||
], | ||
"eventName": [ | ||
"ModifyDBInstance" | ||
] | ||
} | ||
} | ||
PATTERN | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
output "id" { | ||
description = "Event Rule ID" | ||
value = module.cwe.id | ||
} | ||
|
||
output "arn" { | ||
description = "Event Rule Arn" | ||
value = module.cwe.arn | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
module "sqs_lambda" { | ||
source = "git::https://github.com/cloudmitigator/reflex-engine.git//modules/sqs_lambda?ref=v0.6.0" | ||
|
||
cloudwatch_event_rule_id = var.cloudwatch_event_rule_id | ||
cloudwatch_event_rule_arn = var.cloudwatch_event_rule_arn | ||
function_name = "RdsDeletionProtectionDisabled" | ||
source_code_dir = "${path.module}/../../source" | ||
handler = "reflex_aws_rds_deletion_protection_disabled.lambda_handler" | ||
lambda_runtime = "python3.7" | ||
environment_variable_map = { | ||
SNS_TOPIC = var.sns_topic_arn, | ||
|
||
} | ||
|
||
|
||
queue_name = "RdsDeletionProtectionDisabled" | ||
delay_seconds = 0 | ||
|
||
target_id = "RdsDeletionProtectionDisabled" | ||
|
||
sns_topic_arn = var.sns_topic_arn | ||
sqs_kms_key_id = var.reflex_kms_key_id | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
variable "sns_topic_arn" { | ||
description = "SNS topic arn of central or local sns topic" | ||
type = string | ||
} | ||
|
||
variable "reflex_kms_key_id" { | ||
description = "KMS Key Id for common reflex usage." | ||
type = string | ||
} | ||
|
||
variable "cloudwatch_event_rule_id" { | ||
description = "Easy name of CWE" | ||
type = string | ||
} | ||
|
||
variable "cloudwatch_event_rule_arn" { | ||
description = "Full arn of CWE" | ||
type = string | ||
} |
This file was deleted.
Oops, something went wrong.