Skip to content

Commit

Permalink
added Trivy scan to docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
akannan1087 committed Jan 9, 2025
1 parent 7456301 commit b49ca28
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,24 @@ stages:
containerRegistry: $(dockerRegistryServiceConnection)
tags: |
$(tag)
#Publish Build Information
- task: Bash@3
displayName: "Log Image Details"
inputs:
targetType: inline
script: |
echo "Pushed Image: $(containerRegistry)/$(imageRepository):$(tag)"
# Install Trivy Scanner on Agent
- task: Bash@3
displayName: "Install Trivy"
inputs:
targetType: inline
script: |
curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh
# Run Trivy Scan
- task: Bash@3
displayName: "Run Trivy Scan"
inputs:
targetType: inline
script: |
./bin/trivy image --severity HIGH,CRITICAL,MEDIUM --ignore-unfixed $(containerRegistry)/$(imageRepository):$(tag)

0 comments on commit b49ca28

Please sign in to comment.