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

Architect a "Verified Reproducible Build Attestation" Content #3950

Closed
1 of 4 tasks
Tracked by #3948
andrew-m-leonard opened this issue Sep 24, 2024 · 20 comments
Closed
1 of 4 tasks
Tracked by #3948

Architect a "Verified Reproducible Build Attestation" Content #3950

andrew-m-leonard opened this issue Sep 24, 2024 · 20 comments
Assignees
Labels
secure-dev testing Issues that enhance or fix our test suites

Comments

@andrew-m-leonard
Copy link
Contributor

andrew-m-leonard commented Sep 24, 2024

Architect a "Verified Reproducible Build Attestation".

Some useful links:

Plan for 1Q 25:

@andrew-m-leonard
Copy link
Contributor Author

@tellison @smlambert fyi

@andrew-m-leonard andrew-m-leonard changed the title Architect a "Reproducible Build Attestation" Architect a "Verified Reproducible Build Attestation" Sep 24, 2024
@smlambert
Copy link
Contributor

Also:

@tellison
Copy link
Contributor

Sigstore seems to be a center of gravity in the secure supply chain processes.
We should seriously consider using the formats supported by Rekor to be able to use that infrastructure downstream.

@andrew-m-leonard
Copy link
Contributor Author

Sigstore seems to be a center of gravity in the secure supply chain processes. We should seriously consider using the formats supported by Rekor to be able to use that infrastructure downstream.

An interesting read, this is what I understand from reading their various docs:

  • CoSign's primary aim is in providing signing of "containers" stored in an OCI Registry.
  • CoSign signing process is usually interactive involving opening of a Browser window for Identity verification during the signing
  • CoSign keyless signing uses Rekor attestation ledger allowing "Signature" to be "verified" against the Rekor ledger entry identity and timestamp, hence does not require a "key"
  • Rekor provides a append only transparency log, for things like attestations
  • Rekor provide a public server: https://rekor.sigstore.dev

I take from that we could maybe:

@smlambert
Copy link
Contributor

smlambert commented Sep 25, 2024

in-toto/attestation#82
in-toto/attestation#129

@andrew-m-leonard
Copy link
Contributor Author

andrew-m-leonard commented Sep 26, 2024

in-toto/attestation#82 in-toto/attestation#129

