|
1 | 1 | +++
|
2 |
| -title="Structured Bill of Materials" |
3 |
| -summary="A Software `Structured Bill-of-Materials` (`SBoM`) gives you a layer-by-layer view of what's inside your container in a variety of formats." |
| 2 | +title="Software Bill of Materials" |
| 3 | +summary="A Software `Software Bill-of-Materials` (`SBoM`) gives you a layer-by-layer view of what's inside your container in a variety of formats." |
4 | 4 | +++
|
5 | 5 |
|
6 | 6 | ## Summary
|
7 | 7 |
|
8 |
| -A **Structured-Bill-of-Materials** (`SBoM`) provides information necessary to know what's inside your container and how it was constructed. |
9 |
| -Cloud Native Buildpacks provides Structured-Bill-of-Materials in either CycloneDX, SPDX, or Syft format. |
| 8 | +A **Software-Bill-of-Materials** (`SBoM`) lists all the software components included in an image. Cloud Native Buildpacks provides all the transparency you need to have confidence in your image supply chain. Software-Bill-of-Materials in [CycloneDX](https://cyclonedx.org/), [Syft](https://github.com/anchore/syft) and [Spdx](https://spdx.dev/) formats are supported. |
10 | 9 |
|
11 | 10 | 1. Buildpacks can populate `SBoM` information about the dependencies they have provided.
|
12 |
| -2. A list of what buildpacks were used to build the application. |
13 |
| - |
14 |
| -## Adding Bill of Materials |
15 |
| - |
16 |
| -Use the following tutorial to add a `Bill-of-Materials` using buildpacks. <br/> |
17 |
| -[Adding bill of materials][adding-bill-of-materials] |
18 | 11 |
|
19 | 12 | ## Viewing Bill of Materials
|
20 | 13 |
|
21 |
| -You can use the `download-sbom` command to inspect your app for its `Structured-Bill-of-Materials`. The following command will download the application layer containing the `SBoM` files to `./layers/sbom/...` on your local filesystem. |
| 14 | +You can use the `sbom download` command to inspect your app for its Software-Bill-of-Materials. The following command will download the application layer containing the `SBoM` files to `./layers/sbom/...` on your local filesystem. |
22 | 15 |
|
23 | 16 | ```bash
|
24 |
| -pack download-sbom your-image-name |
| 17 | +pack sbom download your-image-name |
25 | 18 | ```
|
26 | 19 |
|
27 | 20 | You can also choose to download the `SBoM` from an image hosted in a remote registry, as opposed to an image hosted in a Docker daemon. You use the `--remote` flag to do so.
|
28 | 21 |
|
29 | 22 | ```bash
|
30 |
| -pack download-sbom your-image-name --remote |
| 23 | +pack sbom download your-image-name --remote |
31 | 24 | ```
|
32 | 25 |
|
33 |
| -Cloud Native Buildpacks support `SBoM` metadata in [CycloneDX](https://cyclonedx.org/), [Syft](https://github.com/anchore/syft) or [Spdx](https://spdx.dev/) formats. The following example demonstrates `syft` format `SBoM` metadata to the local filesystem. The combined metadata from all of the `sbom.syft.json` files is the image `SBoM`. Where CycloneDX `SBoM` metadata is generated, the files are named `sbom.cdx.json`. Similarly, Spdx files are named `sbom.cdx.json`. |
| 26 | +The following example demonstrates running `pack sbom download ...` on an image containing an `SBoM` in `syft` format. Running `pack sbom download ...` creates a `layers/sbom` directory and populates that directory with `sbom.syft.json` files. The combined metadata from all of the `sbom.syft.json` files is the image `SBoM`. Where an image generates CycloneDX `SBoM` metadata, the files a named `sbom.cdx.json`. Similarly, Spdx files are named `sbom.cdx.json`. |
34 | 27 |
|
35 | 28 | ```bash
|
36 |
| -. |
37 |
| -└── layers |
38 |
| - └── sbom |
39 |
| - └── launch |
40 |
| - └── paketo-buildpacks_ca-certificates |
41 |
| - ├── helper |
42 |
| - │ └── sbom.syft.json |
43 |
| - └── sbom.syft.json |
| 29 | +layers |
| 30 | + └── sbom |
| 31 | + └── launch |
| 32 | + └── paketo-buildpacks_ca-certificates |
| 33 | + ├── helper |
| 34 | + │ └── sbom.syft.json |
| 35 | + └── sbom.syft.json |
44 | 36 | ```
|
45 | 37 |
|
46 |
| -The layer information is stored under the `io.buildpacks.lifecycle.metadata` label of the application image. |
47 |
| -```bash |
48 |
| -docker inspect your-image-name | jq -r '.[0].Config.Labels["io.buildpacks.lifecycle.metadata"]' | jq -r .sbom |
49 |
| -{ |
50 |
| - "sha": "sha256:abcd1234defg5678" |
51 |
| -} |
52 |
| -``` |
| 38 | +## Adding Bill of Materials |
| 39 | + |
| 40 | +[`pack`](https://github.com/buildpacks/pack), [`kpack`](https://github.com/pivotal/kpack) and [tekton](https://tekton.dev/) users will find that images created using these tools contain an SBoM. |
| 41 | + |
| 42 | +Developers writing a new buildpack or updating an existing buildpack should use the [Adding bill of materials][adding-bill-of-materials] tutorial to incorporate a `Bill-of-Materials` in their buildpack. |
53 | 43 |
|
54 | 44 | [adding-bill-of-materials]: /docs/buildpack-author-guide/create-buildpack/adding-bill-of-materials/
|
0 commit comments