Skip to content

Commit ee2bb9c

Browse files
authored
Merge pull request #241330 from AlizaBernstein/WI-97774-testing-attack-path-and-security-explorer
WI-97774-testing-attack-path-and-security-explorer
2 parents b27b760 + ea9b735 commit ee2bb9c

10 files changed

+112
-2
lines changed

articles/defender-for-cloud/TOC.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,8 @@
302302
href: how-to-enable-agentless-containers.md
303303
- name: View and remediate vulnerability assessment findings for registry images
304304
href: view-and-remediate-vulnerability-assessment-findings.md
305+
- name: How to test the attack path and security explorer using a vulnerable container image
306+
href: how-to-test-attack-path-and-security-explorer-with-vulnerable-container-image.md
305307
- name: View and remediate vulnerabilities for images running on your AKS clusters
306308
href: view-and-remediate-vulnerabilities-for-images-running-on-aks.md
307309
- name: Disable vulnerability assessment findings on Container registry images

articles/defender-for-cloud/how-to-enable-agentless-containers.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: How-to enable Agentless Container posture in Microsoft Defender CSPM
33
description: Learn how to onboard Agentless Containers
44
ms.service: defender-for-cloud
55
ms.topic: how-to
6-
ms.date: 06/01/2023
6+
ms.date: 06/13/2023
77
---
88

