Skip to content

Commit a6a0561

Browse files
committed
Add sbom format to buildpacks toml
Signed-off-by: Sambhav Kothari <[email protected]>
1 parent 1fe273b commit a6a0561

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

text/0000-sbom.md

+18
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,23 @@ The motivation for supporting multiple SBOM formats is because there is currentl
6464
Currently the SBOM is defined in the `<layer>.toml`, `launch.toml` and `build.toml` respectively under the `[bom]` table.
6565
It may not be the most user-friendly way for buildpack authors to create SBOM documents in the above format. This RFC proposes that the `bom` be moved to `<layer>.bom.<ext>`, `launch.bom.<ext>` and `build.bom.<ext>` instead where `<ext>` will be `cdx.json` for CycloneDX documents and `spdx.json` for SPDX documents. A buildpack can also output the `bom` in multiple formats i.e. both CycloneDX and SPDX.
6666

67+
Additionally the buildpack must also indicate the SBOM format(s) it exports using the in its `buildapck.toml`'s `sbom` key in the `buildpacks` table.
68+
69+
The format of this key should look like -
70+
71+
```toml
72+
api = "0.x"
73+
74+
[buildpack]
75+
id = "<buildpack ID>"
76+
name = "<buildpack name>"
77+
# This can be an array of supported SBOM formats by the buildpack.
78+
# Valid array values are "CycloneDX" and "SPDX" as of this RFC.
79+
sbom = ["CycloneDX"]
80+
```
81+
82+
This information can be displayed on the registry and `pack inspect-buildpack`.
83+
6784
The lifecycle of the respective `bom` files during rebuilds would be exactly the same as the `bom` table currently.
6885

6986
The lifecycle would be responsible for taking all of the above `bom` files, and putting them in `/layers/config/sbom/<buildpack-id>/<layer-id>/<type>.bom.<ext>` for the layer `bom` files where `type` call be `build` or `launch` or `both`. Buildpack level BOM files will reside at `/layers/config/sbom/<buildpack-id>/build.bom.<ext>` and `/layers/config/sbom/<buildpack-id>/launch.bom.<ext>` for the `launch` and `build` `bom` respectively.
@@ -74,6 +91,7 @@ Merging different formats (CycloneDX/SPDX/Legacy CNB format) is a non-goal and w
7491

7592
Since we will be preserving the original output files and if a buildpack chooses to output in both SPDX and CycloneDX, the lifecycle may eventually add support for SPDX merging in a future version if merging SPDX documents becomes better defined/efficient.
7693

94+
7795
# How it Works
7896
[how-it-works]: #how-it-works
7997

0 commit comments

Comments
 (0)