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

Binary copied to image omitted from SBOM #2828

Open
officerNordberg opened this issue May 1, 2024 · 4 comments
Open

Binary copied to image omitted from SBOM #2828

officerNordberg opened this issue May 1, 2024 · 4 comments
Labels
binary-analysis enhancement New feature or request good-first-issue Good for newcomers

Comments

@officerNordberg
Copy link

What happened:
SBOM is missing principle binary artifact from image
https://github.com/envoyproxy/envoy/blob/release/v1.27/ci/Dockerfile-envoy

ARG ENVOY_BINARY=envoy
ARG ENVOY_BINARY_PREFIX=
COPY --from=binary --chown=0:0 --chmod=755 \
    "/usr/local/bin/${ENVOY_BINARY_PREFIX}${ENVOY_BINARY}" /usr/local/bin/envoy

What you expected to happen:

NAME                 VERSION                       TYPE
adduser              3.118ubuntu2                  deb
apt                  2.0.10                        deb
base-files           11ubuntu5.8                   deb
base-passwd          3.5.47                        deb
bash                 5.0-6ubuntu1.2                deb
bash                 5.0.17                        binary
...
envoy                 1.27.5                        binary

Steps to reproduce the issue:
syft scan --from registry envoyproxy/envoy:v1.27-latest

Environment:

  • syft 1.3.0
  • OS: attempted on macOS and Centos
@officerNordberg officerNordberg added the bug Something isn't working label May 1, 2024
@tgerla
Copy link
Contributor

tgerla commented May 1, 2024

Hi @officerNordberg, thanks for the report! It doesn't look as though Syft currently knows anything about Envoy binaries. Syft's binary cataloger needs to know how to match each individual app: https://github.com/anchore/syft/blob/main/syft/pkg/cataloger/binary/classifiers.go

If you're interested in adding support for envoy detection, please let us know and we can help get started, otherwise I will move this into our backlog for future consideration. Thanks!

@tgerla tgerla added enhancement New feature or request good-first-issue Good for newcomers binary-analysis and removed bug Something isn't working labels May 1, 2024
@officerNordberg
Copy link
Author

officerNordberg commented May 1, 2024

@tgerla I'm your reluctant huckleberry. Sure, where do I start?

@tgerla
Copy link
Contributor

tgerla commented May 1, 2024

Great! First please take a quick look at our contributor's guide: https://github.com/anchore/syft/blob/main/CONTRIBUTING.md and our developer's guide: https://github.com/anchore/syft/blob/main/DEVELOPING.md -- you will probably want to make sure you can run Syft out of a checkout like step 4 in DEVELOPING.md.

From there, you will add a new classifier to the list here: https://github.com/anchore/syft/blob/main/syft/pkg/cataloger/binary/classifiers.go

You will need to determine a file glob and "EvidenceMatcher" which is basically a regular expression designed to reliably identify the binary artifact you're classifying. It's often helpful to run "strings" on your binary and look for possible fragments of plain text that you can match against. You can take a look at some of the other classifiers to get an idea of what to look for.

If you want, please feel free to join our Slack (https://get.anchore.com/join-anchore-community/) and post to the #syft-help channel and we will be happy to help you through the process.

Thank you for giving it a shot! Much appreciated.

@wagoodman
Copy link
Contributor

There are two approaches to getting arbitrary binaries detected by syft:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
binary-analysis enhancement New feature or request good-first-issue Good for newcomers
Projects
Status: Backlog
Development

No branches or pull requests

3 participants