-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a4c962d
commit 4e8ee2c
Showing
1 changed file
with
4 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,38 +48,7 @@ jobs: | |
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup oras | ||
run: | | ||
VERSION="1.2.0" | ||
curl -LO "https://github.com/oras-project/oras/releases/download/v${VERSION}/oras_${VERSION}_linux_amd64.tar.gz" | ||
mkdir -p oras-install/ | ||
tar -zxf oras_${VERSION}_*.tar.gz -C oras-install/ | ||
sudo mv oras-install/oras /usr/local/bin/ | ||
rm -rf oras_${VERSION}_*.tar.gz oras-install/ | ||
- name: Get current date | ||
id: date | ||
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT | ||
|
||
- name: Download and extract the vulnerability DB | ||
run: | | ||
mkdir -p $GITHUB_WORKSPACE/.cache/trivy/db | ||
oras pull ghcr.io/aquasecurity/trivy-db:2 | ||
tar -xzf db.tar.gz -C $GITHUB_WORKSPACE/.cache/trivy/db | ||
rm db.tar.gz | ||
- name: Download and extract the Java DB | ||
run: | | ||
mkdir -p $GITHUB_WORKSPACE/.cache/trivy/java-db | ||
oras pull ghcr.io/aquasecurity/trivy-java-db:1 | ||
tar -xzf javadb.tar.gz -C $GITHUB_WORKSPACE/.cache/trivy/java-db | ||
rm javadb.tar.gz | ||
- name: Trivy Scan | ||
shell: bash | ||
run: | | ||
DIR=`mktemp -d` | ||
curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b ${DIR} v0.51.2 | ||
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin | ||
export TRIVY_CACHE=$GITHUB_WORKSPACE/.cache/trivy | ||
${DIR}/trivy fs --cache-dir ${TRIVY_CACHE} --exit-code 1 . | ||
- name: Run Trivy vulnerability scanner to scan repo | ||
uses: aquasecurity/[email protected] | ||
with: | ||
scan-type: 'fs' |