Skip to content

Commit

Permalink
ci: enable library vuln type for provider-azure image scan
Browse files Browse the repository at this point in the history
Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>
  • Loading branch information
aramase committed May 4, 2022
1 parent 5fbdbc7 commit 412643b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
21 changes: 12 additions & 9 deletions .pipelines/templates/scan-images.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
steps:
- script: |
# install trivy
wget https://github.com/aquasecurity/trivy/releases/download/v${TRIVY_VERSION:-0.24.4}/trivy_${TRIVY_VERSION:-0.24.4}_Linux-64bit.tar.gz
tar zxvf trivy_${TRIVY_VERSION:-0.24.4}_Linux-64bit.tar.gz
wget https://github.com/aquasecurity/trivy/releases/download/v${TRIVY_VERSION:-0.27.1}/trivy_${TRIVY_VERSION:-0.27.1}_Linux-64bit.tar.gz
tar zxvf trivy_${TRIVY_VERSION:-0.27.1}_Linux-64bit.tar.gz
# scan provider image
export REGISTRY="e2e"
export IMAGE_VERSION="test"
OUTPUT_TYPE=docker make container arc-conformance-container
make container arc-conformance-container
./trivy image --reset
# show all vulnerabilities in the logs
./trivy image "${REGISTRY}/provider-azure:${IMAGE_VERSION}"
./trivy image --vuln-type os --exit-code 1 --ignore-unfixed --severity MEDIUM,HIGH,CRITICAL "${REGISTRY}/provider-azure:${IMAGE_VERSION}" || exit 1
./trivy image --vuln-type os,library "${REGISTRY}/provider-azure:${IMAGE_VERSION}"
./trivy image --vuln-type os,library --exit-code 1 --ignore-unfixed --severity MEDIUM,HIGH,CRITICAL "${REGISTRY}/provider-azure:${IMAGE_VERSION}" || exit 1
./trivy image "${REGISTRY}/provider-azure-arc-conformance:${IMAGE_VERSION}-linux-amd64"
./trivy image --vuln-type os --exit-code 1 --ignore-unfixed --severity MEDIUM,HIGH,CRITICAL "${REGISTRY}/provider-azure-arc-conformance:${IMAGE_VERSION}-linux-amd64" || exit 1
displayName: "Scan images for vulnerability"
env:
REGISTRY: e2e
IMAGE_VERSION: test
OUTPUT_TYPE: docker
TRIVY_VERSION: $(TRIVY_VERSION)
3 changes: 0 additions & 3 deletions .pipelines/templates/unit-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ jobs:
timeoutInMinutes: 10
workspace:
clean: all
variables:
- name: TRIVY_VERSION
value: 0.19.2
steps:
- template: scan-images.yaml
- job: lint
Expand Down

0 comments on commit 412643b

Please sign in to comment.