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

Feat/bsi2 add signature field #360

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

viveksahu26
Copy link
Collaborator

@viveksahu26 viveksahu26 commented Nov 25, 2024

part of #329

This PR add support for supporting BSI:2.0 sbom new fields such as signature. It supports external and internal signature verification.

For the external signature verification:

  • the user need to provide SBOM file(without containing signatures and public key i.e. standalone SBOM), signature file, and public key file
  • $ go run main.go compliance --bsi-v2 samples/signature-test-data/SPDXJSONExample-v2.3.spdx.json --sig samples/signature-test-data/sbom.sig --pub samples/signature-test-data/public_key.pem

You can also confirm the verification process via openssl tool too:

  • $ openssl dgst -sha256 -verify samples/signature-test-data/public_key.pem -signature samples/signature-test-data/sbom.sig samples/signature-test-data/SPDXJSONExample-v2.3.spdx.json

For the internal signature verification:

  • The user need to provide only SBOM file. The SBOM must contain signature and public key.
  • $ go run main.go compliance --bsi-v2 samples/signature-test-data/stree-cdxgen-signed-sbom.cdx.json

NOTE: In this case, just for cross verification, for now, we are writing signature(file name default: extracted_signature.bin , public key(file name default: extracted_public_key.pem) and standalone sbom(filename default: standalone_sbom.json) in the local directory, so that one can cross verify it via openssl tool also, like:
$ openssl dgst -sha256 -verify extracted_public_key.pem -signature extracted_signature.bin standalone_sbom.json

This stree-cdxgen-signed-sbom.cdx.json SBOM contains signature and public key. So, sbomqs internally extract the signature and public key into a file, as well as also extract the standalone SBOM by removing signature section and then verifies it.

@viveksahu26 viveksahu26 force-pushed the feat/bsi2_add_signature_field branch 2 times, most recently from c1922c5 to 15235a5 Compare November 27, 2024 15:48
@viveksahu26 viveksahu26 force-pushed the feat/bsi2_add_signature_field branch from 15235a5 to df07d66 Compare November 28, 2024 06:33
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.

1 participant