You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Enable and configure with Infrastructure as Code templates
12
11
13
12
We recommend that you enable Defender for Storage on the subscription level. Doing so ensures all storage accounts in the subscription will be protected, including future ones.
@@ -17,11 +16,47 @@ We recommend that you enable Defender for Storage on the subscription level. Doi
17
16
18
17
## [Enable on a subscription](#tab/enable-subscription/)
19
18
19
+
### Terraform template
20
+
21
+
To enable and configure Microsoft Defender for Storage at the subscription level using Terraform, you can use the following code snippet:
**Modifying the monthly cap for malware scanning**
43
+
To modify the monthly cap for malware scanning per storage account, adjust the `CapGBPerMonthPerStorageAccount` parameter to your preferred value. This parameter sets a cap on the maximum data that can be scanned for malware each month per storage account. If you want to permit unlimited scanning, assign the value "-1". The default limit is set at 5,000 GB.
44
+
45
+
**Disabling features**
46
+
If you want to turn off the on-upload malware scanning or sensitive data threat detection features, you can remove the corresponding extension block from the Terraform code.
47
+
48
+
**Disabling the entire Defender for Storage plan**
49
+
To disable the entire Defender for Storage plan, set the `tier` property value to **"Free"** and remove the **subPlan** and **extension** properties.
50
+
51
+
Learn more about the __azurerm_security_center_subscription_pricing__ resource by referring to the [azurerm_security_center_subscription_pricing documentation](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/security_center_subscription_pricing). Additionally, you can find comprehensive details on the Terraform provider for Azure in the [Terraform AzureRM Provider documentation](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs).
52
+
20
53
### Bicep template
21
54
22
55
To enable and configure Microsoft Defender for Storage at the subscription level using [Bicep](/azure/azure-resource-manager/bicep/overview?tabs=bicep), make sure your [target scope is set to subscription](/azure/azure-resource-manager/bicep/deploy-to-subscription?tabs=azure-cli#scope-to-subscription), and add the following to your Bicep template:
**Modifying the monthly cap for malware scanning**
47
83
To modify the monthly cap for malware scanning per storage account, adjust the `CapGBPerMonthPerStorageAccount` parameter to your preferred value. This parameter sets a cap on the maximum data that can be scanned for malware each month per storage account. If you want to permit unlimited scanning, assign the value -1. The default limit is set at 5,000 GB.
48
84
49
-
If you want to turn off the On-upload malware scanning or Sensitive data threat detection features, you can change the `isEnabled` value to **False** under Sensitive data discovery.
85
+
**Disabling features**
86
+
If you want to turn off the On-upload malware scanning or Sensitive data threat detection features, you can change the `isEnabled` value to **False** under **sensitive data discovery**.
50
87
51
-
To disable the entire Defender for Storage plan, set the `pricingTier` property value to **Free** and remove the subPlan and extensions properties.
88
+
**Disabling the entire Defender for Storage plan**
89
+
To disable the entire Defender for Storage plan, set the `pricingTier` property value to **Free** and remove the **subPlan** and **extensions** properties.
52
90
53
91
Learn more about the [Bicep template in the Microsoft security/pricings documentation](/azure/templates/microsoft.security/pricings?pivots=deployment-language-bicep&source=docs).
54
92
55
93
### Azure Resource Manager template
56
94
57
95
To enable and configure Microsoft Defender for Storage at the subscription level using an ARM (Azure Resource Manager) template, add this JSON snippet to the resources section of your ARM template:
58
96
59
-
```
97
+
98
+
99
+
```json
60
100
{
61
101
"type": "Microsoft.Security/pricings",
62
102
"apiVersion": "2023-01-01",
@@ -81,21 +121,89 @@ To enable and configure Microsoft Defender for Storage at the subscription level
81
121
}
82
122
```
83
123
124
+
**Modifying the monthly cap for malware scanning**
84
125
To modify the monthly threshold for malware scanning in your storage accounts, simply adjust the `CapGBPerMonthPerStorageAccount` parameter to your preferred value. This parameter sets a cap on the maximum data that can be scanned for malware each month, per storage account. If you want to permit unlimited scanning, assign the value -1. The default limit is set at 5,000 GB.
85
126
86
-
If you want to turn off the on-upload malware scanning or Sensitive data threat detection features, you can change the `isEnabled` value to **False** under Sensitive data discovery.
127
+
**Disabling features**
128
+
If you want to turn off the on-upload malware scanning or sensitive data threat detection features, you can change the `isEnabled` value to **False** under **sensitive data discovery**.
87
129
88
-
To disable the entire Defender plan, set the `pricingTier` property value to **Free** and remove the subPlan and extensions properties.
130
+
**Disabling the entire Defender for Storage plan**
131
+
To disable the entire Defender plan, set the `pricingTier` property value to **Free** and remove the **subPlan** and **extensions** properties.
89
132
90
133
Learn more about the ARM template in the Microsoft.Security/Pricings documentation.
91
134
92
135
## [Enable on a storage account](#tab/enable-storage-account/)
93
136
137
+
### Terraform template - storage account
138
+
139
+
To enable and configure Microsoft Defender for Storage at the storage account level using Terraform, import the AzAPI provider and use the following code snippet:
> The **"azapi_resource_action"** used here is an action that is specific to the configuration of Microsoft Defender for Storage. It's different from the typical resource declarations in Terraform, and it's used to perform specific actions on the resource, such as enabling or disabling features.
170
+
171
+
**Modifying the monthly cap for malware scanning**
172
+
To modify the monthly threshold for malware scanning in your storage accounts, simply adjust the `capGBPerMonth` parameter to your preferred value. This parameter sets a cap on the maximum data that can be scanned for malware each month, per storage account. If you want to permit unlimited scanning, assign the value "-1". The default limit is set at 5,000 GB.
173
+
174
+
**Disabling features**
175
+
If you want to turn off the on-upload malware scanning or sensitive data threat detection features, you can change the `isEnabled` value to **False** under the **malwareScanning** or **sensitiveDataDiscovery** properties sections.
176
+
177
+
**Disabling the entire Defender for Storage plan**
178
+
To enable and configure Microsoft Defender for Storage at the storage account level using Terraform, import the [AzAPI provider](https://registry.terraform.io/providers/Azure/azapi/latest/docs) and use the following code snippet:
You can change the value of `overrideSubscriptionLevelSettings` to **True** to disable Defender for Storage plan for the storage account under subscriptions with Defender for Storage enabled at the subscription level. If you want to keep some features enabled, you can modify the properties accordingly.
200
+
Learn more about the __[Microsoft.Security/defenderForStorageSettings](/rest/api/defenderforcloud/defender-for-storage/create)__ API documentation for further customization and control over your storage account's security settings. Additionally, you can find comprehensive details on the Terraform provider for Azure in the [Terraform AzureRM Provider documentation](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs).
201
+
94
202
### Bicep template - storage account
95
203
96
204
To enable and configure Microsoft Defender for Storage at the storage account level using Bicep, add the following to your Bicep template:
To modify the monthly threshold for malware scanning in your storage accounts, simply adjust the capGBPerMonth parameter to your preferred value. This parameter sets a cap on the maximum data that can be scanned for malware each month, per storage account. If you want to permit unlimited scanning, assign the value -1. The default limit is set at 5,000 GB.
228
+
**Modifying the monthly cap for malware scanning**
229
+
To modify the monthly threshold for malware scanning in your storage accounts, simply adjust the `capGBPerMonth parameter` to your preferred value. This parameter sets a cap on the maximum data that can be scanned for malware each month, per storage account. If you want to permit unlimited scanning, assign the value -1. The default limit is set at 5,000 GB.
121
230
122
-
If you want to turn off the On-upload malware scanning or Sensitive data threat detection features, you can change the `isEnabled` value to **false** under the `malwareScanning` or `sensitiveDataDiscovery` properties sections.
231
+
**Disabling features**
232
+
If you want to turn off the On-upload malware scanning or sensitive data threat detection features, you can change the `isEnabled` value to **False** under the **malwareScanning** or **sensitiveDataDiscovery** properties sections.
123
233
124
-
To disable the entire Defender plan for the storage account, set the `isEnabled` property value to **false** and remove the `malwareScanning` and `sensitiveDataDiscovery` sections from the properties.
234
+
**Disabling the entire Defender for Storage plan**
235
+
To disable the entire Defender plan for the storage account, set the `isEnabled` property value to **False** and remove the **malwareScanning** and **sensitiveDataDiscovery** sections from the properties.
125
236
126
237
Learn more about the [Microsoft.Security/DefenderForStorageSettings API](/rest/api/defenderforcloud/defender-for-storage/create) documentation.
127
238
128
239
> [!TIP]
129
240
> Malware Scanning can be configured to send scanning results to the following: <br> **Event Grid custom topic** - for near-real time automatic response based on every scanning result. Learn more how to [configure malware scanning to send scanning events to an Event Grid custom topic](/azure/storage/common/azure-defender-storage-configure?toc=%2Fazure%2Fdefender-for-cloud%2Ftoc.json&tabs=enable-storage-account#setting-up-event-grid-for-malware-scanning). <br> **Log Analytics workspace** - for storing every scan result in a centralized log repository for compliance and audit. Learn more how to [configure malware scanning to send scanning results to a Log Analytics workspace](/azure/storage/common/azure-defender-storage-configure?toc=%2Fazure%2Fdefender-for-cloud%2Ftoc.json&tabs=enable-storage-account#setting-up-logging-for-malware-scanning).
130
241
131
-
Learn more on how to set up response for malware scanning results.
242
+
Learn more on how to [set up response for malware scanning results.](/azure/defender-for-cloud/defender-for-storage-configure-malware-scan)
132
243
133
244
### ARM template - storage account
134
245
135
246
To enable and configure Microsoft Defender for Storage at the storage account level using an ARM template, add this JSON snippet to the resources section of your ARM template:
**Modifying the monthly cap for malware scanning**
272
+
**Modifying the monthly cap for malware scanning**
158
273
159
-
To modify the monthly threshold for malware scanning in your storage accounts, simply adjust the capGBPerMonth parameter to your preferred value. This parameter sets a cap on the maximum data that can be scanned for malware each month, per storage account. If you want to permit unlimited scanning, assign the value -1. The default limit is set at 5,000 GB.
274
+
To modify the monthly threshold for malware scanning in your storage accounts, simply adjust the capGBPerMonth parameter to your preferred value. This parameter sets a cap on the maximum data that can be scanned for malware each month, per storage account. If you want to permit unlimited scanning, assign the value "-1". The default limit is set at 5,000 GB.
160
275
161
-
If you want to turn off the On-upload malware scanning or Sensitive data threat detection features, you can change the isEnabled value to false under the malwareScanning or sensitiveDataDiscovery properties sections.
276
+
**Disabling features**
277
+
If you want to turn off the on-upload malware scanning or sensitive data threat detection features, you can change the `isEnabled` value to **False** under the **malwareScanning** or **sensitiveDataDiscovery** properties sections.
162
278
163
-
To disable the entire Defender plan for the storage account, set the isEnabled property value to false and remove the malwareScanning and sensitiveDataDiscovery sections from the properties.
279
+
**Disabling the entire Defender for Storage plan**
280
+
To disable the entire Defender plan for the storage account, set the `isEnabled` property value to **False** and remove the **malwareScanning** and **sensitiveDataDiscovery** sections from the properties.
0 commit comments