Skip to content

Commit

Permalink
Update ci-schedule-imagescanning.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
zhzhuang-zju authored Oct 30, 2023
1 parent 5faa46f commit f6410e9
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/ci-schedule-imagescanning.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,25 +35,30 @@ jobs:
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- name: download trivy
run: |
sudo apt-get install trivy
- name: Build images from Dockerfile
run: |
export VERSION=${{ matrix.karmada-version }}
export REGISTRY="docker.io/karmada"
make images GOOS="linux" --directory=.
- name: download trivy
run: |
apt-get install trivy
export TRIVYVERSION=0.45.1
sodo apt-get update
sodu apt-get install trivy:$TRIVYVERSION
- name: Run Trivy vulnerability scanner
run: |
imageIds=(`docker images -q`)
mkdir trivy
for id in ${imageIds[@]}
do
image=$(docker images|grep $id| sed 's/[ ][ ]*/,/g')
IFS=","
imageInfo=($image)
imageref="${imageInfo[0]}:${imageInfo[1]}"
trivy image --format table --ignore-unfixed --vuln-type os,library --severity UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL $imageref
done
trivy image --format sarif --ignore-unfixed --vuln-type os,library --severity UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL --output trivy-$id.sarif $imageref
done
- name: display
run: |
ll trivy

0 comments on commit f6410e9

Please sign in to comment.