trivy: Doesn't detect all config files particularly CloudFormation templates

Description

Trivy doesn’t detect all CloudFormation files existing in a directory when running the following command:

% trivy config ./deploy

What did you expect to happen?

Trivy should detect 4 .yaml files

├── deploy
    ├── cf-apigw-lambdas-stack.yaml
    ├── cf-monitoring.yaml
    ├── cf-s3-trust-store.yaml
    ├── cf-s3.yaml

What happened instead?

It detects 0 instead (in some projects where I tested this command it finds one or more files but not all)

Output of run with -debug:

% trivy config --debug ./deploy
2023-01-12T10:53:27.094+0200	DEBUG	Severities: ["UNKNOWN" "LOW" "MEDIUM" "HIGH" "CRITICAL"]
2023-01-12T10:53:27.135+0200	DEBUG	cache dir:  /Users/aigzha/Library/Caches/trivy
2023-01-12T10:53:27.135+0200	INFO	Misconfiguration scanning is enabled
2023-01-12T10:53:27.135+0200	DEBUG	Walk the file tree rooted at 'deploy' in parallel
2023-01-12T10:53:27.425+0200	DEBUG	OS is not detected.
2023-01-12T10:53:27.425+0200	INFO	Detected config files: 0

Output of trivy -v:

% trivy -v
Version: 0.36.1

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 25 (10 by maintainers)

Most upvoted comments

what do you consider “misconfig files” and what “scans files”? If a directory has one dockerfile and one kubernetes yaml, the message will say that trivy identified 2 config files. If the docker file has issues, then then those issues would be reported as findings under that file. does that make sense? Also, please explain how it related to the bug discussed in this issue otherwise we should move the discussion elsewhere