anchore / anchore/syft

Add option to exclude packages introduced from a base layer

Open
#1,809 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Go
Stars
9.6k
Forks
962
Avg merge
23h 27m
Merged PRs (30d)
48

Description

What would you like to be added:

further options on the scope flag.

Why is this needed:

First, I am not sure if I properly understood. When we speak about layer, do we speak about container layers, e.g. from docker?
If yes, I wish I could scan only the components of the 'latest' / 'top' layer of my docker images.

Indeed, in our team, I built a hierarchy of docker images, where the Dockerfile already start with

FROM {someBaseImage}

so that I share a common 'debian-base' as 'lowest' layer on all my images.

Currently, the Debian packages are duplicated in all the SBOM of all images.
I wish I could avoid this duplication.

A possible workaround is a postprocessing script filtering out components by their layerId, but it is a bit tricky to find out which layerId I want to keep!

Skipping completely the Debian registery is not a clean workaround since I might have a Debian package installed only on my 'top layer'.

Possible related issue: https://github.com/anchore/syft/issues/435

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the scope flag and the related discussion in issue #435, then verify how Docker base and top layers are represented in generated SBOMs. Done means an option can exclude packages inherited from a base layer while retaining packages installed on the selected top layer, without relying on manual layerId postprocessing.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go
Domain
cli, devops
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.