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

trivyignores does not support yaml/json and non-yaml files #284

Open
gamethis opened this issue Nov 20, 2023 · 5 comments
Open

trivyignores does not support yaml/json and non-yaml files #284

gamethis opened this issue Nov 20, 2023 · 5 comments

Comments

@gamethis
Copy link

Issue

The current version of the trivy action does not take into account that Trivy only supports YAML/JSON if the file has the suffix .yaml|.json
so when you put the following into the action parameters

trivyignores: "./.trivyignore.yaml"

it makes a file that is with out a .yaml|.json ending. This as a result makes trivy not read the file and ignore the input.

reproduction of issue

I have created a repo with the files to demonstrate this

https://github.com/gamethis/trivy_issues

you can see the scenario by running trivy.sh it will work.
if you run trivy_fail.sh it will simulate what the action does currently and will fail.

Desired Action outcome

Would like to see an action updated to either check for yaml|json and add another --ignorefile .trivyignores.yaml to use
or an input parameter that will allow for yaml|json style ignore files.

@cswilliams
Copy link

I would also love to see this added. I would like to use the --ignorefile option for ignoring some false positives from the secret scanner. While I could use the non yaml .trivyignore, it doesn't support ignoring by file path like the yaml version does (but please correct me if I'm wrong).

@tkatila
Copy link

tkatila commented Jan 17, 2024

Yes please.

@loljawn
Copy link

loljawn commented Jan 25, 2024

Agreed, would like support for yaml ignore files

Edit: current version is 0.48.1 where yaml support was added 0.45. it should be supported.

@jvassbo
Copy link

jvassbo commented Feb 7, 2024

You can bypass this problem by using configfile trivy-config: trivy.yaml and define ignorefile: .trivyignore.yaml here.

@vdavydenko-asrc-core
Copy link

Yeah, this is needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants