-
-
Notifications
You must be signed in to change notification settings - Fork 249
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 provenance artefact should be signed #3158
Comments
An example of the signing of the SBOM is given as a CycloneDX use-case |
Unlike the detached signature of the runtime binary, the SBOM signature should be part of the SBOM itself, presumably in JSON signature format. Is that how you see it too @sxa ? |
That isn't what I've done for the first pass, but that may be a good option for the subsequent releases. |
What have you done? This will be part of the "contract" with consumers so best we get it right first time rather than plan on changing it (and expecting users to update their code later). |
I've done it the same way as for the tarballs - put up a file with a |
Maybe check the CycloneDX CLI tool that can sign the BOM (and presumably in the required format). Available in a docker image. |
:-)
:-( |
We could generate both json and xml formats, but also we can check when that signing feature might be supported for json BOMs |
The tool can convert from json to XML format, so
but signing still not working for me:
I'm going to chat to the CycloneDX folks and see if they can help. |
See also this issue for signing JSON format files directly CycloneDX/cyclonedx-cli#260 The error I get when trying to sign XML files is already reported back in July, but no follow-up from the project. |
Not making much progress on this. The CycloneDX tools don't do what we want, and it doesn't sound like that is going to change imminently. Options as I see it are:
|
From the JSF doc, they show sample Java code in the Usage in Applications section, that shows example of signing a json doc using https://github.com/cyberphone/openkeystore. We could potentially integrate that into our TemurinGenSBOM code as an interim solution while we await the fix in the CycloneDX CLI tool. |
Thanks @smlambert that looks promising:
Agreed that can be used in the TemurinGenSBOM code based on the example you linked to above. |
Correct, I think it does not need to be interim. |
@smlambert can I take up this? |
@julian55455 The above sample using openkeystore can be built as part of our CycloneDX java library, here: Line 708 in 9204887
And the signing can take part similarly at the end of the SBOM generation, here: Line 800 in 9204887
|
Although access to the necessary key might be an issue... We will probably have to restructure the calls to the above, so that they are called from the pipeline scripts within a node stage on the signing node, maybe in a similar fashion to the gpgSign(): |
@julian55455 So my thoughts are we could extend our TemurinGenSBOM.java to have a new "sign" operation, so add to this class: https://github.com/adoptium/temurin-build/blob/master/cyclonedx-lib/src/temurin/sbom/TemurinGenSBOM.java Then in sbin/build.sh add a new function signSBoM(), that builds the above CycloneDX TemurinGenSBOM.java class (call Line 708 in 0c31102
The signSBom() function in sbin/build.sh will need calling on the correct node with the keys, to do that, we can do something similar to ASSEMBLE_EXPLODED_IMAGE for Mac, where the ci-jenkins-pipelines code calls sbin/build.sh with a special mode. So we could add a new BUILD_CONFIG param "SIGN_SBOM", in the sbin/build.sh main procedure it would be something like:
The above will need a bit more thought...but something like that maybe the easiest. |
FYI On the basis of this, I've made an adjustment to the signing job so that it will replicate what I did for the October release automatically for now until we can identify an alternate mechanism. If we can make something else work then we can use that instead, but we can use this as a failsafe to avoid breaking out claimed SLSA2 compliance. |
@julian55455 this is going to require some more thinking, I suspect we could mimic what is done to sign windows & mac builds, using https://github.com/adoptium/temurin-build/blob/master/build-farm/sign-releases.sh We could move the build of the TemurinGenSBOM.java out of sbin/build.sh to a common script, and call the same from a new build-farm/sign-sbom.sh script ...? For signing there's a few things that all have to be in place:
|
@andrew-m-leonard Do you mean Modify the sign-releases.sh script to also include the signing of sboms or similarly create a new script The modified sign-releases.sh would probably look like
@andrew-m-leonard would this particularly be a java code not a script, ie I mean something like this
This is okay cc @zdtsw @smlambert |
to sum up discussion we had in today's call:
|
Think a bit further ahead, I think the following next high-level steps are needed:
|
assume, we keep where buildCyclonedxLib() as-is to generate sbom json but extended with openkeystore ? |
So it is building the same thing, if the --signSbom occurs on the same node, then it will already be built and the ant make will just do nothing.. |
if I do not misunderstand, |
Yes, openkeystore does not have any releases, so we will clone and build from source |
PR: #3243 |
Now that PR #3243 is nearing completion, the SBOM signing Intergration needs adding to complete this issue: adoptium/ci-jenkins-pipelines#610 |
The SBOM is used to determine the provenance authenticity and integrity of the Temurin binaries, and as such should be able to be verified by the consumer to be authentic.
This issue is to enhance the build process to include a digital signature of the SBOM artefact using the trusted code signing key.
This is an obligation of SLSA Level 2.
The text was updated successfully, but these errors were encountered: