Skip to content

Commit

Permalink
Merge pull request #9 from DNXLabs/fix-deprecated-node-version
Browse files Browse the repository at this point in the history
Fix deprecated node version
  • Loading branch information
lucasmacedot authored Oct 30, 2023
2 parents 3ea604b + d21cbd8 commit 31051bf
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 7 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,16 @@ This module creates the "member" side of Guardduty, with the assumption that the

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| admin\_account\_id | GuardDuty Detector ID for master account | `any` | n/a | yes |
| admin\_account\_id | GuardDuty Detector ID for master account | `string` | n/a | yes |
| alarm\_slack\_severity | Minimum severity level (LOW, MEDIUM, HIGH) | `string` | `"HIGH"` | no |
| alarm\_slack\_webhook | Slack Incoming Web Hook URL. Leave blank to disable alarm to slack | `string` | `""` | no |
| create\_invite\_accepter | Create GuardDuty Member Invite Accepter. Not needed if already setup as part of an organization | `bool` | `true` | no |
| enable\_detector | Enable GuardDuty Member Detector | `bool` | `true` | no |
| enabled | The boolean flag whether this module is enabled or not. No resources are created when set to false. | `bool` | `true` | no |
| lambda\_name | Name of the Lambda Function | `any` | n/a | yes |
| member\_detector\_id | GuardDuty Detector ID for member account. Only needed if enable\_detector is false. Used for targeting any previously enable detector | `string` | `""` | no |
| nodejs\_version | Version of Nodejs to create the lambda | `string` | `"nodejs18.x"` | no |
| sns\_email\_arn | SNS Topic ARN | `string` | `""` | no |
| enable\_detector | Enable GuardDuty Member Detector | `bool` | `true` | no |
| create\_invite\_accepter | Create GuardDuty Member Invite Accepter. Not needed if already setup as part of an organization | `bool` | `true` | no |
| member\_detector\_id | GuardDuty Detector ID for member account. Only needed if enable_detector is false. Used for targeting any previously enable detector | `string` | `""` | no |

## Outputs

Expand Down
6 changes: 6 additions & 0 deletions _variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,9 @@ variable "member_detector_id" {
type = string
default = ""
}

variable "nodejs_version" {
type = string
default = "nodejs18.x"
description = "Version of Nodejs to create the lambda"
}
15 changes: 12 additions & 3 deletions guardduty-alarm-slack.cf.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
},
"Parameters": [
"IncomingWebHookURL",
"MinSeverityLevel"
"MinSeverityLevel",
"NodejsVersion"
]
}
],
Expand All @@ -20,6 +21,9 @@
},
"MinSeverityLevel" : {
"default" : "Minimum severity level (LOW, MEDIUM, HIGH)"
},
"NodejsVersion": {
"default": "Version of Nodejs to create the lambda"
}
}
}
Expand All @@ -39,7 +43,12 @@
"MEDIUM",
"HIGH"
]
}
},
"NodejsVersion": {
"Default": "node18.x",
"Description": "Version of nodejs to use to create the lambda",
"Type": "String"
}
},
"Resources": {
"GuardDutyToSlackRole": {
Expand Down Expand Up @@ -225,7 +234,7 @@
"minSeverityLevel" : {"Ref" : "MinSeverityLevel"}
}
},
"Runtime": "nodejs12.x",
"Runtime": { "Ref": "NodejsVersion" },
"MemorySize" : "128",
"Timeout": "10",
"Description" : "Lambda to push GuardDuty findings to slack",
Expand Down
1 change: 1 addition & 0 deletions guardduty-alarm.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ resource "aws_cloudformation_stack" "guardduty_alarm_slack" {
parameters = {
IncomingWebHookURL = var.alarm_slack_webhook
MinSeverityLevel = var.alarm_slack_severity
NodejsVersion = var.nodejs_version
}

template_body = file("${path.module}/guardduty-alarm-slack.cf.json")
Expand Down

0 comments on commit 31051bf

Please sign in to comment.