Skip to content
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

chore(ci): keyless signing #413

Merged
merged 15 commits into from
Dec 15, 2021
4 changes: 3 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ jobs:
needs:
- unit-tests
- Acceptance-Tests
permissions:
contents: write
id-token: write
steps:
-
name: Checkout
Expand Down Expand Up @@ -188,4 +191,3 @@ jobs:
DISCORD_WEBHOOK_ID: ${{ secrets.DISCORD_WEBHOOK_ID }}
DISCORD_WEBHOOK_TOKEN: ${{ secrets.DISCORD_WEBHOOK_TOKEN }}
FURY_TOKEN: ${{ secrets.FURY_TOKEN }}
COSIGN_PWD: ${{ secrets.COSIGN_PWD }}
25 changes: 17 additions & 8 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,25 @@ furies:

signs:
- cmd: cosign
stdin: '{{ .Env.COSIGN_PWD }}'
args: ["sign-blob", "-key=/tmp/goreleaser_cosign.key", "-output=${signature}", "${artifact}"]
artifacts: checksum
env:
- COSIGN_EXPERIMENTAL=1
certificate: '{{ trimsuffix .Env.artifact ".txt" }}.pem'
args:
- sign-blob
- '--oidc-issuer=https://token.actions.githubusercontent.com'
- '--output-certificate=${certificate}'
- '--output-signature=${signature}'
- '${artifact}'

docker_signs:
- artifacts: manifests
stdin: '{{ .Env.COSIGN_PWD }}'
args: ["sign", "-key=/tmp/goreleaser_cosign.key", "${artifact}"]
- cmd: cosign
env:
- COSIGN_EXPERIMENTAL=1
artifacts: manifests
args:
- 'sign'
- '--oidc-issuer=https://token.actions.githubusercontent.com'
- '${artifact}'

changelog:
sort: asc
Expand Down Expand Up @@ -181,8 +192,6 @@ checksum:
name_template: 'checksums.txt'

release:
extra_files:
- glob: cosign.pub
footer: |
**Full Changelog**: https://github.com/goreleaser/nfpm/compare/{{ .PreviousTag }}...{{ .Tag }}

Expand Down
2 changes: 2 additions & 0 deletions scripts/vercel/build.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/bin/bash
set -euo pipefail
version="$(curl -sSf -H "Authorization: Bearer $GITHUB_TOKEN" "https://api.github.com/repos/goreleaser/nfpm/releases/latest" | jq -r '.tag_name')"
sed -s'' -i "s/__VERSION__/$version/g" www/docs/install.md
mkdocs build -f www/mkdocs.yml
32 changes: 16 additions & 16 deletions www/docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,38 +69,38 @@ go install github.com/goreleaser/nfpm/v2/cmd/nfpm@latest

Download the pre-compiled binaries from the [releases page][releases] and copy them to the desired location.

## Verifying the binaries
## Veryifing the artifacts

All artifacts are checksummed and the checksum file is signed with [cosign][].
### binaries

You can verify it using [our public key](https://goreleaser.com/static/goreleaser.pub).
All artifacts are checksummed and the checksum is signed with [cosign][].

1. Download the files you want, the `checksums.txt` and `checksums.txt.sig` files from the [releases][releases] page:
```sh
wget https://github.com/goreleaser/nfpm/releases/download/__VERSION__/checksums.txt
wget https://github.com/goreleaser/nfpm/releases/download/__VERSION__/checksums.txt.sig
```

1. Download the files you want, the `checksums.txt` and `checksums.txt.sig` files from the [releases][releases] page.
1. Verify the signature:
```sh
cosign verify-blob \
-key https://goreleaser.com/static/goreleaser.pub \
-signature checksums.txt.sig \
COSIGN_EXPERIMENTAL=1 cosign verify-blob \
--signature checksums.txt.sig \
checksums.txt
```
1. If the signature is valid, you can then verify the SHA256 sums match with the downloaded binary:
```sh
sha256sum --ignore-missing -c checksums.txt
```

## Verifying docker images
### docker images

Our Docker image is signed with [cosign][].
Our Docker images are signed with [cosign][].

You can verify it using [our public key](https://goreleaser.com/static/goreleaser.pub):
Verify the signature:

```sh
cosign verify \
-key https://goreleaser.com/static/goreleaser.pub \
goreleaser/nfpm
cosign verify \
-key https://goreleaser.com/static/goreleaser.pub \
ghcr.io/goreleaser/nfpm
COSIGN_EXPERIMENTAL=1 cosign verify goreleaser/nfpm
COSIGN_EXPERIMENTAL=1 cosign verify ghcr.io/goreleaser/nfpm
```

## Running with Docker
Expand Down