Skip to content

Commit

Permalink
fix: syft example cmd path & better syft licenses template
Browse files Browse the repository at this point in the history
  • Loading branch information
y-eight committed Jan 20, 2025
1 parent 3cb2c57 commit 66000a6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions scripts/sbom/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ Install the Syft binary.

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

```SH
```shell
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
```shell
SYFT_GOLANG_SEARCH_REMOTE_LICENSES=true syft ghcr.io/caas-team/sparrow:v0.5.0 -o template -t scripts/sbom/example.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.
2 changes: 1 addition & 1 deletion scripts/sbom/example.sbom.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
| Package | Type | Version | Licenses |
| ------- | ---- | ------- | -------- |
{{- range .artifacts}}
| {{.name}} | {{.type}} | {{.version}} | {{range .licenses}}{{.value}}, {{end}} |
| {{.name}} | {{.type}} | {{.version}} | {{range $index, $licence := .licenses}}{{- if $index}}, {{end}}{{$licence.value}}{{end}} |
{{- end}}

0 comments on commit 66000a6

Please sign in to comment.