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
Copy file name to clipboardExpand all lines: articles/defender-for-cloud/iac-vulnerabilities.md
+42-30Lines changed: 42 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,14 +9,16 @@ ms.custom: ignite-2022
9
9
10
10
# Discover misconfigurations in Infrastructure as Code (IaC)
11
11
12
-
Once you have set up the Microsoft Security DevOps GitHub action or Azure DevOps extension, extra support is located in the YAML configuration that can be used to run a specific tool, or several of the tools. For example, setting up the action or extension to run Infrastructure as Code (IaC) scanning only. This can help reduce pipeline run time.
12
+
Once you have set up the Microsoft Security DevOps GitHub action or Azure DevOps extension, you can configure the YAML configuration file to run a single tool or multiple tools. For example, you can set up the action or extension to run Infrastructure as Code (IaC) scanning tools only. This can help reduce pipeline run time.
13
13
14
14
## Prerequisites
15
15
16
-
-[Configure Microsoft Security DevOps GitHub action](github-action.md).
17
-
-[Configure the Microsoft Security DevOps Azure DevOps extension](azure-devops-extension.md).
16
+
- Configure Microsoft Security DevOps for GitHub and/or Azure DevOps based on your source code management system:
- Ensure you have an IaC template in your repository.
18
20
19
-
## View the results of the IaC scan in GitHub
21
+
## Configure IaC scanning and view the results in GitHub
20
22
21
23
1. Sign in to [GitHub](https://www.github.com).
22
24
@@ -43,19 +45,19 @@ Once you have set up the Microsoft Security DevOps GitHub action or Azure DevOps
43
45
44
46
:::image type="content" source="media/tutorial-iac-vulnerabilities/commit-change.png" alt-text="Screenshot that shows where to select commit change on the githib page.":::
45
47
46
-
1. (Optional) Skip this step if you already have an IaC template in your repository.
48
+
1. (Optional) Add an IaC template to your repository. Skip if you already have an IaC template in your repository.
47
49
48
-
Follow this link to [Install an IaC template](https://github.com/Azure/azure-quickstart-templates/tree/master/quickstarts/microsoft.web/webapp-basic-linux).
50
+
For example, [commit an IaC template to deploy a basic Linux web application](https://github.com/Azure/azure-quickstart-templates/tree/master/quickstarts/microsoft.web/webapp-basic-linux) to your repository.
49
51
50
52
1. Select `azuredeploy.json`.
51
53
52
-
:::image type="content" source="media/tutorial-iac-vulnerabilities/deploy-json.png" alt-text="Screenshot that shows where the deploy.json file is located.":::
54
+
:::image type="content" source="media/tutorial-iac-vulnerabilities/deploy-json.png" alt-text="Screenshot that shows where the azuredeploy.json file is located.":::
@@ -144,25 +146,26 @@ Once you have set up the Microsoft Security DevOps GitHub action or Azure DevOps
144
146
145
147
:::image type="content" source="media/tutorial-iac-vulnerabilities/file-added.png" alt-text="Screenshot that shows that the new file you created has been added to your repository.":::
146
148
147
-
1. Select **Actions**.
148
149
149
-
1. Select the workflow to see the results.
150
+
1. Confirm the Microsoft Security DevOps scan completed:
151
+
1. Select **Actions**.
152
+
2. Select the workflow to see the results.
150
153
151
-
1. Navigate in the results to the scan results section.
154
+
1. Navigate to **Security** > **Code scanning alerts** to view the results of the scan (filter by tool as needed to see just the IaC findings).
152
155
153
-
1. Navigate to **Security** > **Code scanning alerts** to view the results of the scan.
154
-
155
-
## View the results of the IaC scan in Azure DevOps
156
+
## Configure IaC scanning and view the results in Azure DevOps
156
157
157
158
**To view the results of the IaC scan in Azure DevOps**
158
159
159
-
1. Sign in to [Azure DevOps](https://dev.azure.com/)
160
+
1. Sign in to [Azure DevOps](https://dev.azure.com/).
161
+
162
+
1. Select the desired project
160
163
161
-
1. Navigate to **Pipeline**.
164
+
1. Select **Pipeline**.
162
165
163
-
1. Locate the pipeline with MSDO Azure DevOps Extension is configured.
166
+
1. Select the pipeline where the Microsoft Security DevOps Azure DevOps Extension is configured.
164
167
165
-
1. Select **Edit**.
168
+
1. **Edit** the pipeline configuration YAML file adding the following lines:
166
169
167
170
1. Add the following lines to the YAML file
168
171
@@ -175,21 +178,30 @@ Once you have set up the Microsoft Security DevOps GitHub action or Azure DevOps
175
178
176
179
1. Select **Save**.
177
180
178
-
1. Select **Save** to commit directly to the main branch or Create a new branch for this commit
181
+
1. (Optional) Add an IaC template to your repository. Skip if you already have an IaC template in your repository.
182
+
183
+
1. Select **Save** to commit directly to the main branch or Create a new branch for this commit.
179
184
180
185
1. Select **Pipeline** > **`Your created pipeline`** to view the results of the IaC scan.
181
186
182
187
1. Select any result to see the details.
183
188
184
-
## Remediate PowerShell based rules:
189
+
## View details and remediation information on IaC rules included with Microsoft Security DevOps
190
+
191
+
### PowerShell-based rules
185
192
186
193
Information about the PowerShell-based rules included by our integration with [PSRule for Azure](https://aka.ms/ps-rule-azure/rules). The tool will only evaluate the rules under the [Security pillar](https://azure.github.io/PSRule.Rules.Azure/en/rules/module/#security) unless the option `--include-non-security-rules` is used.
187
194
188
195
> [!NOTE]
189
-
> Severity levels are scaled from 1 to 3. Where 1 = High, 2 = Medium, 3 = Low.
196
+
> PowerShell-based rules are included by our integration with [PSRule for Azure](https://aka.ms/ps-rule-azure/rules). The tool will evaluate all rules under the [Security pillar](https://azure.github.io/PSRule.Rules.Azure/en/rules/module/#security).
190
197
191
198
### JSON-Based Rules:
192
199
200
+
JSON-based rules for ARM templates and bicep files are provided by [Template-Analyzer](https://github.com/Azure/template-analyzer#template-best-practice-analyzer-bpa). Below are details on template-analyzer's rules and remediation details.
201
+
202
+
> [!NOTE]
203
+
> Severity levels are scaled from 1 to 3. Where 1 = High, 2 = Medium, 3 = Low.
204
+
193
205
#### TA-000001: Diagnostic logs in App Services should be enabled
194
206
195
207
Audits the enabling of diagnostic logs on the app. This enables you to recreate activity trails for investigation purposes if a security incident occurs or your network is compromised.
@@ -200,7 +212,7 @@ Audits the enabling of diagnostic logs on the app. This enables you to recreate
200
212
201
213
#### TA-000002: Remote debugging should be turned off for API Apps
202
214
203
-
Remote debugging requires inbound ports to be opened on an API app. These ports become easy targets for compromise from various internetbased attacks. If you no longer need to use remote debugging, it should be turned off.
215
+
Remote debugging requires inbound ports to be opened on an API app. These ports become easy targets for compromise from various internet-based attacks. If you no longer need to use remote debugging, it should be turned off.
204
216
205
217
**Recommendation**: To disable remote debugging, in the [Microsoft.Web/sites/config resource properties](/azure/templates/microsoft.web/sites/config-web?tabs=json#SiteConfig), remove the *remoteDebuggingEnabled* property or update its value to `false`.
206
218
@@ -210,23 +222,23 @@ Remote debugging requires inbound ports to be opened on an API app. These ports
210
222
211
223
Enable FTPS enforcement for enhanced security.
212
224
213
-
**Recommendation**: To [enforce FTPS](../app-service/deploy-ftp.md?tabs=portal#enforce-ftps), in the [Microsoft.Web/sites/config resource properties](/azure/templates/microsoft.web/sites/config-web?tabs=json#SiteConfig), add (or update) the *ftpsState* property, setting its value to `"FtpsOnly"` or `"Disabled"` if you don't need FTPS enabled.
225
+
**Recommendation**: To [enforce FTPS](../app-service/deploy-ftp.md?tabs=portal#enforce-ftps) in the [Microsoft.Web/sites/config resource properties](/azure/templates/microsoft.web/sites/config-web?tabs=json#SiteConfig), add (or update) the *ftpsState* property, setting its value to `"FtpsOnly"` or `"Disabled"` if you don't need FTPS enabled.
214
226
215
227
**Severity level**: 1
216
228
217
229
#### TA-000004: API App Should Only Be Accessible Over HTTPS
218
230
219
231
API apps should require HTTPS to ensure connections are made to the expected server and data in transit is protected from network layer eavesdropping attacks.
220
232
221
-
**Recommendation**: To [use HTTPS to ensure, server/service authentication and protect data in transit from network layer eavesdropping attacks](../app-service/configure-ssl-bindings.md#enforce-https), in the [Microsoft.Web/Sites resource properties](/azure/templates/microsoft.web/sites?tabs=json#siteproperties-object), add (or update) the *httpsOnly* property, setting its value to `true`.
233
+
**Recommendation**: To [use HTTPS to ensure, server/service authentication and protect data in transit from network layer eavesdropping attacks](../app-service/configure-ssl-bindings.md#enforce-https) in the [Microsoft.Web/Sites resource properties](/azure/templates/microsoft.web/sites?tabs=json#siteproperties-object), add (or update) the *httpsOnly* property, setting its value to `true`.
222
234
223
235
**Severity level**: 2
224
236
225
237
#### TA-000005: Latest TLS version should be used in your API App
226
238
227
239
API apps should require the latest TLS version.
228
240
229
-
**Recommendation**: To [enforce the latest TLS version](../app-service/configure-ssl-bindings.md#enforce-tls-versions), in the [Microsoft.Web/sites/config resource properties](/azure/templates/microsoft.web/sites/config-web?tabs=json#SiteConfig), add (or update) the *minTlsVersion* property, setting its value to `1.2`.
241
+
**Recommendation**: To [enforce the latest TLS version](../app-service/configure-ssl-bindings.md#enforce-tls-versions) in the [Microsoft.Web/sites/config resource properties](/azure/templates/microsoft.web/sites/config-web?tabs=json#SiteConfig), add (or update) the *minTlsVersion* property, setting its value to `1.2`.
230
242
231
243
**Severity level**: 1
232
244
@@ -248,7 +260,7 @@ For enhanced authentication security, use a managed identity. On Azure, managed
248
260
249
261
#### TA-000008: Remote debugging should be turned off for Function Apps
250
262
251
-
Remote debugging requires inbound ports to be opened on a function app. These ports become easy targets for compromise from various internetbased attacks. If you no longer need to use remote debugging, it should be turned off.
263
+
Remote debugging requires inbound ports to be opened on a function app. These ports become easy targets for compromise from various internet-based attacks. If you no longer need to use remote debugging, it should be turned off.
252
264
253
265
**Recommendation**: To disable remote debugging, in the [Microsoft.Web/sites/config resource properties](/azure/templates/microsoft.web/sites/config-web?tabs=json#SiteConfig), remove the *remoteDebuggingEnabled* property or update its value to `false`.
254
266
@@ -296,7 +308,7 @@ For enhanced authentication security, use a managed identity. On Azure, managed
296
308
297
309
#### TA-000014: Remote debugging should be turned off for Web Applications
298
310
299
-
Remote debugging requires inbound ports to be opened on a web application. These ports become easy targets for compromise from various internetbased attacks. If you no longer need to use remote debugging, it should be turned off.
311
+
Remote debugging requires inbound ports to be opened on a web application. These ports become easy targets for compromise from various internet-based attacks. If you no longer need to use remote debugging, it should be turned off.
300
312
301
313
**Recommendation**: To disable remote debugging, in the [Microsoft.Web/sites/config resource properties](/azure/templates/microsoft.web/sites/config-web?tabs=json#SiteConfig), remove the *remoteDebuggingEnabled* property or update its value to `false`.
302
314
@@ -417,7 +429,7 @@ Set the data retention for your SQL Server's auditing to storage account destina
417
429
418
430
#### TA-000029: Azure API Management APIs should use encrypted protocols only
419
431
420
-
Set the protocols property to only include HTTPs.
432
+
Set the protocols property to only include HTTPS.
421
433
422
434
**Recommendation**: To use encrypted protocols only, add (or update) the *protocols* property in the [Microsoft.ApiManagement/service/apis resource properties](/azure/templates/microsoft.apimanagement/service/apis?tabs=json), to only include HTTPS. Allowing any additional protocols (for example, HTTP, WS) is insecure.
423
435
@@ -427,12 +439,12 @@ Set the protocols property to only include HTTPs.
427
439
428
440
- Learn more about the [Template Best Practice Analyzer](https://github.com/Azure/template-analyzer).
429
441
430
-
In this tutorial you learned how to configure the Microsoft Security DevOps GitHub Action and Azure DevOps Extension to scan for only Infrastructure as Code misconfigurations.
442
+
In this tutorial you learned how to configure the Microsoft Security DevOps GitHub Action and Azure DevOps Extension to scan for Infrastructure as Code (IaC) security misconfigurations and how to view the results.
431
443
432
444
## Next steps
433
445
434
446
Learn more about [Defender for DevOps](defender-for-devops-introduction.md).
435
447
436
448
Learn how to [connect your GitHub](quickstart-onboard-github.md) to Defender for Cloud.
437
449
438
-
Learn how to [connect your Azure DevOps](quickstart-onboard-devops.md) to Defender for Cloud.
450
+
Learn how to [connect your Azure DevOps](quickstart-onboard-devops.md) to Defender for Cloud.
0 commit comments