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

Document command line flag for config file location #1271

Closed
eslamkarim opened this issue May 5, 2023 · 4 comments · Fixed by #1274
Closed

Document command line flag for config file location #1271

eslamkarim opened this issue May 5, 2023 · 4 comments · Fixed by #1274
Labels
enhancement New feature or request

Comments

@eslamkarim
Copy link

What would you like to be added:
An extra custom place to search for .grype.yaml config file. it can be an environment variable for the path.

Why is this needed:
right now, the only places are static and in a ci/cd environment sometimes we want to make sure that the config file we specify is the one being used either it's in the shared directory or somewhere else maybe even a different config file for different steps (for a different ignore list of cve) etc

Additional context:
right now, the places grype searches for its configurations are.
.grype.yaml .grype/config.yaml ~/.grype.yaml <XDG_CONFIG_HOME>/grype/config.yaml

I am not sure if <XDG_CONFIG_HOME> is configurable or an env variable that we can change because if yes then that's exactly what we need.

@eslamkarim eslamkarim added the enhancement New feature or request label May 5, 2023
@kzantow
Copy link
Contributor

kzantow commented May 5, 2023

@eslamkarim you can use the --config / -c flag when running Grype to specify a config file. Does this not work for you for some reason?

@eslamkarim
Copy link
Author

Oh, i didn't know that existed to be honest so that's perfect then.
on the config file section, it only mentioned where it was looking for the file but didn't mention there is a flag

@kzantow
Copy link
Contributor

kzantow commented May 5, 2023

@eslamkarim yeah, I just noticed it's not mentioned in the docs -- I'll leave this issue open to get them updated. But you can see all the flags with grype --help

@kzantow kzantow changed the title configurable config file location Document command line flag for config file location May 5, 2023
@eslamkarim
Copy link
Author

thanks a lot for the help.

jneate added a commit to jneate/grype that referenced this issue May 5, 2023
Signed-off-by: James Neate <jamesmneate@gmail.com>
kzantow pushed a commit that referenced this issue May 5, 2023
Signed-off-by: James Neate <jamesmneate@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants