From ceb4fd32faa1230d980ca0d1f6ef564947e36299 Mon Sep 17 00:00:00 2001 From: Simar Date: Fri, 31 Mar 2023 17:41:28 -0700 Subject: [PATCH] docs(cli): Improve glob documentation Signed-off-by: Simar --- docs/docs/vulnerability/examples/others.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/docs/vulnerability/examples/others.md b/docs/docs/vulnerability/examples/others.md index 7818add35be0..5bf2b561f6bb 100644 --- a/docs/docs/vulnerability/examples/others.md +++ b/docs/docs/vulnerability/examples/others.md @@ -8,7 +8,7 @@ If your image contains lock files which are not maintained by you, you can skip $ trivy image --skip-files "/Gemfile.lock" --skip-files "/var/lib/gems/2.5.0/gems/http_parser.rb-0.6.0/Gemfile.lock" quay.io/fluentd_elasticsearch/fluentd:v2.9.0 ``` -It's possible to specify globs as part of the value. +It's possible to specify globs as part of the value. ```bash $ trivy image --skip-files "./testdata/*/bar" . @@ -32,6 +32,10 @@ $ trivy image --skip-dirs "./testdata/*" . Will skip all subdirectories of the testdata directory. +!!! tip + Glob patters work with any trivy subcommand (image, config, etc.) and can be specified to skip both directories (with `--skip-dirs`) and files (with `--skip-files`). + + ## File patterns When a directory is given as an input, Trivy will recursively look for and test all files based on file patterns. The default file patterns are [here](../../misconfiguration/custom/index.md).