Skip to content

Commit

Permalink
fix(alpine): add UID for removed packages (#7887)
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitriyLewen authored Nov 18, 2024
1 parent 58fdab2 commit 07915da
Show file tree
Hide file tree
Showing 3 changed files with 590 additions and 83 deletions.
2 changes: 2 additions & 0 deletions pkg/fanal/analyzer/imgconf/apk/apk.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"github.com/samber/lo"
"golang.org/x/xerrors"

"github.com/aquasecurity/trivy/pkg/dependency"
"github.com/aquasecurity/trivy/pkg/fanal/analyzer"
"github.com/aquasecurity/trivy/pkg/fanal/types"
)
Expand Down Expand Up @@ -134,6 +135,7 @@ func (a alpineCmdAnalyzer) parseConfig(apkIndexArchive *apkIndex, config *v1.Con
pkgs = a.resolveDependencies(apkIndexArchive, pkgs)
results := a.guessVersion(apkIndexArchive, pkgs, history.Created.Time)
for _, result := range results {
result.Identifier.UID = dependency.UID("", result)
uniqPkgs[result.Name] = result
}
}
Expand Down
Loading

0 comments on commit 07915da

Please sign in to comment.