Skip to content

Commit

Permalink
feat: enable vulnerability assessment email notifications (#88)
Browse files Browse the repository at this point in the history
* feat: add vuln assessment recurring scan arguments as variables

* chore: updated log analyticcs version

* chore: fixed variables names

* Update main.tf

Co-authored-by: Henrik Knutsen <[email protected]>

* Update variables.tf

Co-authored-by: Henrik Knutsen <[email protected]>

---------

Co-authored-by: Henrik Knutsen <[email protected]>
  • Loading branch information
kov117 and hknutsen authored May 3, 2023
1 parent 6efb728 commit 7bcb5d9
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 6 deletions.
2 changes: 1 addition & 1 deletion examples/basic/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ resource "azurerm_resource_group" "this" {
}

module "log_analytics" {
source = "github.com/equinor/terraform-azurerm-log-analytics?ref=v1.4.0"
source = "github.com/equinor/terraform-azurerm-log-analytics?ref=v1.5.0"

workspace_name = "log-${random_id.this.hex}"
resource_group_name = azurerm_resource_group.this.name
Expand Down
2 changes: 1 addition & 1 deletion examples/complete/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ resource "azurerm_resource_group" "this" {
}

module "log_analytics" {
source = "github.com/equinor/terraform-azurerm-log-analytics?ref=v1.4.0"
source = "github.com/equinor/terraform-azurerm-log-analytics?ref=v1.5.0"

workspace_name = "log-${random_id.this.hex}"
resource_group_name = azurerm_resource_group.this.name
Expand Down
2 changes: 1 addition & 1 deletion examples/failover-group/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ resource "azurerm_resource_group" "this" {
}

module "log_analytics" {
source = "github.com/equinor/terraform-azurerm-log-analytics?ref=v1.4.0"
source = "github.com/equinor/terraform-azurerm-log-analytics?ref=v1.5.0"

workspace_name = "log-${random_id.this.hex}"
resource_group_name = azurerm_resource_group.this.name
Expand Down
6 changes: 3 additions & 3 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ resource "azurerm_mssql_server_vulnerability_assessment" "this" {
storage_account_access_key = var.storage_account_access_key

recurring_scans {
enabled = true
email_subscription_admins = false
emails = []
enabled = var.vulnerability_assessment_recurring_scans_enabled
email_subscription_admins = var.vulnerability_assessment_recurring_scans_email_subscription_admins
emails = var.vulnerability_assessment_recurring_scans_emails
}
}
17 changes: 17 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,23 @@ variable "storage_container_name" {
default = "vulnerability-assessment"
}

variable "vulnerability_assessment_recurring_scans_enabled" {
description = "Specifies if recurring scans is enabled or disabled."
type = bool
default = true
}

variable "vulnerability_assessment_recurring_scans_email_subscription_admins" {
description = "Specifies if the schedule scan notification will be sent to the subscriptions administrators for this SQL server."
type = bool
default = true
}

variable "vulnerability_assessment_recurring_scans_emails" {
description = "Specifies an array of email addresses to which the scan notification."
type = list(string)
default = []
}
variable "tags" {
description = "A mapping of tags to assign to the resources."
type = map(string)
Expand Down

0 comments on commit 7bcb5d9

Please sign in to comment.