Compare commits

..

2 Commits
0.2.0 ... 0.2.1

Author SHA1 Message Date
Masayoshi Mizutani
8f4c7160b4 feat: Add list-all-pkgs option (#88) 2021-12-16 08:31:49 -08:00
Carol Valencia
81cc8cd841 chore: update trivy version - fixed sarif (#87) 2021-12-10 10:18:11 -08:00
4 changed files with 16 additions and 2 deletions

View File

@@ -1,4 +1,4 @@
FROM aquasec/trivy:0.21.0
FROM aquasec/trivy:0.21.2
COPY entrypoint.sh /
RUN apk --no-cache add bash
RUN chmod +x /entrypoint.sh

View File

@@ -401,6 +401,7 @@ Following inputs can be used as `step.with` keys:
| `cache-dir` | String | | Cache directory |
| `timeout` | String | `2m0s` | Scan timeout duration |
| `ignore-policy` | String | | Filter vulnerabilities with OPA rego language |
| `list-all-pkgs` | String | | Output all packages regardless of vulnerability |
[release]: https://github.com/aquasecurity/trivy-action/releases/latest
[release-img]: https://img.shields.io/github/release/aquasecurity/trivy-action.svg?logo=github

View File

@@ -69,6 +69,10 @@ inputs:
description: 'hide progress output'
required: false
default: 'true'
list-all-pkgs:
description: 'output all packages regardless of vulnerability'
required: false
default: 'false'
runs:
using: 'docker'
image: "Dockerfile"
@@ -90,3 +94,4 @@ runs:
- '-o ${{ inputs.ignore-policy }}'
- '-p ${{ inputs.hide-progress }}'
- '-q ${{ inputs.skip-files }}'
- '-r ${{ inputs.list-all-pkgs }}'

View File

@@ -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:" o; do
while getopts "a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:p:q:r:" o; do
case "${o}" in
a)
export scanType=${OPTARG}
@@ -53,6 +53,9 @@ while getopts "a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:p:q:" o; do
q)
export skipFiles=${OPTARG}
;;
r)
export listAllPkgs=${OPTARG}
;;
esac
done
@@ -115,6 +118,11 @@ fi
if [ "$hideProgress" == "true" ];then
ARGS="$ARGS --no-progress"
fi
listAllPkgs=$(echo $listAllPkgs | tr -d '\r')
if [ "$listAllPkgs" == "true" ];then
ARGS="$ARGS --list-all-pkgs"
fi
if [ "$skipFiles" ];then
for i in $(echo $skipFiles | tr "," "\n")
do