Skip to content

Commit b49ca28

Browse files
committed
added Trivy scan to docker image
1 parent 7456301 commit b49ca28

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

azure-pipelines.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,24 @@ stages:
3636
containerRegistry: $(dockerRegistryServiceConnection)
3737
tags: |
3838
$(tag)
39+
#Publish Build Information
40+
- task: Bash@3
41+
displayName: "Log Image Details"
42+
inputs:
43+
targetType: inline
44+
script: |
45+
echo "Pushed Image: $(containerRegistry)/$(imageRepository):$(tag)"
46+
# Install Trivy Scanner on Agent
47+
- task: Bash@3
48+
displayName: "Install Trivy"
49+
inputs:
50+
targetType: inline
51+
script: |
52+
curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh
53+
# Run Trivy Scan
54+
- task: Bash@3
55+
displayName: "Run Trivy Scan"
56+
inputs:
57+
targetType: inline
58+
script: |
59+
./bin/trivy image --severity HIGH,CRITICAL,MEDIUM --ignore-unfixed $(containerRegistry)/$(imageRepository):$(tag)

0 commit comments

Comments
 (0)