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

Add attestations for binaries compiled from source #669

Merged
merged 3 commits into from
Oct 3, 2023

Conversation

LaurentGoderre
Copy link
Member

No description provided.

Copy link

@whalelines whalelines left a comment

Choose a reason for hiding this comment

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

A few questions/suggestions.

It would be interesting to know if there is a generic package PURL, i.e., that is not tied to any distribution or GitHub.

Dockerfile-alpine.template Outdated Show resolved Hide resolved
Dockerfile-alpine.template Outdated Show resolved Hide resolved
Dockerfile-alpine.template Outdated Show resolved Hide resolved
Dockerfile-alpine.template Outdated Show resolved Hide resolved
Dockerfile-ubuntu.template Outdated Show resolved Hide resolved
Copy link

@whalelines whalelines left a comment

Choose a reason for hiding this comment

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

If we are adding the syntax directive to the alpine-variant Dockerfile, should we not also add it to the debian-variant Dockerfile?

Dockerfile-alpine.template Outdated Show resolved Hide resolved
Dockerfile-alpine.template Outdated Show resolved Hide resolved
Dockerfile-alpine.template Outdated Show resolved Hide resolved
Dockerfile-ubuntu.template Outdated Show resolved Hide resolved
Dockerfile-ubuntu.template Outdated Show resolved Hide resolved
Dockerfile-ubuntu.template Outdated Show resolved Hide resolved
Copy link

@neersighted neersighted left a comment

Choose a reason for hiding this comment

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

Previously left in draft as @whalelines beat me to it.

A couple concerns, both related to form and substance:

  • Attributing the installed openssl/erlang to packages seems incorrect to me; when sourced from a distribution even the "same" version can be wildly different, as patching upstream software (and having drastically different opinions at times) is the name of the game. It seems misleading at best, and dangerous (if scanners are blindly trusted) at worst to do so.
  • The boilerplate is pretty long/brutal, and it seems like 99% of this should be the same across any DOI. Could this be factored into a helper/generic function of bashbrew, such that this is both DRY and any knowledge of how to properly construct these JSON segments is centralized in once place/updated uniformly?
  • It feels like a PACKAGE-MANAGER ref may not be most correct here in any case; since there is not a package manager involved. While a new generic/doi namespace could be constructed and a matching package feed used, that will require scanners to have knowledge of both. Knowing that, maybe an OTHER reference would be more appropriate, as it would make it clear that a "special" DOI advisory feed is in use? (ref: https://spdx.github.io/spdx-spec/v2.3/package-information/#7213-examples)

@LaurentGoderre
Copy link
Member Author

@neersighted I was thinking of making into some kind of modular template but didn't know if was to be part od the first pass or after

@tianon
Copy link
Member

tianon commented Sep 29, 2023

I think we're going to have a really hard time convincing maintainers who aren't us to add and maintain files like this (even for us, hand maintaining SPDX files feels really dangerous and error prone 😅).

Is there some way we could supplement the scanner to learn how to recognize the versions of the software in various official images? Then we could centralize logic like detecting gosu correctly, for example (which would allow us to finally probably VEX its false positive CVEs out), and could maintain that code separately from the images themselves (especially important as there isn't a strong direct benefit to the image maintainers for creating and updating these documents, so it's going to be a tough sell to convince them to do so).

@whalelines
Copy link

whalelines commented Sep 30, 2023

@LaurentGoderre is working on a template for these SPDX files to make it easier for everyone to incorporate and we can continue to work on tooling to make things easier for maintainers until the benefits you mention, e.g., proper CVE identification and exclusion, and others outweigh what should be the one-time effort to add these. That said, it's likely we will have to assist with that for some maintainers, i.e., provide PRs to the upstream Dockerfiles.

@LaurentGoderre LaurentGoderre force-pushed the more-sbom-2 branch 2 times, most recently from b872f06 to 5619abb Compare October 3, 2023 13:20
@LaurentGoderre
Copy link
Member Author

Depends on docker-library/bashbrew#85

Copy link

@whalelines whalelines left a comment

Choose a reason for hiding this comment

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

LGTM

@LaurentGoderre LaurentGoderre merged commit b015404 into docker-library:master Oct 3, 2023
17 checks passed
@LaurentGoderre LaurentGoderre deleted the more-sbom-2 branch October 3, 2023 17:37
docker-library-bot added a commit to docker-library-bot/official-images that referenced this pull request Oct 3, 2023
Changes:

- docker-library/rabbitmq@b015404: Merge pull request docker-library/rabbitmq#669 from LaurentGoderre/more-sbom-2
- docker-library/rabbitmq@1078026: Merge pull request docker-library/rabbitmq#668 from LaurentGoderre/more-sbom
- docker-library/rabbitmq@fbcfd9a: Added licenses to attestation of binaries compiled from source
- docker-library/rabbitmq@215db22: fixup
- docker-library/rabbitmq@9f71069: Add attestations for binaries compiled from source
docker-library-bot added a commit to docker-library-bot/official-images that referenced this pull request Oct 4, 2023
Changes:

- docker-library/rabbitmq@b2387a8: Merge pull request docker-library/rabbitmq#670 from LaurentGoderre/remove-heredoc
- docker-library/rabbitmq@6e58700: Stop using HEREDOC for SBOM attestation because it breaks the DOI builds
- docker-library/rabbitmq@b015404: Merge pull request docker-library/rabbitmq#669 from LaurentGoderre/more-sbom-2
- docker-library/rabbitmq@1078026: Merge pull request docker-library/rabbitmq#668 from LaurentGoderre/more-sbom
- docker-library/rabbitmq@fbcfd9a: Added licenses to attestation of binaries compiled from source
- docker-library/rabbitmq@215db22: fixup
- docker-library/rabbitmq@9f71069: Add attestations for binaries compiled from source
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants