-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: generate sboms for provided packeges in a release #247
base: main
Are you sure you want to change the base?
Changes from all commits
26dce0b
7a7257e
4b03d83
ee24a55
339b31e
3a8550d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,9 @@ jobs: | |
uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: go.mod | ||
|
||
- name: Install syft for sbom generation | ||
uses: anchore/sbom-action/[email protected] | ||
|
||
- name: Build snapshot artifacts | ||
uses: goreleaser/goreleaser-action@v6 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,6 +44,9 @@ jobs: | |
"network_plugin": "kathara/katharanp_vde" | ||
}' > ~/.config/kathara.conf | ||
|
||
- name: Install syft for sbom generation | ||
uses: anchore/sbom-action/[email protected] | ||
|
||
- name: Build binary for e2e | ||
uses: goreleaser/goreleaser-action@v6 | ||
with: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,9 @@ jobs: | |
registry: mtr.devops.telekom.de | ||
username: ${{ secrets.MTR_USERNAME }} | ||
password: ${{ secrets.MTR_PASSWORD }} | ||
|
||
- name: Install syft for sbom generation | ||
uses: anchore/sbom-action/[email protected] | ||
|
||
- name: Build, push & release | ||
uses: goreleaser/goreleaser-action@v6 | ||
|
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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the template file path is wrong :) 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. |
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}} | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe leave out the ❯ SYFT_GOLANG_SEARCH_REMOTE_LICENSES=true syft ghcr.io/caas-team/sparrow:v0.5.0 -o template -t scripts/sbom/example.sbom.tmpl
✔ Parsed image sha256:930220dd636d6eb9c4fb64fb6a3da870d47fda214c2421e5480b25b79ad87659
✔ Cataloged contents a3c35079ee159927516b3059d49f1b0e6c34fc1c62a545d6da1985490e971f42
├── ✔ Packages [53 packages]
├── ✔ File digests [1 files]
├── ✔ File metadata [1 locations]
└── ✔ Executables [1 executables]
| Package | Type | Version | Licenses |
| ------- | ---- | ------- | -------- |
| github.com/beorn7/perks | go-module | v1.0.1 | MIT, |
| github.com/caas-team/sparrow | go-module | v0.5.0 | |
| github.com/cenkalti/backoff/v4 | go-module | v4.3.0 | MIT, |
| github.com/cespare/xxhash/v2 | go-module | v2.3.0 | MIT, |
| github.com/fsnotify/fsnotify | go-module | v1.7.0 | BSD-3-Clause, |
... EDIT: I'll take a look on how to make this look proper, this can be done with go templating, if that's what they're using in syft. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, how about this:
This produces the following output: ❯ SYFT_GOLANG_SEARCH_REMOTE_LICENSES=true syft ghcr.io/caas-team/sparrow:v0.5.0 -o template -t scripts/sbom/example.sbom.tmpl
✔ Parsed image sha256:930220dd636d6eb9c4fb64fb6a3da870d47fda214c2421e5480b25b79ad87659
✔ Cataloged contents a3c35079ee159927516b3059d49f1b0e6c34fc1c62a545d6da1985490e971f42
├── ✔ Packages [53 packages]
├── ✔ File digests [1 files]
├── ✔ File metadata [1 locations]
└── ✔ Executables [1 executables]
| Package | Type | Version | Licenses |
| ------- | ---- | ------- | -------- |
| github.com/beorn7/perks | go-module | v1.0.1 | MIT |
| github.com/caas-team/sparrow | go-module | v0.5.0 | |
| github.com/cenkalti/backoff/v4 | go-module | v4.3.0 | MIT |
| github.com/cespare/xxhash/v2 | go-module | v2.3.0 | MIT |
| github.com/fsnotify/fsnotify | go-module | v1.7.0 | BSD-3-Clause |
| github.com/getkin/kin-openapi | go-module | v0.128.0 | MIT |
| github.com/go-chi/chi/v5 | go-module | v5.1.0 | MIT |
| github.com/go-logr/logr | go-module | v1.4.2 | Apache-2.0 |
| github.com/go-logr/stdr | go-module | v1.2.2 | Apache-2.0 |
| github.com/go-openapi/jsonpointer | go-module | v0.21.0 | Apache-2.0 |
| github.com/go-openapi/swag | go-module | v0.23.0 | Apache-2.0 |
| github.com/go-viper/mapstructure/v2 | go-module | v2.1.0 | MIT |
| github.com/google/uuid | go-module | v1.6.0 | BSD-3-Clause |
| github.com/grpc-ecosystem/grpc-gateway/v2 | go-module | v2.24.0 | BSD-3-Clause |
| github.com/invopop/yaml | go-module | v0.3.1 | BSD-3-Clause, MIT |
| github.com/josharian/intern | go-module | v1.0.0 | MIT |
| github.com/klauspost/compress | go-module | v1.17.9 | Apache-2.0, BSD-3-Clause, MIT |
... |
||
{{- end}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that
SH
is a supported github markdown info string. Just useshell
orbash
or justsh
?