Skip to content

Commit a4e3ba5

Browse files
Update container-image-mapping.md
1 parent db25aeb commit a4e3ba5

File tree

1 file changed

+36
-7
lines changed

1 file changed

+36
-7
lines changed

articles/defender-for-cloud/container-image-mapping.md

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,42 @@ The following is an example of an advanced query that utilizes container image m
4949
1. Add the container image mapping tool to your MSDO workflow:
5050

5151
```yml
52-
# Run analyzers
53-
- name: Run Microsoft Security DevOps Analysis
54-
uses: microsoft/security-devops-action@latest
55-
id: msdo
56-
with:
57-
include-tools: container-mapping
58-
```
52+
name: Build and Map Container Image
53+
54+
on: [push, workflow_dispatch]
55+
56+
jobs:
57+
build:
58+
runs-on: ubuntu-latest
59+
# Set Permissions
60+
permissions:
61+
contents: read
62+
id-token: write
63+
steps:
64+
- uses: actions/checkout@v3
65+
- uses: actions/setup-python@v4
66+
with:
67+
python-version: '3.8'
68+
# Set Authentication to Container Registry of Choice
69+
- name: Azure Container Registry Login
70+
uses: Azure/docker-login@v1
71+
with:
72+
login-server: <containerRegistryLoginServer>
73+
username: ${{ secrets.ACR_USERNAME }}
74+
password: ${{ secrets.ACR_PASSWORD }}
75+
# Build and Push Image
76+
- name: Build and Push the Docker image
77+
uses: docker/build-push-action@v2
78+
with:
79+
push: true
80+
tags: ${{ secrets.IMAGE_TAG }}
81+
file: Dockerfile
82+
# Run Analyzers
83+
- name: Run Microsoft Security DevOps Analysis
84+
uses: microsoft/security-devops-action@latest
85+
id: msdo
86+
with:
87+
include-tools: container-mapping
5988

6089
After building a container image in a GitHub workflow and pushing it to a registry, see the mapping by using the [Cloud Security Explorer](how-to-manage-cloud-security-explorer.md):
6190

0 commit comments

Comments
 (0)