Skip to content

Commit cb9c48b

Browse files
retr0hclaude
andauthored
feat: add cosign signing and SBOM to docker publish (#277)
* feat: add cosign signing and SBOM to docker publish Sign images with cosign using GitHub OIDC keyless signing. Generate SBOM via BuildKit's built-in SBOM generator. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * docs: add cosign verification and SBOM to install docs Document image signing, signature verification, and SBOM download. Link to the GHCR package page. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * style: fix line wrapping in Docker install docs 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * docs: add Docker/cosign/SBOM badges and fix org references Add badges for GHCR container image, cosign signing, and SBOM. Fix all badge URLs from retr0h/osapi to osapi-io/osapi. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * fix: link SBOM badge to install docs with download instructions 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * fix: link cosign badge to install docs 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 8c5f69f commit cb9c48b

3 files changed

Lines changed: 38 additions & 6 deletions

File tree

.github/workflows/docker-publish.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
permissions:
99
contents: read
1010
packages: write
11+
id-token: write
1112

1213
jobs:
1314
publish:
@@ -43,9 +44,19 @@ jobs:
4344
password: ${{ secrets.GITHUB_TOKEN }}
4445

4546
- name: Build and push
47+
id: build
4648
uses: docker/build-push-action@v7
4749
with:
4850
context: .
4951
push: true
5052
platforms: linux/amd64,linux/arm64
5153
tags: ghcr.io/${{ github.repository }}:latest
54+
sbom: true
55+
56+
- name: Install cosign
57+
uses: sigstore/cosign-installer@v3
58+
59+
- name: Sign image with cosign
60+
env:
61+
DIGEST: ${{ steps.build.outputs.digest }}
62+
run: cosign sign --yes ghcr.io/${{ github.repository }}@${DIGEST}

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1-
[![release](https://img.shields.io/github/release/retr0h/osapi.svg?style=for-the-badge)](https://github.com/retr0h/osapi/releases/latest)
2-
[![codecov](https://img.shields.io/codecov/c/github/retr0h/osapi?token=NF0T86B1EP&style=for-the-badge)](https://codecov.io/gh/retr0h/osapi)
1+
[![release](https://img.shields.io/github/release/osapi-io/osapi.svg?style=for-the-badge)](https://github.com/osapi-io/osapi/releases/latest)
2+
[![codecov](https://img.shields.io/codecov/c/github/osapi-io/osapi?token=NF0T86B1EP&style=for-the-badge)](https://codecov.io/gh/osapi-io/osapi)
33
[![go report card](https://goreportcard.com/badge/github.com/retr0h/osapi?style=for-the-badge)](https://goreportcard.com/report/github.com/retr0h/osapi)
44
[![license](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=for-the-badge)](LICENSE)
5-
[![build](https://img.shields.io/github/actions/workflow/status/retr0h/osapi/go.yml?style=for-the-badge)](https://github.com/retr0h/osapi/actions/workflows/go.yml)
5+
[![build](https://img.shields.io/github/actions/workflow/status/osapi-io/osapi/go.yml?style=for-the-badge)](https://github.com/osapi-io/osapi/actions/workflows/go.yml)
6+
[![docker](https://img.shields.io/badge/ghcr.io-osapi-blue?style=for-the-badge&logo=docker&logoColor=white)](https://github.com/osapi-io/osapi/pkgs/container/osapi)
7+
[![cosign](https://img.shields.io/badge/signed-cosign-blueviolet?style=for-the-badge&logo=sigstore&logoColor=white)](https://osapi-io.github.io/osapi/#docker)
8+
[![sbom](https://img.shields.io/badge/SBOM-attached-green?style=for-the-badge)](https://osapi-io.github.io/osapi/#docker)
69
[![powered by](https://img.shields.io/badge/powered%20by-goreleaser-green.svg?style=for-the-badge)](https://github.com/goreleaser)
710
[![conventional commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg?style=for-the-badge)](https://conventionalcommits.org)
811
![openapi initiative](https://img.shields.io/badge/openapiinitiative-%23000000.svg?style=for-the-badge&logo=openapiinitiative&logoColor=white)
912
![Linux](https://img.shields.io/badge/Linux-FCC624?style=for-the-badge&logo=linux&logoColor=black)
10-
![gitHub commit activity](https://img.shields.io/github/commit-activity/m/retr0h/osapi?style=for-the-badge)
13+
![gitHub commit activity](https://img.shields.io/github/commit-activity/m/osapi-io/osapi?style=for-the-badge)
1114

1215
# OS API
1316

docs/docs/sidebar/intro.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,29 @@ Or download a prebuilt binary from the [releases][] page.
2525

2626
### Docker
2727

28-
A distroless image is published to GitHub Container Registry on every commit to
29-
main:
28+
A multi-arch distroless image is published to [GitHub Container Registry][ghcr]
29+
on every commit to main. Images are signed with [cosign][] (keyless, via GitHub
30+
OIDC) and include an [SBOM][] attestation.
3031

3132
```bash
3233
docker pull ghcr.io/osapi-io/osapi:latest
3334
docker run ghcr.io/osapi-io/osapi:latest --help
3435
```
3536

37+
Verify the image signature:
38+
39+
```bash
40+
cosign verify ghcr.io/osapi-io/osapi:latest \
41+
--certificate-oidc-issuer https://token.actions.githubusercontent.com \
42+
--certificate-identity-regexp github.com/osapi-io/osapi
43+
```
44+
45+
Download the SBOM:
46+
47+
```bash
48+
cosign download sbom ghcr.io/osapi-io/osapi:latest
49+
```
50+
3651
## Quickstart
3752

3853
Install OSAPI and start all three components in a single process:
@@ -96,4 +111,7 @@ osapi client health
96111
[Cockpit]: https://cockpit-project.org/
97112
[webmin]: https://webmin.com/
98113
[releases]: https://github.com/retr0h/osapi/releases
114+
[ghcr]: https://github.com/osapi-io/osapi/pkgs/container/osapi
115+
[cosign]: https://github.com/sigstore/cosign
116+
[SBOM]: https://en.wikipedia.org/wiki/Software_supply_chain
99117
<!-- prettier-ignore-end -->

0 commit comments

Comments
 (0)