Skip to content

Commit

Permalink
Add signatures for keyless signing (#1361)
Browse files Browse the repository at this point in the history
  • Loading branch information
wata727 authored Apr 30, 2022
1 parent c58eafb commit 77afa88
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
tags:
- v*.*.*

permissions:
contents: write
id-token: write

jobs:
goreleaser:
runs-on: ubuntu-latest
Expand All @@ -19,6 +23,10 @@ jobs:
uses: actions/setup-go@v3
with:
go-version: 1.18
- name: Install Cosign
uses: sigstore/cosign-installer@v2.2.1
with:
cosign-release: 'v1.7.2'
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
Expand Down
13 changes: 13 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,19 @@ changelog:
skip: true
checksum:
name_template: 'checksums.txt'
signs:
- cmd: cosign
env:
- COSIGN_EXPERIMENTAL=1
signature: '${artifact}.keyless.sig'
certificate: '${artifact}.pem'
output: true
artifacts: checksum
args:
- sign-blob
- '--output-certificate=${certificate}'
- '--output-signature=${signature}'
- '${artifact}'
release:
github:
owner: terraform-linters
Expand Down
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,25 @@ Chocolatey (Windows):
choco install tflint
```

### Verification

GnuPG

```
gpg --import 8CE69160EB3F2FE9.key
gpg --verify checksum.txt.sig checksum.txt
sha256sum --ignore-missing -c checksums.txt
```

Cosign (experimental)

```
COSIGN_EXPERIMENTAL=1 cosign verify-blob --signature checksums.txt.keyless.sig checksums.txt
sha256sum --ignore-missing -c checksums.txt
```

**IMPORTANT:** Keyless Signing is in development and you should not completely trust this way. For instance, you have not validated the OIDC subject claim, so it is not guaranteed to be the public key issued by the maintainers.

### Docker

Instead of installing directly, you can use the Docker images:
Expand Down

0 comments on commit 77afa88

Please sign in to comment.