|
| 1 | +# Dependencies |
| 2 | + |
| 3 | +CycloneDX provides the ability to describe components and their dependency on other components. This relies on a |
| 4 | +component's `bom-ref` to associate the component with the dependency element in the graph. The only requirement for `bom-ref` |
| 5 | +is that it is unique within the BOM. Package URL (PURL) is an ideal choice for `bom-ref` as it will be both unique and |
| 6 | +readable. If PURL is not an option or not all components represented in the BOM contain a PURL, then UUID is recommended. |
| 7 | +A dependency graph is capable of representing both direct and transitive relationships. In CycloneDX representation |
| 8 | +`dependencies`, a dependency graph SHOULD be codified to be one node deep, meaning no nested child graphs. All |
| 9 | +relations are on the same level. |
| 10 | + |
| 11 | +Refer to the [CycloneDX Authoritative Guide to SBOM](https://cyclonedx.org/guides/) for additional details. |
| 12 | + |
| 13 | +In the context of cryptographic dependencies, CycloneDX provides some additional capabilities. As of CycloneDX v1.6, |
| 14 | +there are two types of dependencies: `dependsOn` and `provides`. |
| 15 | + |
| 16 | +| Dependency Type | Description | |
| 17 | +| --------------- | ------------| |
| 18 | +| `dependsOn` | The `bom-ref` identifiers of the components or services that are dependencies of this dependency object. | |
| 19 | +| `provides` | The `bom-ref` identifiers of the components or services that define a given specification or standard, which are provided or implemented by this dependency object. For example, a cryptographic library that implements a cryptographic algorithm. A component that implements another component does not imply that the implementation is in use. | |
| 20 | + |
| 21 | + |
| 22 | +The dependency type, dependsOn, is leveraged by classic SBOMs to define a complete graph of direct and transitive |
| 23 | +dependencies. However, for cryptographic and similar assets, "provides" allows for many additional use cases. |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | +The example shows an application (nginx) that uses the libssl cryptographic library. This library implements the TLSv1.2 |
| 28 | +protocol. The relationship between the application, the library and the protocol can be expressed by using the |
| 29 | +dependencies properties of the SBOM standard. |
| 30 | + |
| 31 | +Since a TLS protocol supports different cipher suites that include multiple algorithms, there should be a way to |
| 32 | +represent these relationships as part of the CBOM. Compared to adding the algorithms as "classic" dependencies to the |
| 33 | +protocol, we defined special property fields that allow referencing the deployment with additional meaning. |
| 34 | +The protocolProperties allows adding an array of algorithms to a cipher suite as part of the cipher suite array. |
| 35 | +By modeling and then referencing these algorithms, we can still have only one classical component at the SBOM level but |
| 36 | +a subtree of crypto dependencies within the crypto asset components. |
| 37 | + |
| 38 | +The following example illustrates a simple application with a dependency on a cryptographic library, which, in turn, |
| 39 | +implements AES-128-GCM. The cryptographic library also depends on another library. |
| 40 | + |
| 41 | +```json |
| 42 | +"dependencies": [ |
| 43 | + { |
| 44 | + "ref": "acme-application", |
| 45 | + "dependsOn": ["crypto-library"] |
| 46 | + }, |
| 47 | + { |
| 48 | + "ref": "crypto-library", |
| 49 | + "provides": ["aes128gcm"], |
| 50 | + "dependsOn": ["some-library"] |
| 51 | + } |
| 52 | +] |
| 53 | +``` |
| 54 | + |
| 55 | +<div style="page-break-after: always; visibility: hidden"> |
| 56 | +\newpage |
| 57 | +</div> |
0 commit comments