Skip to content

fix: Ignore dpkg entries that have "deinstall" status#4231

Merged
kzantow merged 1 commit intoanchore:mainfrom
rkirk-nos:ignore_deinstall_status
Oct 23, 2025
Merged

fix: Ignore dpkg entries that have "deinstall" status#4231
kzantow merged 1 commit intoanchore:mainfrom
rkirk-nos:ignore_deinstall_status

Conversation

@rkirk-nos
Copy link
Contributor

Description

Ignore dpkg entries that have "deinstall" status indicating package has been removed but not purged.

When running dpkg -l these entries typically show as rc indicating the package has been removed but configuration still remains on the asset such as the following example

dpkg -l | grep -E "^rc"
rc  linux-image-6.14.0-1009-aws        6.14.0-1009.9~24.04.1                   amd64        Signed kernel image aws
rc  linux-image-6.14.0-1010-aws        6.14.0-1010.10~24.04.1                  amd64        Signed kernel image aws
rc  linux-image-6.8.0-1029-aws         6.8.0-1029.31                           amd64        Signed kernel image aws
rc  linux-image-6.8.0-1031-aws         6.8.0-1031.33                           amd64        Signed kernel image aws
rc  linux-modules-6.14.0-1009-aws      6.14.0-1009.9~24.04.1                   amd64        Linux kernel extra modules for version 6.14.0 on DESC
rc  linux-modules-6.14.0-1010-aws      6.14.0-1010.10~24.04.1                  amd64        Linux kernel extra modules for version 6.14.0 on DESC
rc  linux-modules-6.8.0-1029-aws       6.8.0-1029.31                           amd64        Linux kernel extra modules for version 6.8.0 on 64 bit x86 SMP
rc  linux-modules-6.8.0-1031-aws       6.8.0-1031.33                           amd64        Linux kernel extra modules for version 6.8.0 on 64 bit x86 SMP

Frequently this can be seen when scanning a host instance, rather than a container, where old kernel packages are automatically removed but not purged resulting in them being present in the SBOM and assigned vulnerabilities against these removed packages when performing a Grype scan.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • I have added unit tests that cover changed behavior
  • I have tested my code in common scenarios and confirmed there are no regressions
  • I have added comments to my code, particularly in hard-to-understand sections

…as been removed but not purged

Signed-off-by: Ross Kirk <ross.kirk@upwind.io>
@spiffcs spiffcs self-assigned this Sep 25, 2025
@spiffcs
Copy link
Contributor

spiffcs commented Sep 25, 2025

comments from community meeting - @spiffcs will review the notes from last week livestream where we discussed a config rule to add onto this feature, commit the config, and then add a review and get this over the line

@spiffcs
Copy link
Contributor

spiffcs commented Sep 26, 2025

👋 Apologies for the delay on this one from yesterday's meeting - we're going over what this might look like for grype users when grype is updated to use which ever syft this lands in. We're getting some extra opinions on the config option vs land as is and it fixes a whole bunch of FPs that otherwise people would not want. Will update and merge/contribute and review when we get a good answer on how to fit this change into grype 😄

@spiffcs
Copy link
Contributor

spiffcs commented Sep 26, 2025

cc @wagoodman for Monday where we can talk about the cataloger conventions and what it looks like having 4 cataloger constructors with 2 tasks when two of them are moving to deprecated status

@spiffcs spiffcs added this to OSS Sep 30, 2025
@spiffcs spiffcs moved this to In Progress in OSS Sep 30, 2025
@kzantow kzantow assigned kzantow and unassigned spiffcs Oct 23, 2025
@kzantow kzantow force-pushed the ignore_deinstall_status branch from 51159ce to 9b60b3e Compare October 23, 2025 20:06
Copy link
Contributor

@kzantow kzantow left a comment

Choose a reason for hiding this comment

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

We decided that this was indeed probably just a bug, and didn't need configuration, so I reverted the PR to your original change @rkirk-nos, thanks much for your contribution!

@kzantow kzantow merged commit d5ca1ad into anchore:main Oct 23, 2025
23 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in OSS Oct 23, 2025
@rkirk-nos
Copy link
Contributor Author

@kzantow appreciate all the efforts to help land the change, thanks everyone!

westonsteimel added a commit to anchore/vulnerability-match-labels that referenced this pull request Feb 2, 2026
…o longer considered

Due to the following PRs in syft, some matches which were previously TPs
should now be considered FPs:

- anchore/syft#4231
- anchore/syft#4558

Signed-off-by: Weston Steimel <author@code.w.steimel.me.uk>
westonsteimel added a commit to anchore/vulnerability-match-labels that referenced this pull request Feb 2, 2026
…o longer considered (#179)

Due to the following PRs in syft, some matches which were previously TPs
should now be considered FPs:

- anchore/syft#4231
- anchore/syft#4558

Signed-off-by: Weston Steimel <author@code.w.steimel.me.uk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

fix dpkg packages that are in deinstalled state should not be in SBOM

3 participants