hashicorp / terraform-provider-azurerm

Terraform provider for Azure Resource Manager
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs
Mozilla Public License 2.0
4.62k stars 4.65k forks source link

Support for managing Regulatory Compliance in Microsoft Defender for Cloud #20687

Open jsun9406 opened 1 year ago

jsun9406 commented 1 year ago

Is there an existing issue for this?

Community Note

Description

While working on using Terraform to manage Microsoft Defender for Cloud.

I am trying to find a way to enable/disable Regulatory Compliance in Security Policy via Terraform (see below screenshot). Is there a such resource type in Terraform can achieve this?

image

New or Affected Resource(s)/Data Source(s)

azurerm_security_center

Potential Terraform Configuration

No response

References

No response

nickel-tyler commented 7 months ago

I think you would just use azurerm_policy_assignment's for built-in policies under the category 'Regulatory Compliance', and once you do this Azure will 'detect' this under the Security Policy blade. You can do something similar to enable the Defender plan features, as some/most of the features are backed by Azure Policy.

Regulatory Compliance built-in policies image

Evidence that policy assignments can be used enable some defender plan settings image