99
# Onboard Agentless Container posture in Defender CSPM
@@ -96,7 +96,8 @@ You can customize your vulnerability assessment experience by exempting manageme
9696
## Next Steps
9797
9898
- Learn more about [Trusted Access](/azure/aks/trusted-access-feature).
99-
- Learn how to [view and remediate vulnerability assessment findings for registry images and running images](view-and-remediate-vulnerability-assessment-findings.md).
99+
- Learn how to [view and remediate vulnerability assessment findings for registry images](view-and-remediate-vulnerability-assessment-findings.md).
100+
- Learn how to [Test the Attack Path and Security Explorer using a vulnerable container image](how-to-test-attack-path-and-security-explorer-with-vulnerable-container-image.md)
100101
- Learn how to [create an exemption](exempt-resource.md) for a resource or subscription.
101102
- Learn more about [Cloud Security Posture Management](concept-cloud-security-posture-management.md).
102103
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
---
2+
title: How-to test the attack path and cloud security explorer using a vulnerable container image in Microsoft Defender for Cloud
3+
description: Learn how to test the attack path and security explorer using a vulnerable container image
4+
ms.service: defender-for-cloud
5+
ms.topic: how-to
6+
ms.date: 07/17/2023
7+
---
8+
9+
# Testing the Attack Path and Security Explorer using a vulnerable container image
10+
11+
## Observing potential threats in the attack path experience
12+
13+
Attack path analysis is a graph-based algorithm that scans the cloud security graph. The scans expose exploitable paths that attackers may use to breach your environment to reach your high-impact assets. Attack path analysis exposes attack paths and suggests recommendations as to how best remediate issues that will break the attack path and prevent successful breach.
14+
15+
Explore and investigate [attack paths](how-to-manage-attack-path.md) by sorting them based on name, environment, path count, and risk categories. Explore cloud security graph Insights on the resource. Examples of Insight types are:
16+
17+
- Pod exposed to the internet
18+
- Privileged container
19+
- Pod uses host network
20+
- Container image is vulnerable to remote code execution
21+
22+
## Testing the attack path and security explorer using a mock vulnerable container image
23+
24+
If there are no entries in the list of attack paths, you can still test this feature by using a mock container image. Use the following steps to set up the test:
25+
26+
**Requirement:** An instance of Azure Container Registry (ACR) in the tested scope.
27+
28+
1. Import a mock vulnerable image to your Azure Container Registry:
29+
30+
1. Run the following command in Cloud Shell:
31+
32+
```
33+
az acr import --name $MYACR --source DCSPMtesting.azurecr.io/mdc-mock-0001 --image mdc-mock-0001
34+
```
35+
36+
1. If your AKS isn't attached to your ACR, use the following Cloud Shell command line to point your AKS instance to pull images from the selected ACR:
37+
38+
```
39+
az aks update -n myAKSCluster -g myResourceGroup --attach-acr <acr-name>
40+
41+
1. Authenticate your Cloud Shell session to work with the cluster:
42+
43+
```
44+
az aks get-credentials --subscription <cluster-suid> --resource-group <your-rg> --name <your-cluster-name>
45+
46+
1. Verify success by doing the following steps:
47+
48+
- Look for an entry with **mdc-dcspm-demo** as namespace
49+
- In the **Workloads-> Deployments** tab, verify “pod” created 3/3 and **dcspmcharts-ingress-nginx-controller** 1/1.
50+
- In services and ingresses look for-> services **service**, **dcspmcharts-ingress-nginx-controller and dcspmcharts-ingress-nginx-controller-admission**. In the ingress tab, verify one **ingress** is created with an IP address and nginx class.
51+
52+
1. Deploy the mock vulnerable image to expose the vulnerable container to the internet by running the following command:
53+
54+
```
55+
helm install dcspmcharts oci://dcspmtesting.azurecr.io/dcspmcharts --version 1.0.0 --namespace mdc-dcspm-demo --create-namespace --set registry=<your-registry>
56+
```
57+
58+
> [!NOTE]
59+
> After completing the above flow, it can take up to 24 hours to see results in the cloud security explorer and attack path.
60+
61+
## Investigate internet exposed Kubernetes pods
62+
63+
You can build queries in one of the following ways:
64+
65+
- [Find the security issue under attack paths](#find-the-security-issue-under-attack-paths)
66+
- [Explore risks with built-in cloud security explorer templates](#explore-risks-with-cloud-security-explorer-templates)
67+
- [Create custom queries with cloud security explorer](#create-custom-queries-with-cloud-security-explorer)
68+
69+
### Find the security issue under attack paths
70+
71+
1.Go to **Recommendations** in the Defender for Cloud menu.
72+
1. Select the **Attack Path** link to open the attack paths view.
73+
74+
:::image type="content" source="media/how-to-test-attack-path/attack-path.png" alt-text="Screenshot of showing where to select Attack Path." lightbox="media/how-to-test-attack-path/attack-path.png":::
75+
76+
1. Locate the entry that details this security issue under “Internet exposed Kubernetes pod is running a container with high severity vulnerabilities.”
77+
78+
:::image type="content" source="media/how-to-test-attack-path/attack-path-kubernetes-pods-vulnerabilities.png" alt-text="Screenshot showing the security issue details." lightbox="media/how-to-test-attack-path/attack-path-kubernetes-pods-vulnerabilities.png":::
79+
80+
### Explore risks with cloud security explorer templates
81+
82+
1. From the Defender for Cloud overview page, open the cloud security explorer.
83+
84+
1. Some out of the box templates for Kubernetes appear. Select one of the templates:
85+
86+
- **Azure Kubernetes pods running images with high severity vulnerabilities**
87+
- **Kubernetes namespaces contain vulnerable pods**
88+
89+
:::image type="content" source="media/how-to-test-attack-path/select-template.png" alt-text="Screenshot showing where to select templates." lightbox="media/how-to-test-attack-path/select-template.png":::
90+
91+
1. Select **Open query**; the template builds the query in the upper portion of the screen. Select **Search** to view the results.
92+
93+
:::image type="content" source="media/how-to-test-attack-path/query-builder-search.png" alt-text="Screenshot that shows the query built and where to select search." lightbox="media/how-to-test-attack-path/query-builder-search.png":::
94+
95+
### Create custom queries with cloud security explorer
96+
97+
You can also create your own custom queries. The following example shows a search for pods running container images that are vulnerable to remote code execution.
98+
99+
:::image type="content" source="media/how-to-test-attack-path/custom-query-search.png" alt-text="Screenshot that shows a custom query." lightbox="media/how-to-test-attack-path/custom-query-search.png":::
100+
101+
The results are listed below the query.
102+
103+
:::image type="content" source="media/how-to-test-attack-path/custom-query-results.png" alt-text="Screenshot that shows the results from a custom query." lightbox="media/how-to-test-attack-path/custom-query-results.png":::
104+
105+
## Next steps
106+
107+
- Learn more about the Defender for Cloud [Defender plans](defender-for-cloud-introduction.md#protect-cloud-workloads).
43 KB
Loading
91.1 KB
Loading
50.5 KB
Loading
86.4 KB
Loading
87.1 KB
Loading
43.9 KB
Loading
122 KB
Loading

0 commit comments

Comments
 (0)