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/how-to-test-attack-path-and-security-explorer-with-vulnerable-container-image.md
+66-30Lines changed: 66 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,26 +8,21 @@ ms.date: 03/02/2026
8
8
9
9
# Attack path analysis and enhanced risk-hunting for containers
10
10
11
-
Attack path analysis is a graph-based algorithm that scans the cloud security graph. The scans expose paths that bad actors might exploit to breach your environment and reach your high-impact assets. Attack path analysis exposes attack paths and suggests recommendations for remediating issues that break the attack path and prevent a successful breach.
11
+
Attack path analysis identifies potential paths that attackers could use to reach high-impact resources in your environment. It analyzes relationships between resources and highlights issues that can be remediated to reduce risk.
12
12
13
-
You can explore and investigate [attack paths](how-to-manage-attack-path.md)by sorting them based on risk level, name, environment, risk factors, entry point, target, affected resources, and active recommendations. You can also explore cloud security graph Insights on the resource. Examples of Insight types include:
13
+
This article shows how to test attackpath analysis by deploying a mock vulnerable container image.
14
14
15
-
- Pod exposed to the internet
16
-
- Privileged container
17
-
- Pod uses host network
18
-
- Container image is vulnerable to remote code execution
15
+
# [Azure](#tab/azure)
19
16
20
-
## Test the attack path and security explorer using a mock vulnerable container image for each cloud provider
-[Defender CSPM enabled for your subscription](tutorial-enable-cspm-plan.md).
23
20
24
-
### Test the attack path and security explorer by using a mock vulnerable container image for Azure
21
+
- Access to an Azure Kubernetes Service (AKS) cluster.
25
22
26
-
If the list of attack paths has no entries, you can still test this feature by using a mock container image. Use the following steps to set up the test:
23
+
- An Azure Container Registry (ACR) that the cluster can access.
27
24
28
-
**Requirement:** An instance of Azure Container Registry (ACR) in the tested scope.
29
-
30
-
#### Import a mock vulnerable image to your Azure Container Registry
25
+
## Test the attack path and security explorer using a mock vulnerable container image
31
26
32
27
1. Pull a base image (for example, alpine) to your local environment by running the following command:
33
28
@@ -72,34 +67,51 @@ If the list of attack paths has no entries, you can still test this feature by u
- An Amazon Elastic Container Registry (ECR) repository that the cluster can access.
86
93
87
-
### Test the attack path and security explorer by using a mock vulnerable container image for AWS
94
+
## Test the attack path and security explorer using a mock vulnerable container image
95
+
96
+
1. Create an Amazon ECR repository named `mdc-mock-0001`.
88
97
89
-
1. Create an ECR repository named *mdc-mock-0001*.
90
98
1. In your AWS account, select **Command line or programmatic access**.
99
+
91
100
1. Select **Option 1: Set AWS environment variables (Short-term credentials)**.
101
+
92
102
1. Copy the values for the following credentials:
93
103
* *AWS_ACCESS_KEY_ID*
94
104
* *AWS_SECRET_ACCESS_KEY*
95
105
* *AWS_SESSION_TOKEN*
106
+
96
107
1. Run the following command to get the authentication token for your Amazon ECR registry. Replace `<REGION>` with the region of your registry and `<ACCOUNT>` with your AWS account ID.
### Test the attack path and security explorer by using a mock vulnerable container image for GCP
154
+
- [Defender CSPM enabled for your GCP project](tutorial-enable-cspm-plan.md).
155
+
156
+
- Access to a Google Kubernetes Engine (GKE) cluster.
157
+
158
+
- A Google Artifact Registry repository that the cluster can access.
159
+
160
+
## Test the attack path and security explorer using a mock vulnerable container image
141
161
142
162
1. Sign in to the GCP portal.
163
+
143
164
1. Search for **Artifact Registry**.
165
+
144
166
1. Create a GCP repository named *mdc-mock-0001*.
167
+
145
168
1. Follow the GCP documentation, [Push and pull images](https://cloud.google.com/artifact-registry/docs/docker/pushing-and-pulling), to push the image to your repository. Run these commands:
146
169
147
170
```docker
@@ -151,7 +174,9 @@ The Helm chart deploys resources onto your cluster that you can use to infer att
151
174
```
152
175
153
176
1. Go to **Kubernetes Engine** > **Clusters**.
177
+
154
178
1. Select the **Connect** button.
179
+
155
180
1. Run the following command in the Cloud Shell:
156
181
157
182
```gcloud-cli
@@ -174,22 +199,33 @@ The Helm chart deploys resources onto your cluster that you can use to infer att
> It can take up to 24 hours to see results in the cloud security explorer and attack path.
205
+
> It can take up to 24 hours for results to appear in Attack path analysis and Cloud Security Explorer.
182
206
183
-
After you finish testing the attack path, investigate the created attack path by going to **Attack path analysis**, and search for the attack path you created. For more information, see [Identify and remediate attack paths](how-to-manage-attack-path.md).
207
+
## View attack paths
184
208
185
-
### Find container posture issues with cloud security explorer
209
+
After deploying the mock scenario, you can view the generated attack path in **Microsoft Defender for Cloud**:
186
210
187
-
You can build queries in one of the following ways:
211
+
1. Sign in to the [Azure portal](https://portal.azure.com/).
212
+
213
+
1. Go to **Defender for Cloud** > **Attack path analysis**.
214
+
215
+
1. Locate the attack path related to the deployed resources.
216
+
217
+
Learn how to [identify and remediate attack paths](how-to-manage-attack-path.md).
188
218
189
-
- [Explore risks with built-in cloud security explorer templates](how-to-manage-cloud-security-explorer.md#query-templates)
190
-
- [Create custom queries with cloud security explorer](how-to-manage-cloud-security-explorer.md#build-a-query)
219
+
## Investigate container risks with Cloud Security Explorer
191
220
221
+
After deploying the mock vulnerable image, you can use Cloud Security Explorer to identify related risks and explore how they contribute to attack paths.
222
+
223
+
1. Sign in to the [Azure portal](https://portal.azure.com/).
224
+
225
+
1. Go to **Defender for Cloud** > **Cloud Security Explorer**.
226
+
227
+
You can build queries in one of the following ways:
0 commit comments