Skip to content

Commit

Permalink
docs: use syft to generate a sbom manually
Browse files Browse the repository at this point in the history
  • Loading branch information
y-eight committed Jan 3, 2025
1 parent 339b31e commit 3a8550d
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
23 changes: 23 additions & 0 deletions scripts/sbom/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generate SBOM with Syft

This doc can be used to generate a SBOM manually with [Syft](https://github.com/anchore/syft).

## Usage

Install the Syft binary.

Use the following command to generate a simple SBOM file form the repository:

```SH
syft .
```

Alternative output variants can be found [here](https://github.com/anchore/syft/wiki/Output-Formats).

Use the following command to generate a SBOM markdown file using the `example.sbom.tmpl` goTemplate template file:

```SH
SYFT_GOLANG_SEARCH_REMOTE_LICENSES=true syft ghcr.io/caas-team/sparrow:v0.5.0 -o template -t syft.sbom.tmpl
```

Setting the env variable `SYFT_GOLANG_SEARCH_REMOTE_LICENSES=true` will ensure to lookup licenses remotely. In this example the sparrow image in version `v0.5.0` is scanned.
5 changes: 5 additions & 0 deletions scripts/sbom/example.sbom.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
| Package | Type | Version | Licenses |
| ------- | ---- | ------- | -------- |
{{- range .artifacts}}
| {{.name}} | {{.type}} | {{.version}} | {{range .licenses}}{{.value}}, {{end}} |
{{- end}}

0 comments on commit 3a8550d

Please sign in to comment.