Thanks Shelley, I am going to follow up with some questions to in-toto in their Slack (https://cloud-native.slack.com/archives/CM46K2VT2/p1727340094818479)

@andrew-m-leonard
Copy link
Contributor Author

Further research, and references:

@andrew-m-leonard
Copy link
Contributor Author

andrew-m-leonard commented Sep 26, 2024

Option 1:

I am currently thinking of this outline architecture:

  1. Temurin build (temurin-build) constructs a CycloneDX CDXA "provenance" attestation document at the end of the build along side the existing SBOM document, and links the SBOM->CDXA. The "Adoptium signed" CDXA will state the "provenance" of the built JDK tarball from an Adoptium "Producer" perspective, ie. something along the lines of a statement with evidence of "reproducible build", eg. binary hashes, and a "re-build" reproducible build evidence log?? Both SBOM and CDXA are published at release time.
  2. A 3rd party performs a successful "Reproducible Verification Build", and creates their own "3rd party signed" consumer CDXA "provenance" attestation document, which documents their statement of evidence of "reproducible build" for the given Temurin release JDK tarball. The 3rd party then publishes this CDXA attestation document to the Adoptium marketplace: https://adoptium.net/marketplace/.
  3. The last step by the Adoptium community as a consequence of a 3rd party publishing a "consumer" CDXA, is to run a "Verify" step, which compares the "producer" CDXA with the "consumer" CDXA, comparing the references and evidence, and upon success then lists the given 3rd party as "attesting" to the reproducibility of the given Temurin JDK release. This last step could also update a "reference", maybe a "bom-link" in the Temurin SBOM, to reference the "verified" consumer CDXA, the "version" number of the SBOM would be incremented by 1, as with accordance to the "CycloneDX Authorative Guide to SBOMs".

Future:

  • Add capability of 3rd party uploading a CycloneDX CDXA document to the public Sigstore Rekor instance, and allowing the step(3) "Verify" stage to reference the Rekor transparency log entry. The "bom-link" would then reference the Rekor entry.
  • Leverage in-toto producer policy auditing in the Adoptium CI build&test pipelines to sign the various stage completions eg.checkout, compile, smokeTest, aqaTest,..., package...

@andrew-m-leonard
Copy link
Contributor Author

From talking to members of the in-toto community, their suggestion points to looking at https://github.com/in-toto/witness
Which from the front cover looks a possibility.

@andrew-m-leonard
Copy link
Contributor Author

Option 2:

  • Temurin ci.adoptium.net pipeline produces an in-toto attestation of reproducible-build provenance using the in-toto-witness tooling
  • 3rd party performs a Temurin re-build, and produces their own in-toto attestation using in-toto-witness
  • Eclipse Adoptium runs an in-toto-policy verification using in-toto-witness that verifies the Adoptium attestation and the 3rd party attestation evidence matches, to attest the claim of an independent Verified Reproducible Build

@andrew-m-leonard
Copy link
Contributor Author

andrew-m-leonard commented Nov 20, 2024

Basic CDXA layout:

  • Assessor:
    • bom-ref: "assessor-1"
    • thirdParty: true,
    • organization.name: "Acme, Inc."
  • Claim:
    • bom-ref: "claim-1"
    • target: "target-1"
    • predicate: "Identical verified reproducible build"
  • Target: (identifies the JDK being reproduced)
    • bom-ref: "target-1"
    • component:
      • type: "application"
      • name: "Temurin jdk-21.0.5+11 x64 Linux"
      • externalReferences:
        • type: "distribution"
        • url: "adoptium temurinNN-binaries JDK URL"
        • hashes: [JDK.tar.gz hash...]
  • Affirmation:
    • bom-ref: "affirmation-1"
    • statement: "Acme affirms to the identical reproduced build of Temurin jdk-21.0.5+11 on x64Linux"
    • signatories:
      • organization:
        • "name": "Acme, Inc."
      • externalReference:

I don't currently see any useful need of "Evidence", as don't see say "Copy of output of diff command..." as being useful.

Trying to mandate JSF json signing for the "signatories" is probably not going to fit all 3rd parties, especially as JSF adoption is poor, and most organizations use detached GPG or Key signatures.

@andrew-m-leonard andrew-m-leonard changed the title Architect a "Verified Reproducible Build Attestation" Architect a "Verified Reproducible Build Attestation" Content Nov 21, 2024
@andrew-m-leonard
Copy link
Contributor Author

@tellison @smlambert @jiekang My thoughts on what is in the CDXA: #3950 (comment)

@jiekang
Copy link
Contributor

jiekang commented Nov 21, 2024

I think the Target->component entry should have the full name of the file (e.g. OpenJDK21U-jdk_x64_linux_hotspot_21.0.5_11.tar.gz)

Though that made me look at the releases page and now wonder what we should plan for staticlibs, debugimage, testimage, and jre artifacts...

@smlambert
Copy link
Contributor

I think the Target->component entry should have the full name of the file (e.g. OpenJDK21U-jdk_x64_linux_hotspot_21.0.5_11.tar.gz)

Not opposed to the suggestion, but want to mention that the full name of the artifact will feature in the url to the binaries repo

@andrew-m-leonard
Copy link
Contributor Author

Though that made me look at the releases page and now wonder what we should plan for staticlibs, debugimage, testimage, and jre artifacts...

What is the plan for these...? current plan is for only reproducible verification of the JDK.tar.gz

@andrew-m-leonard
Copy link
Contributor Author

I think the Target->component entry should have the full name of the file (e.g. OpenJDK21U-jdk_x64_linux_hotspot_21.0.5_11.tar.gz)

Not opposed to the suggestion, but want to mention that the full name of the artifact will feature in the url to the binaries repo

yes that was my original thought too

@tellison
Copy link
Contributor

I think the Target->component entry should have the full name of the file (e.g. OpenJDK21U-jdk_x64_linux_hotspot_21.0.5_11.tar.gz)

Not opposed to the suggestion, but want to mention that the full name of the artifact will feature in the url to the binaries repo

yes that was my original thought too

Or preferably, a stable URL link to the asset via the Adoptium API rather than straight to the storage (just to avoid building dependencies on the storage implementation into the CDXA)

e.g. https://api.adoptium.net/v3/binary/version/jdk-21.0.5+11/linux/x64/jdk/hotspot/normal/eclipse

@andrew-m-leonard
Copy link
Contributor Author

andrew-m-leonard commented Nov 26, 2024

A generated example:

{
  "bomFormat" : "CycloneDX",
  "specVersion" : "1.6",
  "serialNumber" : "urn:uuid:54d03841-be91-4107-8216-0a398920d638",
  "version" : 1,
  "declarations" : {
    "assessors" : [
      {
        "thirdParty" : true,
        "organization" : {
          "name" : "Acme Inc"
        },
        "bom-ref" : "assessor-1"
      }
    ],
    "attestations" : [
      {
        "summary" : "Eclipse Temurin Attestation",
        "assessor" : "assessor-1",
        "map" : [
          {
            "claims" : [
              "claim-1"
            ]
          }
        ]
      }
    ],
    "claims" : [
      {
        "target" : "target-jdk-1",
        "predicate" : "VERIFIED_REPRODUCIBLE_BUILD",
        "bom-ref" : "claim-1"
      }
    ],
    "targets" : {
      "components" : [
        {
          "type" : "application",
          "bom-ref" : "target-jdk-1",
          "name" : "Temurin jdk-21.0.5+11 x64 Linux",
          "externalReferences" : [
            {
              "type" : "distribution",
              "url" : "https://api.adoptium.net/v3/binary/version/jdk-21.0.5+11/linux/x64/jdk/hotspot/normal/eclipse",
              "hashes" : [
                {
                  "alg" : "SHA-256",
                  "content" : "1234567890123456789012345678901234567890123456789012345678901234"
                }
              ]
            }
          ]
        }
      ]
    },
    "affirmation" : {
      "statement" : "Acme confirms a verified reproducible build",
      "signatories" : [
        {
          "organization" : {
            "name" : "Acme Inc"
          },
          "externalReference" : {
            "type" : "website",
            "url" : "https://acme-inc.com"
          }
        }
      ]
    }
  }

@andrew-m-leonard
Copy link
Contributor Author

andrew-m-leonard commented Nov 27, 2024

And here is the same using XML output:

<?xml version="1.0" encoding="UTF-8"?>
<bom serialNumber="urn:uuid:8d58d54f-e666-4c12-be06-ecfef6a0f0ab" version="1" xmlns="http://cyclonedx.org/schema/bom/1.6">
  <declarations>
    <assessors>
      <assessor bom-ref="assessor-1">
        <thirdParty>true</thirdParty>
        <organization>
          <name>Acme Inc</name>
        </organization>
      </assessor>
    </assessors>
    <attestations>
      <attestation>
        <summary>Eclipse Temurin Attestation</summary>
        <assessor>assessor-1</assessor>
        <map>
          <claims>
            <claim>claim-1</claim>
          </claims>
        </map>
      </attestation>
    </attestations>
    <claims>
      <claim bom-ref="claim-1">
        <target>target-jdk-1</target>
        <predicate>VERIFIED_REPRODUCIBLE_BUILD</predicate>
      </claim>
    </claims>
    <targets>
      <components>
        <component type="application" bom-ref="target-jdk-1">
          <name>Temurin jdk-21.0.5+11 x64 Linux</name>
          <version>jdk-21.0.5+11</version>
          <externalReferences>
            <reference type="distribution">
              <url>https://api.adoptium.net/v3/binary/version/jdk-21.0.5+11/linux/x64/jdk/hotspot/normal/eclipse</url>
              <hashes>
                <hash alg="SHA-256">1234567890123456789012345678901234567890123456789012345678901234</hash>
              </hashes>
            </reference>
          </externalReferences>
          <properties>
               <property name="platform">x64_linux</property>
          </properties>
        </component>
      </components>
    </targets>
    <affirmation>
      <statement>Acme confirms a verified reproducible build</statement>
      <signatories/>
    </affirmation>
  </declarations>
</bom>

@andrew-m-leonard
Copy link
Contributor Author

For Q1 '25, the above CDXA.xml will be used: #3950 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
secure-dev testing Issues that enhance or fix our test suites
Projects
Status: Done
Development

No branches or pull requests

4 participants