Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for "azurerm_security_center_data_scanner" resource #26019

Open
1 task done
napramirez opened this issue May 18, 2024 · 1 comment
Open
1 task done

Support for "azurerm_security_center_data_scanner" resource #26019

napramirez opened this issue May 18, 2024 · 1 comment

Comments

@napramirez
Copy link

napramirez commented May 18, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • Please vote on this issue by adding a 馃憤 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment and review the contribution guide to help.

Description

I would like to configure a azurerm_security_center_data_scanner resource so that I can assign its ID (e.g. /subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Security/datascanners/storageDataScanner) in azurerm_storage_account_network_rules when I have the new Microsoft Defender for Cloud Storage plan.

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

azurerm_security_center_data_scanner

Potential Terraform Configuration

resource "azurerm_resource_group" "example" {
  name     = "example-resources"
  location = "West Europe"
}

resource "azurerm_virtual_network" "example" {
  name                = "example-vnet"
  address_space       = ["10.0.0.0/16"]
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name
}

resource "azurerm_subnet" "example" {
  name                 = "example-subnet"
  resource_group_name  = azurerm_resource_group.example.name
  virtual_network_name = azurerm_virtual_network.example.name
  address_prefixes     = ["10.0.2.0/24"]
  service_endpoints    = ["Microsoft.Storage"]
}

resource "azurerm_storage_account" "example" {
  name                     = "storageaccountname"
  resource_group_name      = azurerm_resource_group.example.name
  location                 = azurerm_resource_group.example.location
  account_tier             = "Standard"
  account_replication_type = "GRS"

  tags = {
    environment = "staging"
  }
}

resource "azurerm_security_center_data_scanner" "example" {
  ...
}

resource "azurerm_storage_account_network_rules" "example" {
  storage_account_id = azurerm_storage_account.example.id

  default_action             = "Allow"

  private_link_access {
    endpoint_resource_id     = azurerm_security_center_data_scanner.example.id
  }
}

References

No response

@mkarbo
Copy link

mkarbo commented Jun 4, 2024

I have the same issue - though note that datascanner is on the trusted services list https://learn.microsoft.com/en-gb/azure/storage/common/storage-network-security?tabs=azure-portal#exceptions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants