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

refactor(template): change source_location in github template for aggregated packages #6008

Closed
DmitriyLewen opened this issue Jan 26, 2024 Discussed in #5998 · 0 comments · Fixed by #5999
Closed

refactor(template): change source_location in github template for aggregated packages #6008

DmitriyLewen opened this issue Jan 26, 2024 Discussed in #5998 · 0 comments · Fixed by #5999
Labels
scan/sbom Issues relating to SBOM

Comments

@DmitriyLewen
Copy link
Contributor

Description

We use target field for source_location in github template.
But we aggregate some packages:

func aggregate(detail *ftypes.ArtifactDetail) {
var apps []ftypes.Application
aggregatedApps := map[ftypes.LangType]*ftypes.Application{
ftypes.PythonPkg: {Type: ftypes.PythonPkg},
ftypes.CondaPkg: {Type: ftypes.CondaPkg},
ftypes.GemSpec: {Type: ftypes.GemSpec},
ftypes.NodePkg: {Type: ftypes.NodePkg},
ftypes.Jar: {Type: ftypes.Jar},
}
for _, app := range detail.Applications {
a, ok := aggregatedApps[app.Type]
if !ok {
apps = append(apps, app)
continue
}
a.Libraries = append(a.Libraries, app.Libraries...)
}
for _, app := range aggregatedApps {
if len(app.Libraries) > 0 {
apps = append(apps, *app)
}
}
// Overwrite Applications
detail.Applications = apps
}

For these packages target is Python, Java, etc.
This is problem for GitHub UI - #5998.
We need to use Results.Packages.FilePath for these packages.

But filePath for image scans can be large (e.g. "FilePath": "usr/local/lib/python3.12/site-packages/pip-23.2.1.dist-info/METADATA").
It might make sense to use image name for image mode.

Discussed in #5998

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scan/sbom Issues relating to SBOM
Projects
None yet
1 participant