Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trivy allow alt db #391

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ inputs:
docker-host:
description: 'unix domain socket path to use for docker scanning, ex. unix:///var/run/docker.sock'
required: false
db-repository:
description: 'vulnerability DB repository address, ex. my-registry.example.com/mirrors/aquasecurity/trivy-db'
required: false
default: ''

runs:
using: 'docker'
Expand Down Expand Up @@ -125,5 +129,6 @@ runs:
- '-u ${{ inputs.github-pat }}'
- '-v ${{ inputs.trivy-config }}'
- '-x ${{ inputs.tf-vars }}'
- '-z ${{ inputs.limit-severities-for-sarif }}'
- '-y ${{ inputs.docker-host }}'
- '-z ${{ inputs.limit-severities-for-sarif }}'
- '-0 ${{ inputs.db-repository }}'
9 changes: 8 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
set -e
while getopts "a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:p:q:r:s:t:u:v:x:y:z:" o; do
while getopts "a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:p:q:r:s:t:u:v:x:y:z:0:" o; do
case "${o}" in
a)
export scanType=${OPTARG}
Expand Down Expand Up @@ -77,6 +77,9 @@ while getopts "a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:p:q:r:s:t:u:v:x:y:z:" o; do
z)
export limitSeveritiesForSARIF=${OPTARG}
;;
0)
export dbRepository=${OPTARG}
;;
esac
done

Expand Down Expand Up @@ -184,6 +187,10 @@ if [ "$skipFiles" ];then
done
fi

if [ $dbRepository ]; then
ARGS="$ARGS --db-repository $dbRepository"
fi

trivyConfig=$(echo $trivyConfig | tr -d '\r')
# To make sure that uploda GitHub Dependency Snapshot succeeds, disable the script that fails first.
set +e
Expand Down
Loading