diff --git a/schema/2.0/modules/cyclonedx-cryptography-2.0.schema.json b/schema/2.0/modules/cyclonedx-cryptography-2.0.schema.json index ec277d8ce..89d708333 100644 --- a/schema/2.0/modules/cyclonedx-cryptography-2.0.schema.json +++ b/schema/2.0/modules/cyclonedx-cryptography-2.0.schema.json @@ -687,70 +687,13 @@ "1.99" ] }, - "cipherSuites": { + "composition": { "type": "array", - "title": "Cipher Suites", - "description": "A list of cipher suites related to the protocol, as configured or observed for the subject of this BOM. The protocol entry in the `cryptography-defs.schema.json` subschema describes what the protocol version itself can support or negotiate.", + "title": "Composition", + "description": "The composition of the protocol as implemented, configured or observed for the subject of this BOM, using the structure of the protocol entries in the `cryptography-defs.schema.json` subschema. A slot corresponds to the slot of the protocol entry, identified by `type` and `version`, with the same role, and with the same selecting party where several slots share the role. The algorithm set holds the algorithms of the subject, named by the variant patterns of the algorithm families. A named bundle keeps the protocol's own identifier, such as an IANA-registered cipher suite, group or algorithm name, also for a single algorithm. The selection and the selection mechanism are those of the subject, which can be narrower than the protocol's: a negotiated slot can be fixed at build time, for example.", "items": { - "$ref": "#/$defs/cipherSuite", - "title": "Cipher Suite" - } - }, - "ikev2TransformTypes": { - "type": "object", - "title": "IKEv2 Transform Types", - "description": "The IKEv2 transform types supported (types 1-4), defined in [RFC 7296 section 3.3.2](https://www.ietf.org/rfc/rfc7296.html#section-3.3.2), and additional properties, as configured or observed for the subject of this BOM. The protocol entry in the `cryptography-defs.schema.json` subschema describes what the protocol version itself can support or negotiate.", - "additionalProperties": false, - "properties": { - "encr": { - "type": "array", - "title": "Encryption Algorithms (ENCR)", - "description": "Transform Type 1: encryption algorithms.", - "items": { - "$ref": "#/$defs/ikeV2Enc", - "title": "Encryption Algorithm (ENCR)" - } - }, - "prf": { - "type": "array", - "title": "Pseudorandom Functions (PRF)", - "description": "Transform Type 2: pseudorandom functions.", - "items": { - "$ref": "#/$defs/ikeV2Prf", - "title": "Pseudorandom Function (PRF)" - } - }, - "integ": { - "type": "array", - "title": "Integrity Algorithms (INTEG)", - "description": "Transform Type 3: integrity algorithms.", - "items": { - "$ref": "#/$defs/ikeV2Integ", - "title": "Integrity Algorithm (INTEG)" - } - }, - "ke": { - "type": "array", - "title": "Key Exchange Methods (KE)", - "description": "Transform Type 4: Key Exchange Method (KE) per [RFC 9370](https://www.ietf.org/rfc/rfc9370.html), formerly called Diffie-Hellman Group (D-H).", - "items": { - "$ref": "#/$defs/ikeV2Ke" - } - }, - "esn": { - "type": "boolean", - "title": "Extended Sequence Number (ESN)", - "description": "Specifies if an Extended Sequence Number (ESN) is used." - }, - "auth": { - "type": "array", - "title": "IKEv2 Authentication methods", - "description": "IKEv2 Authentication method per [RFC9593](https://www.ietf.org/rfc/rfc9593.html).", - "items": { - "$ref": "#/$defs/ikeV2Auth", - "title": "IKEv2 Authentication Method" - } - } + "$ref": "../../cryptography-defs.schema.json#/definitions/compositionSlot", + "title": "Composition Slot" } }, "relatedCryptographicAssets": { @@ -765,179 +708,6 @@ } } }, - "cipherSuite": { - "type": "object", - "title": "Cipher Suite", - "description": "Object representing a cipher suite.", - "additionalProperties": false, - "properties": { - "name": { - "type": "string", - "title": "Common Name", - "description": "A common name for the cipher suite.", - "examples": [ - "TLS_DHE_RSA_WITH_AES_128_CCM" - ] - }, - "algorithms": { - "type": "array", - "title": "Related Algorithms", - "description": "A list of algorithms related to the cipher suite.", - "items": { - "$ref": "cyclonedx-common-2.0.schema.json#/$defs/refLinkType", - "title": "Algorithm reference", - "description": "The `refId` to algorithm cryptographic asset." - } - }, - "identifiers": { - "type": "array", - "title": "Cipher Suite Identifiers", - "description": "A list of common identifiers for the cipher suite.", - "items": { - "type": "string", - "title": "identifier", - "description": "Cipher suite identifier.", - "examples": [ - "0xC0", - "0x9E" - ] - } - }, - "tlsGroups": { - "type": "array", - "title": "TLS Groups", - "description": "A list of TLS named groups (formerly known as curves) for this cipher suite. These groups define the parameters for key exchange algorithms like ECDHE.", - "items": { - "type": "string", - "title": "Group Name", - "description": "The name of the TLS group.", - "examples": [ - "x25519", - "ffdhe2048" - ] - } - }, - "tlsSignatureSchemes": { - "type": "array", - "title": "TLS Signature Schemes", - "description": "A list of signature schemes supported for cipher suite. These schemes specify the algorithms used for digital signatures in TLS handshakes and certificate verification.", - "items": { - "type": "string", - "title": "Signature Scheme", - "description": "The name of the TLS signature scheme.", - "examples": [ - "ecdsa_secp256r1_sha256", - "rsa_pss_rsae_sha256", - "ed25519" - ] - } - } - } - }, - "ikeV2Enc": { - "type": "object", - "title": "Encryption Algorithm (ENCR)", - "description": "Object representing an encryption algorithm (ENCR).", - "additionalProperties": false, - "properties": { - "name": { - "type": "string", - "title": "Name", - "description": "A name for the encryption method.", - "examples": [ - "ENCR_AES_GCM_16" - ] - }, - "keyLength": { - "type": "integer", - "title": "Encryption algorithm key length", - "description": "The key length of the encryption algorithm." - }, - "algorithm": { - "$ref": "cyclonedx-common-2.0.schema.json#/$defs/refLinkType", - "title": "Algorithm reference", - "description": "The `refId` to algorithm cryptographic asset." - } - } - }, - "ikeV2Prf": { - "type": "object", - "title": "Pseudorandom Function (PRF)", - "description": "Object representing a pseudorandom function (PRF).", - "additionalProperties": false, - "properties": { - "name": { - "type": "string", - "title": "Name", - "description": "A name for the pseudorandom function.", - "examples": [ - "PRF_HMAC_SHA2_256" - ] - }, - "algorithm": { - "$ref": "cyclonedx-common-2.0.schema.json#/$defs/refLinkType", - "title": "Algorithm reference", - "description": "The `refId` to algorithm cryptographic asset." - } - } - }, - "ikeV2Integ": { - "type": "object", - "title": "Integrity Algorithm (INTEG)", - "description": "Object representing an integrity algorithm (INTEG).", - "additionalProperties": false, - "properties": { - "name": { - "type": "string", - "title": "Name", - "description": "A name for the integrity algorithm.", - "examples": [ - "AUTH_HMAC_SHA2_256_128" - ] - }, - "algorithm": { - "$ref": "cyclonedx-common-2.0.schema.json#/$defs/refLinkType", - "title": "Algorithm reference", - "description": "The `refId` to algorithm cryptographic asset." - } - } - }, - "ikeV2Ke": { - "type": "object", - "title": "Key Exchange Method (KE)", - "description": "Object representing a key exchange method (KE).", - "additionalProperties": false, - "properties": { - "group": { - "type": "integer", - "title": "Group Identifier", - "description": "A group identifier for the key exchange algorithm." - }, - "algorithm": { - "$ref": "cyclonedx-common-2.0.schema.json#/$defs/refLinkType", - "title": "Algorithm reference", - "description": "The `refId` to algorithm cryptographic asset." - } - } - }, - "ikeV2Auth": { - "type": "object", - "title": "IKEv2 Authentication method", - "description": "Object representing a IKEv2 Authentication method.", - "additionalProperties": false, - "properties": { - "name": { - "type": "string", - "title": "Name", - "description": "A name for the authentication method." - }, - "algorithm": { - "$ref": "cyclonedx-common-2.0.schema.json#/$defs/refLinkType", - "title": "Algorithm reference", - "description": "The `refId` to algorithm cryptographic asset." - } - } - }, "cryptographicFunction": { "title": "Cryptographic Function", "description": "A cryptographic function or usage.", diff --git a/tools/src/test/resources/2.0/invalid-cryptography-protocol-composition-member-2.0.json b/tools/src/test/resources/2.0/invalid-cryptography-protocol-composition-member-2.0.json new file mode 100644 index 000000000..bd205e22b --- /dev/null +++ b/tools/src/test/resources/2.0/invalid-cryptography-protocol-composition-member-2.0.json @@ -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" + } + ] + } + ] + } + } + } + ] + } + ] +} diff --git a/tools/src/test/resources/2.0/invalid-cryptography-protocol-composition-missing-role-2.0.json b/tools/src/test/resources/2.0/invalid-cryptography-protocol-composition-missing-role-2.0.json new file mode 100644 index 000000000..79e3f57da --- /dev/null +++ b/tools/src/test/resources/2.0/invalid-cryptography-protocol-composition-missing-role-2.0.json @@ -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" + ] + } + ] + } + ] + } + } + } + ] + } + ] +} diff --git a/tools/src/test/resources/2.0/invalid-cryptography-protocol-composition-selection-2.0.json b/tools/src/test/resources/2.0/invalid-cryptography-protocol-composition-selection-2.0.json new file mode 100644 index 000000000..ed644883c --- /dev/null +++ b/tools/src/test/resources/2.0/invalid-cryptography-protocol-composition-selection-2.0.json @@ -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" + ] + } + ] + } + ] + } + } + } + ] + } + ] +} diff --git a/tools/src/test/resources/2.0/valid-cryptography-certificate-2.0.json b/tools/src/test/resources/2.0/valid-cryptography-certificate-2.0.json index c05da003c..0daf17c65 100644 --- a/tools/src/test/resources/2.0/valid-cryptography-certificate-2.0.json +++ b/tools/src/test/resources/2.0/valid-cryptography-certificate-2.0.json @@ -143,26 +143,46 @@ "protocolProperties": { "type": "tls", "version": "1.3", - "cipherSuites": [ + "composition": [ { - "name": "TLS_AES_256_GCM_SHA384", - "algorithms": [ - "1977d71b-8981-4292-b40d-842a019c2229", - "422fa336-b401-42b7-89b8-8966aa30bca0" - ], - "identifiers": [ - "0x13,0x02" + "role": "encryption", + "selection": "one-of", + "selectedBy": "negotiation", + "selectingParty": "server", + "algorithmSet": [ + { + "name": "TLS_AES_256_GCM_SHA384", + "algorithms": [ + "AES-256-GCM-128-96", + "HKDF-SHA-384" + ] + }, + { + "name": "TLS_CHACHA20_POLY1305_SHA256", + "algorithms": [ + "ChaCha20-Poly1305", + "HKDF-SHA-256" + ] + } ] + } + ], + "relatedCryptographicAssets": [ + { + "type": "algorithm", + "ref": "1977d71b-8981-4292-b40d-842a019c2229" }, { - "name": "TLS_CHACHA20_POLY1305_SHA256", - "algorithms": [ - "1af4fc08-5d0d-436e-8058-eeef921983d0", - "6af3066b-ab66-4593-975f-d9ba2c623a89" - ], - "identifiers": [ - "0x13,0x03" - ] + "type": "algorithm", + "ref": "422fa336-b401-42b7-89b8-8966aa30bca0" + }, + { + "type": "algorithm", + "ref": "1af4fc08-5d0d-436e-8058-eeef921983d0" + }, + { + "type": "algorithm", + "ref": "6af3066b-ab66-4593-975f-d9ba2c623a89" } ] }, @@ -193,24 +213,23 @@ } }, { - "name": "SHA-384", + "name": "HKDF-SHA-384", "type": "cryptographic-asset", "refId": "422fa336-b401-42b7-89b8-8966aa30bca0", "cryptoProperties": { "assetType": "algorithm", "algorithmProperties": { - "primitive": "hash", - "algorithmFamily": "SHA-2", - "parameterSetIdentifier": "384", + "primitive": "kdf", + "algorithmFamily": "HKDF", "executionEnvironment": "software-plain-ram", "implementationPlatform": [ "x86_64" ], "cryptoFunctions": [ - "digest" + "keyderive" ] }, - "oid": "2.16.840.1.101.3.4.2.2" + "oid": "1.2.840.113549.1.9.16.3.29" } }, { @@ -236,24 +255,23 @@ } }, { - "name": "SHA-256", + "name": "HKDF-SHA-256", "type": "cryptographic-asset", "refId": "6af3066b-ab66-4593-975f-d9ba2c623a89", "cryptoProperties": { "assetType": "algorithm", "algorithmProperties": { - "primitive": "hash", - "algorithmFamily": "SHA-2", - "parameterSetIdentifier": "256", + "primitive": "kdf", + "algorithmFamily": "HKDF", "executionEnvironment": "software-plain-ram", "implementationPlatform": [ "x86_64" ], "cryptoFunctions": [ - "digest" + "keyderive" ] }, - "oid": "2.16.840.1.101.3.4.2.1" + "oid": "1.2.840.113549.1.9.16.3.28" } } ] diff --git a/tools/src/test/resources/2.0/valid-cryptography-full-2.0.json b/tools/src/test/resources/2.0/valid-cryptography-full-2.0.json index 67e031048..da1b2970b 100644 --- a/tools/src/test/resources/2.0/valid-cryptography-full-2.0.json +++ b/tools/src/test/resources/2.0/valid-cryptography-full-2.0.json @@ -86,19 +86,18 @@ { "ref": "cert-fips140-3-l1" } ], "type": "cryptographic-asset", - "refId": "algorithm-sha256", - "name": "SHA-256", + "refId": "algorithm-hkdf-sha256", + "name": "HKDF-SHA-256", "cryptoProperties": { "assetType": "algorithm", "algorithmProperties": { - "primitive": "hash", - "algorithmFamily": "SHA-2", - "parameterSetIdentifier": "256", + "primitive": "kdf", + "algorithmFamily": "HKDF", "executionEnvironment": "software-plain-ram", "implementationPlatform": [ "x86_64" ], - "cryptoFunctions": ["digest"] + "cryptoFunctions": ["keyderive"] }, - "oid": "2.16.840.1.101.3.4.2.1" + "oid": "1.2.840.113549.1.9.16.3.28" } }, { @@ -106,19 +105,18 @@ { "ref": "cert-fips140-3-l1" } ], "type": "cryptographic-asset", - "refId": "algorithm-sha384", - "name": "SHA-384", + "refId": "algorithm-hkdf-sha384", + "name": "HKDF-SHA-384", "cryptoProperties": { "assetType": "algorithm", "algorithmProperties": { - "primitive": "hash", - "algorithmFamily": "SHA-2", - "parameterSetIdentifier": "384", + "primitive": "kdf", + "algorithmFamily": "HKDF", "executionEnvironment": "software-plain-ram", "implementationPlatform": [ "x86_64" ], - "cryptoFunctions": ["digest"] + "cryptoFunctions": ["keyderive"] }, - "oid": "2.16.840.1.101.3.4.2.2" + "oid": "1.2.840.113549.1.9.16.3.29" } }, { @@ -162,13 +160,32 @@ "oid": "1.2.840.113549.1.9.16.3.18" } }, + { + "certifications": [ + { "ref": "cert-fips140-3-l1" } + ], + "type": "cryptographic-asset", + "refId": "algorithm-hmac-sha256", + "name": "HMAC-SHA-256", + "cryptoProperties": { + "assetType": "algorithm", + "algorithmProperties": { + "primitive": "mac", + "algorithmFamily": "HMAC", + "executionEnvironment": "software-plain-ram", + "implementationPlatform": [ "x86_64" ], + "cryptoFunctions": ["tag"] + }, + "oid": "1.2.840.113549.2.9" + } + }, { "certifications": [ { "ref": "cert-fips140-3-l1" } ], "type": "cryptographic-asset", "refId": "algorithm-ffdh-group14", - "name": "FFDH Group 14", + "name": "FFDHE-modp2048", "cryptoProperties": { "assetType": "algorithm", "algorithmProperties": { @@ -187,7 +204,7 @@ ], "type": "cryptographic-asset", "refId": "algorithm-ecdsa-p256", - "name": "ECDSA-P256", + "name": "ECDSA-secp256r1-SHA-256", "cryptoProperties": { "assetType": "algorithm", "algorithmProperties": { @@ -352,72 +369,37 @@ "protocolProperties": { "type": "tls", "version": "1.3", - "cipherSuites": [ - { - "name": "TLS_AES_128_GCM_SHA256", - "algorithms": [ - "algorithm-aes-128-gcm", - "algorithm-sha256" - ], - "identifiers": [ - "0x13,0x01" - ] - }, - { - "name": "TLS_AES_256_GCM_SHA384", - "algorithms": [ - "algorithm-aes-256-gcm", - "algorithm-sha384" - ], - "identifiers": [ - "0x13,0x02" - ] - }, + "composition": [ { - "name": "TLS_CHACHA20_POLY1305_SHA256", - "algorithms": [ - "algorithm-chacha20-poly1305", - "algorithm-sha256" - ], - "identifiers": [ - "0x13,0x03" + "role": "encryption", + "selection": "one-of", + "selectedBy": "negotiation", + "selectingParty": "server", + "algorithmSet": [ + { + "name": "TLS_AES_128_GCM_SHA256", + "algorithms": [ + "AES-128-GCM-128-96", + "HKDF-SHA-256" + ] + }, + { + "name": "TLS_AES_256_GCM_SHA384", + "algorithms": [ + "AES-256-GCM-128-96", + "HKDF-SHA-384" + ] + }, + { + "name": "TLS_CHACHA20_POLY1305_SHA256", + "algorithms": [ + "ChaCha20-Poly1305", + "HKDF-SHA-256" + ] + } ] } ], - "ikev2TransformTypes": { - "encr": [ - { - "name": "ENCR_AES_GCM_16", - "keyLength": 128, - "algorithm": "algorithm-aes-128-gcm" - } - ], - "prf": [ - { - "name": "PRF_HMAC_SHA2_256", - "algorithm": "algorithm-sha256" - } - ], - "integ": [ - { - "name": "AUTH_HMAC_SHA2_256_128", - "algorithm": "algorithm-sha256" - } - ], - "ke": [ - { - "group": 14, - "algorithm": "algorithm-ffdh-group14" - } - ], - "esn": true, - "auth": [ - { - "name": "ECDSA", - "algorithm": "algorithm-ecdsa-p256" - } - ] - }, "relatedCryptographicAssets": [ { "type": "algorithm", @@ -429,11 +411,11 @@ }, { "type": "algorithm", - "ref": "algorithm-sha256" + "ref": "algorithm-hkdf-sha256" }, { "type": "algorithm", - "ref": "algorithm-sha384" + "ref": "algorithm-hkdf-sha384" }, { "type": "algorithm", @@ -443,6 +425,107 @@ }, "oid": "1.3.6.1.5.5.7.3.1" } + }, + { + "type": "cryptographic-asset", + "refId": "protocol-ike-2", + "name": "IKEv2 Configuration", + "cryptoProperties": { + "assetType": "protocol", + "protocolProperties": { + "type": "ike", + "version": "2", + "composition": [ + { + "role": "encryption", + "selection": "one-of", + "selectedBy": "negotiation", + "selectingParty": "responder", + "algorithmSet": [ + { + "name": "ENCR_AES_GCM_16", + "algorithms": [ + "AES-128-GCM-128-96" + ] + } + ] + }, + { + "role": "prf", + "selection": "one-of", + "selectedBy": "negotiation", + "selectingParty": "responder", + "algorithmSet": [ + { + "name": "PRF_HMAC_SHA2_256", + "algorithms": [ + "HMAC-SHA-256" + ] + } + ] + }, + { + "role": "integrity", + "selection": "one-of", + "selectedBy": "negotiation", + "selectingParty": "responder", + "algorithmSet": [ + { + "name": "AUTH_HMAC_SHA2_256_128", + "algorithms": [ + "HMAC-SHA-256-128" + ] + } + ] + }, + { + "role": "key-exchange", + "selection": "one-of", + "selectedBy": "negotiation", + "selectingParty": "responder", + "algorithmSet": [ + { + "name": "2048-bit MODP Group", + "algorithms": [ + "FFDHE-modp2048" + ] + } + ] + }, + { + "role": "authentication", + "selection": "one-of", + "selectedBy": "configuration", + "algorithmSet": [ + { + "name": "ECDSA with SHA-256 on the P-256 curve", + "algorithms": [ + "ECDSA-secp256r1-SHA-256" + ] + } + ] + } + ], + "relatedCryptographicAssets": [ + { + "type": "algorithm", + "ref": "algorithm-aes-128-gcm" + }, + { + "type": "algorithm", + "ref": "algorithm-hmac-sha256" + }, + { + "type": "algorithm", + "ref": "algorithm-ffdh-group14" + }, + { + "type": "algorithm", + "ref": "algorithm-ecdsa-p256" + } + ] + } + } } ] } diff --git a/tools/src/test/resources/2.0/valid-cryptography-protocol-composition-ipsec-2.0.json b/tools/src/test/resources/2.0/valid-cryptography-protocol-composition-ipsec-2.0.json new file mode 100644 index 000000000..c415c60fb --- /dev/null +++ b/tools/src/test/resources/2.0/valid-cryptography-protocol-composition-ipsec-2.0.json @@ -0,0 +1,228 @@ +{ + "$schema": "https://cyclonedx.org/schema/2.0/cyclonedx-2.0.schema.json", + "specFormat": "CycloneDX", + "specVersion": "2.0", + "version": 1, + "serialNumber": "urn:uuid:37ec656d-b55f-442f-830d-ebd3b48a99a0", + "inventories": [ + { + "subject": { + "refId": "subject-1", + "type": "application", + "name": "Acme VPN Gateway", + "version": "1.0" + }, + "components": [ + { + "type": "cryptographic-asset", + "refId": "protocol-ike-configured", + "name": "IKEv2 configured IKE SA", + "cryptoProperties": { + "assetType": "protocol", + "protocolProperties": { + "type": "ike", + "version": "2", + "composition": [ + { + "role": "encryption", + "selection": "one-of", + "selectedBy": "negotiation", + "selectingParty": "responder", + "algorithmSet": [ + { + "name": "ENCR_AES_GCM_16", + "algorithms": [ + "AES-256-GCM-128-96" + ] + } + ] + }, + { + "role": "prf", + "selection": "one-of", + "selectedBy": "negotiation", + "selectingParty": "responder", + "algorithmSet": [ + { + "name": "PRF_HMAC_SHA2_256", + "algorithms": [ + "HMAC-SHA-256" + ] + } + ] + }, + { + "role": "key-exchange", + "selection": "any-of", + "selectedBy": "negotiation", + "selectingParty": "responder", + "algorithmSet": [ + { + "name": "256-bit random ECP group", + "algorithms": [ + "ECDHE-secp256r1" + ] + }, + { + "name": "ml-kem-768", + "algorithms": [ + "ML-KEM-768" + ] + } + ] + }, + { + "role": "authentication", + "selection": "one-of", + "selectedBy": "configuration", + "algorithmSet": [ + { + "name": "ECDSA with SHA-256 on the P-256 curve", + "algorithms": [ + "ECDSA-secp256r1-SHA-256" + ] + } + ] + } + ] + } + } + }, + { + "type": "cryptographic-asset", + "refId": "protocol-esp-child-a-configured", + "name": "ESP Child SA A (site-to-site), configured", + "cryptoProperties": { + "assetType": "protocol", + "protocolProperties": { + "type": "esp", + "composition": [ + { + "role": "encryption", + "selection": "one-of", + "selectedBy": "negotiation", + "selectingParty": "responder", + "algorithmSet": [ + { + "name": "ENCR_AES_GCM_16", + "algorithms": [ + "AES-256-GCM-128-96" + ] + } + ] + } + ] + } + } + }, + { + "type": "cryptographic-asset", + "refId": "protocol-esp-child-b-configured", + "name": "ESP Child SA B (remote-access), configured", + "cryptoProperties": { + "assetType": "protocol", + "protocolProperties": { + "type": "esp", + "composition": [ + { + "role": "encryption", + "selection": "one-of", + "selectedBy": "negotiation", + "selectingParty": "responder", + "algorithmSet": [ + { + "name": "ENCR_AES_GCM_16", + "algorithms": [ + "AES-128-GCM-128-96" + ] + } + ] + } + ] + } + } + }, + { + "type": "cryptographic-asset", + "refId": "protocol-esp-child-a-observed", + "name": "ESP Child SA A (site-to-site), observed", + "cryptoProperties": { + "assetType": "protocol", + "protocolProperties": { + "type": "esp", + "composition": [ + { + "role": "encryption", + "selection": "one-of", + "selectedBy": "negotiation", + "selectingParty": "responder", + "algorithmSet": [ + { + "name": "ENCR_AES_GCM_16", + "algorithms": [ + "AES-256-GCM-128-96" + ] + } + ] + } + ] + } + } + }, + { + "type": "cryptographic-asset", + "refId": "protocol-ipsec", + "name": "IPsec", + "cryptoProperties": { + "assetType": "protocol", + "protocolProperties": { + "type": "ipsec", + "version": "3", + "composition": [ + { + "role": "key-management", + "selection": "one-of", + "selectedBy": "configuration", + "algorithmSet": [ + { + "protocol": "ike", + "version": "2" + } + ] + }, + { + "role": "packet-protection", + "selection": "any-of", + "selectedBy": "configuration", + "algorithmSet": [ + { + "protocol": "esp" + } + ] + } + ], + "relatedCryptographicAssets": [ + { + "type": "protocol", + "ref": "protocol-ike-configured" + }, + { + "type": "protocol", + "ref": "protocol-esp-child-a-configured" + }, + { + "type": "protocol", + "ref": "protocol-esp-child-b-configured" + }, + { + "type": "protocol", + "ref": "protocol-esp-child-a-observed" + } + ] + } + } + } + ] + } + ] +} diff --git a/tools/src/test/resources/2.0/valid-cryptography-protocol-composition-ssh-2.0.json b/tools/src/test/resources/2.0/valid-cryptography-protocol-composition-ssh-2.0.json new file mode 100644 index 000000000..6dc1a0f3f --- /dev/null +++ b/tools/src/test/resources/2.0/valid-cryptography-protocol-composition-ssh-2.0.json @@ -0,0 +1,138 @@ +{ + "$schema": "https://cyclonedx.org/schema/2.0/cyclonedx-2.0.schema.json", + "specFormat": "CycloneDX", + "specVersion": "2.0", + "version": 1, + "serialNumber": "urn:uuid:3b79e304-098a-4221-a12d-795a0ec59329", + "inventories": [ + { + "subject": { + "refId": "subject-1", + "type": "application", + "name": "Acme Server", + "version": "1.0" + }, + "components": [ + { + "type": "cryptographic-asset", + "refId": "protocol-ssh-server", + "name": "SSH server", + "cryptoProperties": { + "assetType": "protocol", + "protocolProperties": { + "type": "ssh", + "version": "2.0", + "composition": [ + { + "role": "key-exchange", + "selection": "one-of", + "selectedBy": "negotiation", + "selectingParty": "client", + "algorithmSet": [ + { + "name": "mlkem768x25519-sha256", + "algorithms": [ + "ML-KEM-768", + "x25519", + "SHA-256" + ] + }, + { + "name": "curve25519-sha256", + "algorithms": [ + "x25519", + "SHA-256" + ] + } + ] + }, + { + "role": "signature", + "selection": "one-of", + "selectedBy": "negotiation", + "selectingParty": "client", + "algorithmSet": [ + { + "name": "ssh-ed25519", + "algorithms": [ + "Ed25519" + ] + }, + { + "name": "rsa-sha2-512", + "algorithms": [ + "RSA-PKCS1-1.5-SHA-512" + ] + } + ] + }, + { + "role": "encryption", + "selection": "one-of", + "selectedBy": "negotiation", + "selectingParty": "client", + "algorithmSet": [ + { + "name": "chacha20-poly1305@openssh.com", + "algorithms": [ + "ChaCha20", + "Poly1305" + ] + }, + { + "name": "aes256-gcm@openssh.com", + "algorithms": [ + "AES-256-GCM-128-96" + ] + } + ] + }, + { + "role": "integrity", + "selection": "one-of", + "selectedBy": "negotiation", + "selectingParty": "client", + "algorithmSet": [ + { + "name": "hmac-sha2-256", + "algorithms": [ + "HMAC-SHA-256-256" + ] + } + ] + } + ] + } + } + }, + { + "type": "cryptographic-asset", + "refId": "protocol-ssh-host-key", + "name": "SSH host key, observed", + "cryptoProperties": { + "assetType": "protocol", + "protocolProperties": { + "type": "ssh", + "composition": [ + { + "role": "signature", + "selection": "one-of", + "selectedBy": "negotiation", + "selectingParty": "client", + "algorithmSet": [ + { + "name": "ssh-ed25519", + "algorithms": [ + "Ed25519" + ] + } + ] + } + ] + } + } + } + ] + } + ] +} diff --git a/tools/src/test/resources/2.0/valid-cryptography-protocol-composition-tls-2.0.json b/tools/src/test/resources/2.0/valid-cryptography-protocol-composition-tls-2.0.json new file mode 100644 index 000000000..f52732a57 --- /dev/null +++ b/tools/src/test/resources/2.0/valid-cryptography-protocol-composition-tls-2.0.json @@ -0,0 +1,216 @@ +{ + "$schema": "https://cyclonedx.org/schema/2.0/cyclonedx-2.0.schema.json", + "specFormat": "CycloneDX", + "specVersion": "2.0", + "version": 1, + "serialNumber": "urn:uuid:f952d999-2ace-4d4b-840c-b5d3c00c3c18", + "inventories": [ + { + "subject": { + "refId": "subject-1", + "type": "application", + "name": "Acme Gateway", + "version": "1.0" + }, + "components": [ + { + "type": "cryptographic-asset", + "refId": "protocol-tls-server", + "name": "TLS 1.3 server", + "cryptoProperties": { + "assetType": "protocol", + "protocolProperties": { + "type": "tls", + "version": "1.3", + "composition": [ + { + "role": "key-exchange", + "selection": "one-of", + "selectedBy": "negotiation", + "selectingParty": "server", + "algorithmSet": [ + { + "name": "X25519MLKEM768", + "algorithms": [ + "x25519", + "ML-KEM-768" + ] + }, + { + "name": "x25519", + "algorithms": [ + "x25519" + ] + }, + { + "name": "secp256r1", + "algorithms": [ + "ECDHE-secp256r1" + ] + }, + { + "name": "ffdhe2048", + "algorithms": [ + "FFDHE-ffdhe2048" + ] + } + ] + }, + { + "role": "signature", + "selection": "one-of", + "selectedBy": "negotiation", + "selectingParty": "server", + "algorithmSet": [ + { + "name": "ecdsa_secp256r1_sha256", + "algorithms": [ + "ECDSA-secp256r1-SHA-256" + ] + }, + { + "name": "rsa_pss_rsae_sha256", + "algorithms": [ + "RSA-PSS-SHA-256-MGF1-SHA-256-32" + ] + } + ] + }, + { + "role": "cert-chain-signature", + "selection": "any-of", + "selectedBy": "configuration", + "algorithmSet": [ + { + "name": "ecdsa_secp256r1_sha256", + "algorithms": [ + "ECDSA-secp256r1-SHA-256" + ] + }, + { + "name": "rsa_pkcs1_sha256", + "algorithms": [ + "RSA-PKCS1-1.5-SHA-256" + ] + } + ] + }, + { + "role": "encryption", + "selection": "one-of", + "selectedBy": "negotiation", + "selectingParty": "server", + "algorithmSet": [ + { + "name": "TLS_AES_128_GCM_SHA256", + "algorithms": [ + "AES-128-GCM-128-96", + "HKDF-SHA-256" + ] + }, + { + "name": "TLS_AES_256_GCM_SHA384", + "algorithms": [ + "AES-256-GCM-128-96", + "HKDF-SHA-384" + ] + }, + { + "name": "TLS_CHACHA20_POLY1305_SHA256", + "algorithms": [ + "ChaCha20-Poly1305", + "HKDF-SHA-256" + ] + } + ] + } + ] + } + } + }, + { + "type": "cryptographic-asset", + "refId": "protocol-tls-observed", + "name": "TLS endpoint, partly observed", + "cryptoProperties": { + "assetType": "protocol", + "protocolProperties": { + "type": "tls", + "composition": [ + { + "role": "key-exchange", + "selection": "one-of", + "selectedBy": "negotiation", + "selectingParty": "server", + "algorithmSet": [ + { + "name": "x25519", + "algorithms": [ + "x25519" + ] + } + ] + }, + { + "role": "signature", + "selection": "one-of", + "selectedBy": "negotiation", + "selectingParty": "server", + "algorithmSet": [ + { + "name": "ed25519", + "algorithms": [ + "Ed25519" + ] + } + ] + } + ] + } + } + }, + { + "type": "cryptographic-asset", + "refId": "protocol-tls-client", + "name": "TLS 1.3 client (embedded)", + "cryptoProperties": { + "assetType": "protocol", + "protocolProperties": { + "type": "tls", + "version": "1.3", + "composition": [ + { + "role": "key-exchange", + "selection": "one-of", + "selectedBy": "build-time", + "algorithmSet": [ + { + "name": "secp256r1", + "algorithms": [ + "ECDHE-secp256r1" + ] + } + ] + }, + { + "role": "encryption", + "selection": "one-of", + "selectedBy": "build-time", + "algorithmSet": [ + { + "name": "TLS_AES_128_CCM_SHA256", + "algorithms": [ + "AES-128-CCM-128-96", + "HKDF-SHA-256" + ] + } + ] + } + ] + } + } + } + ] + } + ] +}