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

[SBOM] Attestation is missing a subject with digest #3528

Closed
netomi opened this issue Nov 11, 2023 · 5 comments · Fixed by #3529
Closed

[SBOM] Attestation is missing a subject with digest #3528

netomi opened this issue Nov 11, 2023 · 5 comments · Fixed by #3529
Labels
enhancement Issues that enhance the code or documentation of the repo in any way testing Issues that enhance or fix our test suites

Comments

@netomi
Copy link
Contributor

netomi commented Nov 11, 2023

While looking in the sbom files for further validation, I noticed that currently there is no subject with digest stored in the sbom. See https://slsa.dev/attestation-model for terminology.

Without such a subject you will not be able to associate an sbom with an artifact and validate that a certain artifact (identified by its digest) is attested by the provenance that is provided (the sbom in the case of temurin).

Currently the sbom contains that information:

    "component" : {
      "name" : "Eclipse Temurin",
      "version" : "21.0.1+12-LTS",
      "description" : "Temurin JDK Component",
      "type" : "framework"
    },

we should add there the sha265 hash and also the filename of the artifact as generated during the build.

I can create a PR to add this and also update the validate script accordingly.

@netomi netomi added the enhancement Issues that enhance the code or documentation of the repo in any way label Nov 11, 2023
@github-actions github-actions bot added the testing Issues that enhance or fix our test suites label Nov 11, 2023
@netomi
Copy link
Contributor Author

netomi commented Nov 11, 2023

The CycloneDX format has a hashes attribute:

https://cyclonedx.org/docs/1.4/json/#metadata_component_hashes

the file name could be encoded in

https://cyclonedx.org/docs/1.4/json/#metadata_component_properties

@sxa
Copy link
Member

sxa commented Nov 11, 2023

FYI @andrew-m-leonard

@netomi
Copy link
Contributor Author

netomi commented Nov 11, 2023

hmm actually the way the sbom is currently organized is that it captures all artifacts for a specific architecture in a single file

  • jdk
  • jre
  • static-libs
  • testimage
  • debugimage
  • sources

the top level component indicates the product (Eclipse Temurin), version and architecture it has been built for.

The indivual artifacts that are produced are captured in the components array. So ideally the hashes information and file name should be added there.

Additionally, checking the existing sboms, I could only find the JDK component in the array of components, I would expect also the JRE (and the other mentioned) component to appear there.

@smlambert
Copy link
Contributor

smlambert commented Nov 11, 2023

Related: #3018 #3013 #3484

@andrew-m-leonard
Copy link
Contributor

@netomi yes, we need to add the "Artifact" and SHA to the "Eclipse Temurin" Component. As with any generic schema, we need to work out how to encode it. I think we probably need to add a sub-Component object to the "Eclipse Temurin" Component for each Artifact, and for each Artifact Component uses the hashes field. (https://cyclonedx.org/docs/1.5/json/#components_items_components)

@netomi netomi changed the title SBOM attestation is missing a subject with digest [SBOM] Attestation is missing a subject with digest Nov 14, 2023
@sxa sxa closed this as completed in #3529 Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Issues that enhance the code or documentation of the repo in any way testing Issues that enhance or fix our test suites
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

5 participants
@netomi @smlambert @sxa @andrew-m-leonard and others