Repository navigation
(CBOM) Protocol properties: replace protocol-specific properties with a generic composition #1213
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
Open
bhess
wants to merge
1
commit into
CycloneDX:2.0-dev
Choose a base branch
from
bhess:feat/protocol-composition-bom
base: 2.0-dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+932
−343
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
tools/src/test/resources/2.0/invalid-cryptography-protocol-composition-member-2.0.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| { | ||
| "$schema": "https://cyclonedx.org/schema/2.0/cyclonedx-2.0.schema.json", | ||
| "specFormat": "CycloneDX", | ||
| "specVersion": "2.0", | ||
| "version": 1, | ||
| "serialNumber": "urn:uuid:6136f063-ade0-4403-9623-8e3e05e8946e", | ||
| "inventories": [ | ||
| { | ||
| "subject": { | ||
| "refId": "subject-1", | ||
| "type": "application", | ||
| "name": "Acme Application", | ||
| "version": "1.0" | ||
| }, | ||
| "components": [ | ||
| { | ||
| "type": "cryptographic-asset", | ||
| "refId": "protocol-tls", | ||
| "name": "TLS", | ||
| "cryptoProperties": { | ||
| "assetType": "protocol", | ||
| "protocolProperties": { | ||
| "type": "tls", | ||
| "version": "1.3", | ||
| "composition": [ | ||
| { | ||
| "role": "key-exchange", | ||
| "selection": "one-of", | ||
| "selectedBy": "negotiation", | ||
| "algorithmSet": [ | ||
| { | ||
| "name": "X25519MLKEM768" | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } |
46 changes: 46 additions & 0 deletions
46
tools/src/test/resources/2.0/invalid-cryptography-protocol-composition-missing-role-2.0.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| { | ||
| "$schema": "https://cyclonedx.org/schema/2.0/cyclonedx-2.0.schema.json", | ||
| "specFormat": "CycloneDX", | ||
| "specVersion": "2.0", | ||
| "version": 1, | ||
| "serialNumber": "urn:uuid:6836c1f4-a4bf-46f6-9639-4b5ba85f3c58", | ||
| "inventories": [ | ||
| { | ||
| "subject": { | ||
| "refId": "subject-1", | ||
| "type": "application", | ||
| "name": "Acme Application", | ||
| "version": "1.0" | ||
| }, | ||
| "components": [ | ||
| { | ||
| "type": "cryptographic-asset", | ||
| "refId": "protocol-tls", | ||
| "name": "TLS", | ||
| "cryptoProperties": { | ||
| "assetType": "protocol", | ||
| "protocolProperties": { | ||
| "type": "tls", | ||
| "version": "1.3", | ||
| "composition": [ | ||
| { | ||
| "selection": "one-of", | ||
| "selectedBy": "negotiation", | ||
| "algorithmSet": [ | ||
| { | ||
| "name": "TLS_AES_128_GCM_SHA256", | ||
| "algorithms": [ | ||
| "AES-128-GCM-128-96", | ||
| "HKDF-SHA-256" | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } |
47 changes: 47 additions & 0 deletions
47
tools/src/test/resources/2.0/invalid-cryptography-protocol-composition-selection-2.0.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| { | ||
| "$schema": "https://cyclonedx.org/schema/2.0/cyclonedx-2.0.schema.json", | ||
| "specFormat": "CycloneDX", | ||
| "specVersion": "2.0", | ||
| "version": 1, | ||
| "serialNumber": "urn:uuid:61c2f9c1-f0eb-47c3-8f87-6e0358871629", | ||
| "inventories": [ | ||
| { | ||
| "subject": { | ||
| "refId": "subject-1", | ||
| "type": "application", | ||
| "name": "Acme Application", | ||
| "version": "1.0" | ||
| }, | ||
| "components": [ | ||
| { | ||
| "type": "cryptographic-asset", | ||
| "refId": "protocol-tls", | ||
| "name": "TLS", | ||
| "cryptoProperties": { | ||
| "assetType": "protocol", | ||
| "protocolProperties": { | ||
| "type": "tls", | ||
| "version": "1.3", | ||
| "composition": [ | ||
| { | ||
| "role": "encryption", | ||
| "selection": "two-of", | ||
| "selectedBy": "negotiation", | ||
| "algorithmSet": [ | ||
| { | ||
| "name": "TLS_AES_128_GCM_SHA256", | ||
| "algorithms": [ | ||
| "AES-128-GCM-128-96", | ||
| "HKDF-SHA-256" | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I support the generic direction(as discussed in meeting). One regression concerns me: the link from a slot to the algorithm asset in the BOM is lost.
Before this PR,
cipherSuites[].algorithmsand theikeV2*algorithmproperties wererefLinkTypereferences, so a slot pointed at a specific algorithm component. Herealgorithmsare name strings, and the description says they resolve "to the algorithm components of the BOM". In this PR's own test cases they do not:valid-cryptography-full-2.0.json:AES-128-GCM-128-96,AES-256-GCM-128-96andHMAC-SHA-256-128have no component with that name (the components areAES-128-GCM,AES-256-GCM,HMAC-SHA-256).valid-cryptography-certificate-2.0.json:AES-256-GCM-128-96versus componentAES-256-GCM.I think it matters because the algorithm component carries the implementation facts (certification level, execution environment, implementation platform, security levels, the providing library). Two components can share a name, for example the same algorithm from a validated and a non-validated module, and a string cannot choose between them. A Misspelled name also dangles silently, where a
refIdcan be checked.The migrated examples keep
relatedCryptographicAssetsbeside the composition, but that list is unlabelled, which is the "which algorithm does what" problem of #1162 again. The same applies to keys: the SSH example names the host key algorithm, but there is no key asset and no link to one.Could a member carry an optional reference to the asset on the BOM side, or could the resolution rule be stated normatively ?