@@ -326,6 +326,97 @@ Pull image policy. The default is **missing**.
326326
327327@@option runtime-flag
328328
329+ #### **--sbom**=*preset*
330+
331+ Generate SBOMs (Software Bills Of Materials) for the output image by scanning
332+ the working container and build contexts using the named combination of scanner
333+ image, scanner commands, and merge strategy. Must be specified with one or
334+ more of **--sbom-image-output**, **--sbom-image-purl-output**, **--sbom-output**,
335+ and **--sbom-purl-output**. Recognized presets, and the set of options which
336+ they equate to:
337+
338+ - "syft", "syft-cyclonedx":
339+ --sbom-scanner-image=ghcr.io/anchore/syft
340+ --sbom-scanner-command="/syft scan -q dir:{ROOTFS} --output cyclonedx-json={OUTPUT}"
341+ --sbom-scanner-command="/syft scan -q dir:{CONTEXT} --output cyclonedx-json={OUTPUT}"
342+ --sbom-merge-strategy=merge-cyclonedx-by-component-name-and-version
343+ - "syft-spdx":
344+ --sbom-scanner-image=ghcr.io/anchore/syft
345+ --sbom-scanner-command="/syft scan -q dir:{ROOTFS} --output spdx-json={OUTPUT}"
346+ --sbom-scanner-command="/syft scan -q dir:{CONTEXT} --output spdx-json={OUTPUT}"
347+ --sbom-merge-strategy=merge-spdx-by-package-name-and-versioninfo
348+ - "trivy", "trivy-cyclonedx":
349+ --sbom-scanner-image=ghcr.io/aquasecurity/trivy
350+ --sbom-scanner-command="trivy filesystem -q {ROOTFS} --format cyclonedx --output {OUTPUT}"
351+ --sbom-scanner-command="trivy filesystem -q {CONTEXT} --format cyclonedx --output {OUTPUT}"
352+ --sbom-merge-strategy=merge-cyclonedx-by-component-name-and-version
353+ - "trivy-spdx":
354+ --sbom-scanner-image=ghcr.io/aquasecurity/trivy
355+ --sbom-scanner-command="trivy filesystem -q {ROOTFS} --format spdx-json --output {OUTPUT}"
356+ --sbom-scanner-command="trivy filesystem -q {CONTEXT} --format spdx-json --output {OUTPUT}"
357+ --sbom-merge-strategy=merge-spdx-by-package-name-and-versioninfo
358+
359+ #### **--sbom-image-output**=*path*
360+
361+ When generating SBOMs, store the generated SBOM in the specified path in the
362+ output image. There is no default.
363+
364+ #### **--sbom-image-purl-output**=*path*
365+
366+ When generating SBOMs, scan them for PURL ([package
367+ URL](https://github.com/package-url/purl-spec/blob/master/PURL-SPECIFICATION.rst))
368+ information, and save a list of found PURLs to the specified path in the output
369+ image. There is no default.
370+
371+ #### **--sbom-merge-strategy**=*method*
372+
373+ If more than one **--sbom-scanner-command** value is being used, use the
374+ specified method to merge the output from later commands with output from
375+ earlier commands. Recognized values include:
376+
377+ - cat
378+ Concatenate the files.
379+ - merge-cyclonedx-by-component-name-and-version
380+ Merge the "component" fields of JSON documents, ignoring values from
381+ documents when the combination of their "name" and "version" values is
382+ already present. Documents are processed in the order in which they are
383+ generated, which is the order in which the commands that generate them
384+ were specified.
385+ - merge-spdx-by-package-name-and-versioninfo
386+ Merge the "package" fields of JSON documents, ignoring values from
387+ documents when the combination of their "name" and "versionInfo" values is
388+ already present. Documents are processed in the order in which they are
389+ generated, which is the order in which the commands that generate them
390+ were specified.
391+
392+ #### **--sbom-output**=*file*
393+
394+ When generating SBOMs, store the generated SBOM in the named file on the local
395+ filesystem. There is no default.
396+
397+ #### **--sbom-purl-output**=*file*
398+
399+ When generating SBOMs, scan them for PURL ([package
400+ URL](https://github.com/package-url/purl-spec/blob/master/PURL-SPECIFICATION.rst))
401+ information, and save a list of found PURLs to the named file in the local
402+ filesystem. There is no default.
403+
404+ #### **--sbom-scanner-command**=*image*
405+
406+ Generate SBOMs by running the specified command from the scanner image. If
407+ multiple commands are specified, they are run in the order in which they are
408+ specified. These text substitutions are performed:
409+ - {ROOTFS}
410+ The root of the built image's filesystem, bind mounted.
411+ - {CONTEXT}
412+ The build context and additional build contexts, bind mounted.
413+ - {OUTPUT}
414+ The name of a temporary output file, to be read and merged with others or copied elsewhere.
415+
416+ #### **--sbom-scanner-image**=*image*
417+
418+ Generate SBOMs using the specified scanner image.
419+
329420@@option secret.image
330421
331422@@option security-opt.image
0 commit comments