From 7bcb5d912b31e190def34550d0896e0502490bfb Mon Sep 17 00:00:00 2001 From: Kristian Vallejos <126077239+kov117@users.noreply.github.com> Date: Wed, 3 May 2023 09:17:00 +0200 Subject: [PATCH] feat: enable vulnerability assessment email notifications (#88) * 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 <46495473+hknutsen@users.noreply.github.com> * Update variables.tf Co-authored-by: Henrik Knutsen <46495473+hknutsen@users.noreply.github.com> --------- Co-authored-by: Henrik Knutsen <46495473+hknutsen@users.noreply.github.com> --- examples/basic/main.tf | 2 +- examples/complete/main.tf | 2 +- examples/failover-group/main.tf | 2 +- main.tf | 6 +++--- variables.tf | 17 +++++++++++++++++ 5 files changed, 23 insertions(+), 6 deletions(-) diff --git a/examples/basic/main.tf b/examples/basic/main.tf index faa8554..1cea9df 100644 --- a/examples/basic/main.tf +++ b/examples/basic/main.tf @@ -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 diff --git a/examples/complete/main.tf b/examples/complete/main.tf index 9003ad5..85ec4df 100644 --- a/examples/complete/main.tf +++ b/examples/complete/main.tf @@ -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 diff --git a/examples/failover-group/main.tf b/examples/failover-group/main.tf index 6f8d0ce..400aaa3 100644 --- a/examples/failover-group/main.tf +++ b/examples/failover-group/main.tf @@ -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 diff --git a/main.tf b/main.tf index db908ad..9e1b1a3 100644 --- a/main.tf +++ b/main.tf @@ -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 } } diff --git a/variables.tf b/variables.tf index 9fb5aca..e9ecd84 100644 --- a/variables.tf +++ b/variables.tf @@ -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)