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/container-image-mapping.md
+36-7Lines changed: 36 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,13 +49,42 @@ The following is an example of an advanced query that utilizes container image m
49
49
1. Add the container image mapping tool to your MSDO workflow:
50
50
51
51
```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
59
88
60
89
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):
0 commit comments