You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The new Conda integration in v.0.51.1 is currently not supporting pip-Dependencies within environment.yml-files, even though this is a full feature from Conda. In particular pip-dependencies in an environment.yml-file (as shown below) are not supported:
[conda] Unable to detect the dependency versions from `environment.yml` as those versions are not pinned. Use `conda env export` to pin versions.
Desired Behavior
All types of dependencies (conda and pip) should be detected in an environment.yml-file and be scanned correctly by trivy.
Actual Behavior
pip-dependencies are currently not detected correctly and can therefore be not scanned by the current approach.
Reproduction Steps
1. Create an environment.yml file with a pip-dependency (see example above)
2. Create conda environment
conda env update -f environment.yml
3. Export conda environment to get pinned versions
conda env export -n test-environment -f environment.yml
4. Create SBOM of directory residing the pinned environment.yml file:
trivy filesystem . --scanners vuln --timeout 10m --format cyclonedx >./reports/sbom-scan-vuln.cdx.json
(If I remove the pip-dependencies from the pinned environment.yml file, the above command works fine).
Target
SBOM
Scanner
Vulnerability
Output Format
CycloneDX
Mode
Standalone
Debug Output
2024-05-08T08:53:22+02:00 DEBUG ["cyclonedx""spdx""spdx-json""github"] automatically enables '--list-all-pkgs'.
2024-05-08T08:53:22+02:00 DEBUG Parsed severities severities=[UNKNOWN LOW MEDIUM HIGH CRITICAL]
2024-05-08T08:53:22+02:00 DEBUG Ignore statuses statuses=[]
2024-05-08T08:53:22+02:00 DEBUG Cache dir dir="/Users/michael/Library/Caches/trivy"
2024-05-08T08:53:22+02:00 DEBUG DB update was skipped because the local DB is the latest
2024-05-08T08:53:22+02:00 DEBUG DB info schema=2 updated_at=2024-05-08T06:12:21.400321152Z next_update=2024-05-08T12:12:21.400320861Z downloaded_at=2024-05-08T06:45:13.353111Z
2024-05-08T08:53:22+02:00 INFO Vulnerability scanning is enabled
2024-05-08T08:53:22+02:00 DEBUG Vulnerability type type=[os library]
2024-05-08T08:53:22+02:00 DEBUG Enabling misconfiguration scanners scanners=[azure-arm cloudformation dockerfile helm kubernetes terraform terraformplan-json terraformplan-snapshot]
2024-05-08T08:53:22+02:00 DEBUG [nuget] The nuget packages directory couldn't be found. License search disabledpanic: runtime error: index out of range [0] with length 0goroutine 39 [running]:github.com/aquasecurity/trivy/pkg/dependency/parser/conda/environment.(*Parser).parseDependency(0x14d0?, {0x0, 0x0}) /home/runner/work/trivy/trivy/pkg/dependency/parser/conda/environment/parse.go:89 +0x1d0gh.neting.cc/aquasecurity/trivy/pkg/dependency/parser/conda/environment.(*Parser).toLibrary(0x140027d2000, {{0x0?, 0x14003f27b01?}, 0x10213812c?}) /home/runner/work/trivy/trivy/pkg/dependency/parser/conda/environment/parse.go:59 +0x40gh.neting.cc/aquasecurity/trivy/pkg/dependency/parser/conda/environment.(*Parser).Parse(0x140027d2000, {0x10ac9b3d0, 0x14001e8cf30}) /home/runner/work/trivy/trivy/pkg/dependency/parser/conda/environment/parse.go:46 +0x268gh.neting.cc/aquasecurity/trivy/pkg/fanal/analyzer/language.Parse({0x1081c3fc2, 0x11}, {0x14002fa5e40, 0xf}, {0x10abfaf80?, 0x14001e8cf30?}, {0x10ac0fc40, 0x140027d2000}) /home/runner/work/trivy/trivy/pkg/fanal/analyzer/language/analyze.go:52 +0xacgh.neting.cc/aquasecurity/trivy/pkg/fanal/analyzer/language.Analyze({0x1081c3fc2?, 0x11?}, {0x14002fa5e40, 0xf}, {0x10ac9b3d0?, 0x14001e8cf30?}, {0x10ac0fc40?, 0x140027d2000?}) /home/runner/work/trivy/trivy/pkg/fanal/analyzer/language/analyze.go:20 +0x5cgh.neting.cc/aquasecurity/trivy/pkg/fanal/analyzer/language/conda/environment.environmentAnalyzer.Analyze({}, {0x0?, 0x0?}, {{0x16dcd75d1, 0x1}, {0x14002fa5e40, 0xf}, {0x10acb88a8, 0x140029bcd00}, {0x10ac9b3d0, ...}, ...}) /home/runner/work/trivy/trivy/pkg/fanal/analyzer/language/conda/environment/environment.go:25 +0xb0gh.neting.cc/aquasecurity/trivy/pkg/fanal/analyzer.AnalyzerGroup.AnalyzeFile.func1({0x10acacdc8?, 0x10e5b3a80?}, {0x10acaadd0?, 0x14001e8cf30?}) /home/runner/work/trivy/trivy/pkg/fanal/analyzer/analyzer.go:432 +0x184created by github.com/aquasecurity/trivy/pkg/fanal/analyzer.AnalyzerGroup.AnalyzeFile in goroutine 1 /home/runner/work/trivy/trivy/pkg/fanal/analyzer/analyzer.go:427 +0x3bc
Discussed in #6658
Originally posted by kutkopy May 8, 2024
Description
The new Conda integration in v.0.51.1 is currently not supporting pip-Dependencies within environment.yml-files, even though this is a full feature from Conda. In particular pip-dependencies in an environment.yml-file (as shown below) are not supported:
Even with pinned versions:
And lead to the following error:
Desired Behavior
All types of dependencies (conda and pip) should be detected in an environment.yml-file and be scanned correctly by trivy.
Actual Behavior
pip-dependencies are currently not detected correctly and can therefore be not scanned by the current approach.
Reproduction Steps
Target
SBOM
Scanner
Vulnerability
Output Format
CycloneDX
Mode
Standalone
Debug Output
Operating System
macOS 14.4.1 (but also on Ubuntu)
Version
Checklist
trivy image --reset
The text was updated successfully, but these errors were encountered: