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

Flag provided but not defined (-severity) since 0.23.0 #1656

Closed
TomCools opened this issue Jan 31, 2022 · 3 comments
Closed

Flag provided but not defined (-severity) since 0.23.0 #1656

TomCools opened this issue Jan 31, 2022 · 3 comments
Labels
triage/support Indicates an issue that is a support question.

Comments

@TomCools
Copy link

TomCools commented Jan 31, 2022

Description

Our build server has started failing. We use Trivy to scan, using Docker containers.
Since the new release of 0.23.0 on Docker hub (we are on :latest in our build server, a questionable choice but here we are), we are getting an error.

What did you expect to happen?

Trivy to recognize the Severity flag.

What happened instead?

Incorrect Usage. flag provided but not defined: -severity

NAME:
trivy - A simple and comprehensive vulnerability scanner for containers

USAGE:
trivy [global options] command [command options] target

VERSION:
0.23.0

This is weird, because we haven't changed our build scripts in a while, so it worked fine on 0.22.0.
Our script is using following command:

    aquasec/trivy \
    --severity HIGH,CRITICAL \
    --exit-code=0 \
    --format template --template "@contrib/junit.tpl" -o /trivy-report/junit-report.xml \
    --ignore-unfixed \
    --skip-dirs "${{ parameters.trivySkipDirs }}" \
    ${{ parameters.containerRegistryUrl }}/${{ parameters.name }}:${{ parameters.tag }}

After pinning our Docker container for Trivy back to tag 0.22.0, our build works again.

Additional details (base image name, container registry info...):

Happens on all images. For reference, the severity option is still in the "help" list.

@TomCools TomCools added the kind/bug Categorizes issue or PR as related to a bug. label Jan 31, 2022
@knqyf263 knqyf263 added triage/support Indicates an issue that is a support question. and removed kind/bug Categorizes issue or PR as related to a bug. labels Jan 31, 2022
@knqyf263
Copy link
Collaborator

Please see here.
#1515

@TomCools
Copy link
Author

Missed that notice. Thanks!

@TomCools
Copy link
Author

TomCools commented Feb 4, 2022

For those who find this issue. The solution was to add "image" to the command. (see line 2)

aquasec/trivy
image \
--severity HIGH,CRITICAL
--exit-code=0
--format template --template "@contrib/junit.tpl" -o /trivy-report/junit-report.xml
--ignore-unfixed
--skip-dirs "${{ parameters.trivySkipDirs }}"
${{ parameters.containerRegistryUrl }}/${{ parameters.name }}:${{ parameters.tag }}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage/support Indicates an issue that is a support question.
Projects
None yet
Development

No branches or pull requests

2 participants