forked from aztfmod/terraform-azurerm-caf
-
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.
Ajout de l'activation de defender sur une souscription (#36)
- Loading branch information
Showing
7 changed files
with
81 additions
and
22 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
22 changes: 22 additions & 0 deletions
22
examples/security_center/101-subscription_pricing/configuration.tfvars
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,22 @@ | ||
security = { | ||
security_center_subscription_pricings = { | ||
vm = { | ||
# Free or Standard | ||
tier = "Standard" | ||
# Depends on the resource_type | ||
subplan = "P2" | ||
# can be one of: Api, AppServices, Arm, CloudPosture, ContainerRegistry, Containers, CosmosDbs, Dns, KeyVaults, KubernetesService, OpenSourceRelationalDatabases, SqlServers, SqlServerVirtualMachines, StorageAccounts, VirtualMachines | ||
resource_type = "VirtualMachines" | ||
# extensions list : https://learn.microsoft.com/en-us/rest/api/defenderforcloud/pricings/get?view=rest-defenderforcloud-2024-01-01&tabs=HTTP#extension | ||
extensions = { | ||
agent_less_scan = { | ||
name = "AgentlessVmScanning" | ||
} | ||
} | ||
} | ||
kv = { | ||
tier = "Standard" | ||
resource_type = "KeyVaults" | ||
} | ||
} | ||
} |
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
17 changes: 17 additions & 0 deletions
17
modules/security/security_center/subscription_pricing/main.tf
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,17 @@ | ||
resource "azurerm_security_center_subscription_pricing" "pricing" { | ||
# Free or Standard | ||
tier = var.tier | ||
# Depends on the resource_type | ||
subplan = try(var.subplan, null) | ||
# can be one of: Api, AppServices, Arm, CloudPosture, ContainerRegistry, Containers, CosmosDbs, Dns, KeyVaults, KubernetesService, OpenSourceRelationalDatabases, SqlServers, SqlServerVirtualMachines, StorageAccounts, VirtualMachines | ||
resource_type = var.resource_type | ||
|
||
# extensions list : https://learn.microsoft.com/en-us/rest/api/defenderforcloud/pricings/get?view=rest-defenderforcloud-2024-01-01&tabs=HTTP#extension | ||
dynamic "extension" { | ||
for_each = coalesce(var.extensions, {}) | ||
content { | ||
name = extension.value.name | ||
additional_extension_properties = try(extension.value.additional_extension_properties, null) | ||
} | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
modules/security/security_center/subscription_pricing/output.tf
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,3 @@ | ||
output "id" { | ||
value = azurerm_security_center_subscription_pricing.pricing.id | ||
} |
6 changes: 6 additions & 0 deletions
6
modules/security/security_center/subscription_pricing/variables.tf
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,6 @@ | ||
variable "tier" {} | ||
variable "subplan" {} | ||
variable "resource_type" {} | ||
variable "extensions" { | ||
default = null | ||
} |
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 @@ | ||
module "security_center_subscription_pricings" { | ||
source = "./modules/security/security_center/subscription_pricing" | ||
for_each = try(local.security.security_center_subscription_pricings, {}) | ||
|
||
tier = each.value.tier | ||
subplan = try(each.value.subplan, null) | ||
resource_type = each.value.resource_type | ||
extensions = try(each.value.extensions, null) | ||
} |