|
| 1 | ++++ |
| 2 | +title="Platform API 0.7 -> 0.8" |
| 3 | ++++ |
| 4 | + |
| 5 | +<!--more--> |
| 6 | + |
| 7 | +This guide is most relevant to platform operators. |
| 8 | + |
| 9 | +See the [spec release](https://github.com/buildpacks/spec/releases/tag/platform%2Fv0.8) for platform API 0.8 for the full list of changes and further details. |
| 10 | + |
| 11 | +## Platform Operator |
| 12 | + |
| 13 | +### New standardized SBOM format |
| 14 | + |
| 15 | +Buildpacks implementing Buildpack API 0.7+ may output write Software Bill of Materials (SBOM) files describing build- or run-time dependencies. These files must use the `application/vnd.cyclonedx+json`, `application/spdx+json`, or `application/vnd.syft+json` media types (a buildpack may output SBOM files in multiple formats). Files may be written to the following locations: |
| 16 | + |
| 17 | +* `<layers>/<buildpack-id>/<layer>.sbom.<ext>` - for describing dependencies associated with a layer |
| 18 | +* `<layers>/<buildpack-id>/launch.sbom.<ext>` - for describing run-time dependencies not associated with a layer |
| 19 | +* `<layers>/<buildpack-id>/build.sbom.<ext>` - for describing build-time dependencies not associated with a layer |
| 20 | + |
| 21 | +Valid `<ext>` extensions are as follows: |
| 22 | + | SBOM Media Type | File Extension |
| 23 | + |----------------------------------|---------------------------------------------- |
| 24 | + | `application/vnd.cyclonedx+json` | `cdx.json` |
| 25 | + | `application/spdx+json` | `spdx.json` |
| 26 | + | `application/vnd.syft+json` | `syft.json` |
| 27 | + |
| 28 | +#### Launch |
| 29 | + |
| 30 | +SBOM files for launch will be included in the application image at the following locations: |
| 31 | + |
| 32 | +* `<layers>/<buildpack-id>/<layer>.sbom.<ext>` (as written by the buildpack) is moved to `<layers>/sbom/launch/<buildpack-id>/<layer>/sbom.<ext>` for launch layers |
| 33 | +* `<layers>/<buildpack-id>/launch.sbom.<ext>` (as written by the buildpack) is moved to `<layers>/sbom/launch/<buildpack-id>/sbom.<ext>` |
| 34 | + |
| 35 | +The platform can retrieve the digest of the layer containing the SBOM files by reading the `sbom` key from the `io.buildpacks.lifecycle.metadata` label. |
| 36 | + |
| 37 | +#### Build |
| 38 | + |
| 39 | +SBOM files for build will be available in the build container at the following locations: |
| 40 | + |
| 41 | +* `<layers>/<buildpack-id>/<layer>.sbom.<ext>` (as written by the buildpack) is moved to `<layers>/sbom/build/<buildpack-id>/<layer>/sbom.<ext>` for non-launch layers |
| 42 | +* `<layers>/<buildpack-id>/build.sbom.<ext>` (as written by the buildpack) is moved to `<layers>/sbom/build/<buildpack-id>/sbom.<ext>` |
| 43 | + |
| 44 | +Note that the `<layers>/sbom/build` directory is NOT present in the application image. It may be saved off by the platform prior to the build container exiting. |
| 45 | + |
| 46 | +#### Backwards compatibility - older buildpacks |
| 47 | + |
| 48 | +Platforms can continue to retrieve BOM information output by buildpacks implementing Buildpack API < 0.7 by reading the `bom` key in the `io.buildpacks.build.metadata` label (for run-time dependencies), and by saving off report.toml prior to the build container exiting (for build-time dependencies). |
0 commit comments