Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save CyprienLecallier/827a510a5a2eeaa9dac5019c284cfd1a to your computer and use it in GitHub Desktop.
Save CyprienLecallier/827a510a5a2eeaa9dac5019c284cfd1a to your computer and use it in GitHub Desktop.
steps:
- script: |
sudo apt-get install rpm
wget https://github.com/aquasecurity/trivy/releases/download/v$(trivyVersion)/trivy_$(trivyVersion)_Linux-64bit.deb
sudo dpkg -i trivy_$(trivyVersion)_Linux-64bit.deb
trivy -v
displayName: 'Download and install Trivy'
- task: CmdLine@2
displayName: "Run trivy scan"
inputs:
script: |
trivy image --exit-code 0 --severity LOW,MEDIUM,HIGH acr01.azurecr.io/image_name:$(Build.SourceVersion)
trivy image --exit-code 1 --severity CRITICAL acr01.azurecr.io/image_name:$(Build.SourceVersion)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment