-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from DNXLabs/feature/updates
Using chatbot instead of slack
- Loading branch information
Showing
5 changed files
with
46 additions
and
28 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,14 +25,14 @@ The following resources will be created: | |
| Name | Version | | ||
|------|---------| | ||
| aws | n/a | | ||
| random | >= 3.3.0 | | ||
|
||
## Inputs | ||
|
||
| Name | Description | Type | Default | Required | | ||
|------|-------------|------|---------|:--------:| | ||
| alarm\_email | Enables email notification (optional) | `string` | `""` | no | | ||
| alarm\_slack\_endpoint | Enables slack notification to endpoint passed (optional) | `string` | `""` | no | | ||
| chatbot\_sns\_topic | SNS topic for chatbot notification | `string` | `""` | no | | ||
| invite | Invite member accounts? (Use 'false' when this account is the delegated admin by master account) | `bool` | `true` | no | | ||
| members | List of member AWS accounts as [{account\_id: '9999', email: '[email protected]'}, {...}] } | `list(any)` | `[]` | no | | ||
| severity\_list | n/a | `list(any)` | <pre>[<br> "HIGH",<br> "CRITICAL"<br>]</pre> | no | | ||
|
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 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 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 |
---|---|---|
@@ -1,26 +1,26 @@ | ||
|
||
resource "random_string" "to_slack_cf_suffix" { | ||
count = var.alarm_slack_endpoint != "" ? 1 : 0 | ||
length = 8 | ||
special = false | ||
lower = true | ||
numeric = false | ||
} | ||
# resource "random_string" "to_slack_cf_suffix" { | ||
# count = var.alarm_slack_endpoint != "" ? 1 : 0 | ||
# length = 8 | ||
# special = false | ||
# lower = true | ||
# numeric = false | ||
# } | ||
|
||
resource "aws_cloudformation_stack" "to_slack" { | ||
count = var.alarm_slack_endpoint != "" ? 1 : 0 | ||
name = "SecurityHubToSlack-${random_string.to_slack_cf_suffix[0].result}" | ||
template_body = file("${path.module}/event-to-slack.cf.json") | ||
parameters = { | ||
IncomingWebHookURL = var.alarm_slack_endpoint | ||
SecurityHubEventArn = aws_cloudwatch_event_rule.securityhub[0].arn | ||
} | ||
capabilities = ["CAPABILITY_IAM"] | ||
} | ||
# resource "aws_cloudformation_stack" "to_slack" { | ||
# count = var.alarm_slack_endpoint != "" ? 1 : 0 | ||
# name = "SecurityHubToSlack-${random_string.to_slack_cf_suffix[0].result}" | ||
# template_body = file("${path.module}/event-to-slack.cf.json") | ||
# parameters = { | ||
# IncomingWebHookURL = var.alarm_slack_endpoint | ||
# SecurityHubEventArn = aws_cloudwatch_event_rule.securityhub[0].arn | ||
# } | ||
# capabilities = ["CAPABILITY_IAM"] | ||
# } | ||
|
||
resource "aws_cloudwatch_event_target" "to_slack" { | ||
count = var.alarm_slack_endpoint != "" ? 1 : 0 | ||
rule = aws_cloudwatch_event_rule.securityhub[0].name | ||
target_id = "securityhub-to-slack" | ||
arn = aws_cloudformation_stack.to_slack[0].outputs.LambdaFindingsToSlackArn | ||
} | ||
# resource "aws_cloudwatch_event_target" "to_slack" { | ||
# count = var.alarm_slack_endpoint != "" ? 1 : 0 | ||
# rule = aws_cloudwatch_event_rule.securityhub[0].name | ||
# target_id = "securityhub-to-slack" | ||
# arn = aws_cloudformation_stack.to_slack[0].outputs.LambdaFindingsToSlackArn | ||
# } |
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