Skip to content

Commit 9329478

Browse files
Merge pull request #215071 from j0tr/patch-2
Update iac-vulnerabilities.md
2 parents a6bd1da + 8b164b2 commit 9329478

File tree

1 file changed

+42
-30
lines changed

1 file changed

+42
-30
lines changed

articles/defender-for-cloud/iac-vulnerabilities.md

Lines changed: 42 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,16 @@ ms.custom: ignite-2022
99

1010
# Discover misconfigurations in Infrastructure as Code (IaC)
1111

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.
1313

1414
## Prerequisites
1515

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:
17+
- [Microsoft Security DevOps GitHub action](github-action.md)
18+
- [Microsoft Security DevOps Azure DevOps extension](azure-devops-extension.md).
19+
- Ensure you have an IaC template in your repository.
1820

19-
## View the results of the IaC scan in GitHub
21+
## Configure IaC scanning and view the results in GitHub
2022

2123
1. Sign in to [GitHub](https://www.github.com).
2224

@@ -43,19 +45,19 @@ Once you have set up the Microsoft Security DevOps GitHub action or Azure DevOps
4345
4446
:::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.":::
4547
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.
4749
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.
4951
5052
1. Select `azuredeploy.json`.
5153

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.":::
5355

5456
1. Select **Raw**
5557

5658
1. Copy all the information in the file.
5759

58-
```Bash
60+
```json
5961
{
6062
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
6163
"contentVersion": "1.0.0.0",
@@ -144,25 +146,26 @@ Once you have set up the Microsoft Security DevOps GitHub action or Azure DevOps
144146

145147
:::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.":::
146148

147-
1. Select **Actions**.
148149

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.
150153

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).
152155

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
156157

157158
**To view the results of the IaC scan in Azure DevOps**
158159

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
160163

161-
1. Navigate to **Pipeline**.
164+
1. Select **Pipeline**.
162165

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.
164167

165-
1. Select **Edit**.
168+
1. **Edit** the pipeline configuration YAML file adding the following lines:
166169

167170
1. Add the following lines to the YAML file
168171

@@ -175,21 +178,30 @@ Once you have set up the Microsoft Security DevOps GitHub action or Azure DevOps
175178

176179
1. Select **Save**.
177180

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.
179184

180185
1. Select **Pipeline** > **`Your created pipeline`** to view the results of the IaC scan.
181186

182187
1. Select any result to see the details.
183188

184-
## Remediate PowerShell based rules:
189+
## View details and remediation information on IaC rules included with Microsoft Security DevOps
190+
191+
### PowerShell-based rules
185192

186193
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.
187194

188195
> [!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).
190197

191198
### JSON-Based Rules:
192199

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+
193205
#### TA-000001: Diagnostic logs in App Services should be enabled
194206

195207
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
200212

201213
#### TA-000002: Remote debugging should be turned off for API Apps
202214

203-
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.
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.
204216

205217
**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`.
206218

@@ -210,23 +222,23 @@ Remote debugging requires inbound ports to be opened on an API app. These ports
210222

211223
Enable FTPS enforcement for enhanced security.
212224

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.
214226

215227
**Severity level**: 1
216228

217229
#### TA-000004: API App Should Only Be Accessible Over HTTPS
218230

219231
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.
220232

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`.
222234

223235
**Severity level**: 2
224236

225237
#### TA-000005: Latest TLS version should be used in your API App
226238

227239
API apps should require the latest TLS version.
228240

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`.
230242

231243
**Severity level**: 1
232244

@@ -248,7 +260,7 @@ For enhanced authentication security, use a managed identity. On Azure, managed
248260

249261
#### TA-000008: Remote debugging should be turned off for Function Apps
250262

251-
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.
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.
252264

253265
**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`.
254266

@@ -296,7 +308,7 @@ For enhanced authentication security, use a managed identity. On Azure, managed
296308

297309
#### TA-000014: Remote debugging should be turned off for Web Applications
298310

299-
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.
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.
300312

301313
**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`.
302314

@@ -417,7 +429,7 @@ Set the data retention for your SQL Server's auditing to storage account destina
417429

418430
#### TA-000029: Azure API Management APIs should use encrypted protocols only
419431

420-
Set the protocols property to only include HTTPs.
432+
Set the protocols property to only include HTTPS.
421433

422434
**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.
423435

@@ -427,12 +439,12 @@ Set the protocols property to only include HTTPs.
427439

428440
- Learn more about the [Template Best Practice Analyzer](https://github.com/Azure/template-analyzer).
429441

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.
431443

432444
## Next steps
433445

434446
Learn more about [Defender for DevOps](defender-for-devops-introduction.md).
435447

436448
Learn how to [connect your GitHub](quickstart-onboard-github.md) to Defender for Cloud.
437449

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

Comments
 (0)