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

fix(sbom): attach nested packages to Application #8144

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

DmitriyLewen
Copy link
Contributor

Description

There is a problem with decoding nested packages.
We create 2 attachments for them (see #8143).

This PR recursively checks all related packages and associates them with an attachment.

Example (test file packages:
Before:

➜ trivy -q rootfs -f cyclonedx -o report.cdx.json ./pkg/dependency/parser/golang/binary/testdata/test.elf && trivy -q sbom ./report.cdx.json -f json --list-all-pkgs | grep Target 
      "Target": "",
      "Target": "test.elf",

After:

➜ trivy -q rootfs -f cyclonedx -o report.cdx.json ./pkg/dependency/parser/golang/binary/testdata/test.elf && ./trivy -q sbom ./report.cdx.json -f json --list-all-pkgs | grep Target
      "Target": "test.elf",

Related issues

Checklist

  • I've read the guidelines for contributing to this repository.
  • I've followed the conventions in the PR title.
  • I've added tests that prove my fix is effective or that my feature works.
  • I've updated the documentation with the relevant information (if needed).
  • I've added usage information (if the PR introduces new options)
  • I've included a "before" and "after" example to the description (if the PR is a user interface change).

@DmitriyLewen DmitriyLewen self-assigned this Dec 20, 2024
Comment on lines +141 to +146
"dependsOn": [
"pkg:golang/github.com/aquasecurity/[email protected]",
"pkg:golang/github.com/aquasecurity/[email protected]",
"pkg:golang/github.com/aquasecurity/test",
"pkg:golang/golang.org/x/[email protected]"
]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These dependencies will be changed after #8104

So this should be changed in one of these PRs

@DmitriyLewen DmitriyLewen marked this pull request as ready for review December 20, 2024 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug(sbom): multiple Results for one package with root relationship for sbom mode
1 participant