46 lines
2.0 KiB
Markdown
46 lines
2.0 KiB
Markdown
# sbom — IntegraCI Dagger module
|
|
|
|
Engine-agnostic Software Bill of Materials (SBOM) generation. Callable from
|
|
any CI engine via `dagger call`. Translates the GitHub-Actions-only intent of
|
|
`security_pipeline_adapter.build_sbom_step` into canonical tool CLIs run inside
|
|
official containers.
|
|
|
|
## Verb
|
|
|
|
### `generate`
|
|
|
|
```
|
|
dagger call generate --source . [--image-ref REF] [--generator NAME]
|
|
```
|
|
|
|
| arg | required | default | description |
|
|
| ------------ | -------- | ------- | -------------------------------------------------------- |
|
|
| `--source` | yes | — | source directory to analyze |
|
|
| `--image-ref`| no | "" | container image to scan instead of the filesystem |
|
|
| `--generator`| no | `syft` | `syft \| cyclonedx \| spdx-tools \| trivy \| none` |
|
|
|
|
Returns the SBOM document as a `File`.
|
|
|
|
## Generators
|
|
|
|
| generator | image | output | notes |
|
|
| ------------ | --------------------------- | ----------------------- | -------------------------------------- |
|
|
| `syft` | `anchore/syft` | CycloneDX JSON | source dir or `--image-ref` |
|
|
| `cyclonedx` | `cyclonedx/cyclonedx-cli` | CycloneDX JSON | converts existing `bom.{xml,json}` |
|
|
| `spdx-tools` | `anchore/syft` | SPDX JSON | practical SPDX generator; dir or image |
|
|
| `trivy` | `aquasec/trivy` | CycloneDX JSON | `trivy fs`/`trivy image` |
|
|
| `none` | `alpine` | skip marker JSON | no-op, mirrors adapter skip intent |
|
|
|
|
## Examples
|
|
|
|
```bash
|
|
# Default: Syft CycloneDX over the source tree
|
|
dagger call generate --source . -o sbom.cdx.json
|
|
|
|
# Trivy scanning a built image
|
|
dagger call generate --source . --image-ref ghcr.io/org/app:tag --generator trivy -o sbom.cdx.json
|
|
|
|
# SPDX document
|
|
dagger call generate --source . --generator spdx-tools -o sbom.spdx.json
|
|
```
|