Trivy scan on selected files #8173
-
QuestionIssuesI want to scan only the go.mod file in the sbomTrivy folder using Trivy. However, instead of scanning just that file, Trivy scans the entire directory. ContextThe directory structure is as follows: .
├── go.mod
├── go.sum
├── main.go
├── sbomTrivy
│ ├── go.mod
│ ├── go.sum
│ └── yy.go I want to scan only sbomTrivy/go.mod.
QuestionWhy does using trivy fs --file-patterns "gomod:./sbomTrivy/go.mod" . cause Trivy to scan the whole directory instead of just the go.mod file in sbomTrivy? TargetFilesystem ScannerNone Output FormatNone ModeNone Operating Systemmac Version0.58 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 12 replies
-
Hi @pohanhuangtw ! The |
Beta Was this translation helpful? Give feedback.
Actually, introducing
--only-dirs
in addition to--skip-dirs
complicates usage. We need careful discussion about this enhancement. We cannot promise it will be included in the next version.