Azure / terraform-azurerm-lz-vending

Terraform module to deploy landing zone subscriptions (and much more) in Azure
https://registry.terraform.io/modules/Azure/lz-vending/azurerm
MIT License
170 stars 79 forks source link

feat: MSDFC pricing plan and subplan #136

Open LaurentLesle opened 1 year ago

LaurentLesle commented 1 year ago

Description

Some security center resource type like virtual machines or storage account can be customised with a subplan to adjust the pricing of that service.

As of today the following subplan are supported:

In the current implementation there is a boolean value to enable or disable the service.

 // Management resources
  deploy_management_resources = true
  configure_management_resources = {
    advanced = null
    location = ""
    settings = {
      log_analytics = {
        # removed for clarity
      }
      security_center = {
        config = {
          email_security_contact             = "email@domain.com"
          enable_defender_for_app_services   = true
          enable_defender_for_arm            = true
          enable_defender_for_containers     = true
          enable_defender_for_dns            = true
          enable_defender_for_key_vault      = true
          enable_defender_for_oss_databases  = true
          enable_defender_for_servers        = true
          enable_defender_for_sql_server_vms = true
          enable_defender_for_sql_servers    = true
          enable_defender_for_storage        = true
        }
        enabled = true
      }
    }
    tags = null
  }

Describe the solution you'd like

Customise the pricing at the platform landingzone level Customise the pricing at the landingzone or sub-level

Additional context

LaurentLesle commented 1 year ago

wrong repo

LaurentLesle commented 1 year ago

Reopened as per conversions with @krowlandson

krowlandson commented 1 year ago

Adding cross-reference to related conversation:

As this is a per-Subscription setting, suggestion is to use the azurerm_security_center_subscription_pricing resource to enable this as part of lz-vending process. We will look at policy options in the caf-enterprise-scale module.

matt-FFFFFF commented 1 year ago

Thanks both. We will add it to the backlog!

LeegacySystem commented 1 year ago

As the azurerm_security_center_subscription_pricing does not take the subscription ID as an argument I would assume that something like this would have to be done with the azapi provider rather than azurerm?

I did consider having Defender for cloud be configured via a new 'Defender' submodule as part of the LZ vending machine. The only thing putting me off that idea is that I'm not as familiar with the azapi terraform provider so I'm not sure if that is the best approach and what challenges it might bring.

Even if I could be pointed in the right direction I might be able to get something working and contribute back here.