Skip to content

Commit bf79ca6

Browse files
Merge pull request #264471 from dcurwin/wi2-195472-attack-path-gcp-jan29-2024
GCP attack paths
2 parents d58884c + ac5d9f6 commit bf79ca6

File tree

1 file changed

+43
-3
lines changed

1 file changed

+43
-3
lines changed

articles/defender-for-cloud/how-to-test-attack-path-and-security-explorer-with-vulnerable-container-image.md

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ If there are no entries in the list of attack paths, you can still test this fea
4949
az aks get-credentials --subscription <cluster-suid> --resource-group <your-rg> --name <your-cluster-name>
5050
```
5151
52-
1. Install [ngnix ingress Controller](https://docs.nginx.com/nginx-ingress-controller/installation/installation-with-helm/) :
52+
1. Install the [ngnix ingress Controller](https://docs.nginx.com/nginx-ingress-controller/installation/installation-with-helm/) :
5353
5454
```azurecli
5555
helm install ingress-controller oci://ghcr.io/nginxinc/charts/nginx-ingress --version 1.0.1
@@ -74,7 +74,7 @@ After you completed testing the attack path, investigate the created attack path
7474
7575
## AWS: Testing the attack path and security explorer using a mock vulnerable container image
7676
77-
1. Create ECR repository named *mdc-mock-0001*
77+
1. Create an ECR repository named *mdc-mock-0001*
7878
1. Go to your AWS account and choose **Command line or programmatic access**.
7979
1. Open a command line and choose **Option 1: Set AWS environment variables (Short-term credentials)**. Copy the credentials of the *AWS_ACCESS_KEY_ID*, *AWS_SECRET_ACCESS_KEY*, and *AWS_SESSION_TOKEN* environment variables.
8080
1. Run the following command to get the authentication token for your Amazon ECR registry. Replace `<REGION>` with the region of your registry. Replace `<ACCOUNT>` with your AWS account ID.
@@ -103,7 +103,7 @@ After you completed testing the attack path, investigate the created attack path
103103
kubectl get nodes
104104
```
105105
106-
1. Install [ngnix ingress Controller](https://docs.nginx.com/nginx-ingress-controller/installation/installation-with-helm/) :
106+
1. Install the [ngnix ingress Controller](https://docs.nginx.com/nginx-ingress-controller/installation/installation-with-helm/) :
107107
108108
```azurecli
109109
helm install ingress-controller oci://ghcr.io/nginxinc/charts/nginx-ingress --version 1.0.1
@@ -122,6 +122,46 @@ The Helm chart deploys resources onto your cluster that can be used to infer att
122122
123123
After you completed 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).
124124
125+
## GCP: Testing the attack path and security explorer using a mock vulnerable container image
126+
127+
1. In the GCP portal, search for **Artifact Registry**, and then create a GCP repository named *mdc-mock-0001*
128+
1. Follow [these instructions](https://cloud.google.com/artifact-registry/docs/docker/pushing-and-pulling) to push the image to your repository. Run these commands:
129+
130+
```docker
131+
docker pull alpine
132+
docker tag alpine <LOCATION>-docker.pkg.dev/<PROJECT_ID>/<REGISTRY>/<REPOSITORY>/mdc-mock-0001
133+
docker push <LOCATION>-docker.pkg.dev/<PROJECT_ID>/<REGISTRY>/<REPOSITORY>/mdc-mock-0001
134+
```
135+
136+
1. Go to the GCP portal. Then go to **Kubernetes Engine** > **Clusters**. Select the **Connect** button.
137+
1. Once connected, either run the command in the Cloud Shell or copy the connection command and run it on your machine:
138+
139+
```gcloud-cli
140+
gcloud container clusters get-credentials contra-bugbash-gcp --zone us-central1-c --project onboardingc-demo-gcp-1
141+
```
142+
143+
1. Verify the configuration. You can check if `kubectl` is correctly configured by running:
144+
145+
```gcloud-cli
146+
kubectl get nodes
147+
```
148+
149+
1. To install the Helm chart, follow these steps:
150+
151+
1. Under **Artifact registry** in the portal, go to the repository, and find the image URI under **Pull by digest**.
152+
1. Use the following command to install the Helm chart:
153+
154+
```gcloud-cli
155+
helm install dcspmcharts oci:/mcr.microsoft.com/mdc/stable/dcspmcharts --version 1.0.0 --namespace mdc-dcspm-demo --create-namespace --set image=<IMAGE_URI> --set distribution=GCP
156+
```
157+
158+
The Helm chart deploys resources onto your cluster that can be used to infer attack paths. It also includes the vulnerable image.
159+
160+
> [!NOTE]
161+
> After completing the above flow, it can take up to 24 hours to see results in the cloud security explorer and attack path.
162+
163+
After you completed 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).
164+
125165
## Find container posture issues with cloud security explorer
126166
127167
You can build queries in one of the following ways:

0 commit comments

Comments
 (0)