|
| 1 | +# Verifying client binaries |
| 2 | + |
| 3 | +Knative ships a number of client (command-line) binaries which are installed and run on |
| 4 | +your local machine. This page describes how to verify that your downloaded binaries |
| 5 | +match those of a Knative release. While many of these steps may be handled by package |
| 6 | +installers like `brew`, you can always perform these steps by hand if you are unsure |
| 7 | +about the provenance of those binaries. |
| 8 | + |
| 9 | +## Code Signature Verification |
| 10 | + |
| 11 | +### All platforms |
| 12 | + |
| 13 | +Our releases from 1.9 are signed with [cosign](https://docs.sigstore.dev/cosign/overview). You can use the following steps to verify our binaries. |
| 14 | + |
| 15 | +1. Download the files you want, and the `checksums.txt`, `checksum.txt.pem` and `checksums.txt.sig` files from the releases page: |
| 16 | + ```sh |
| 17 | + # this example verifies the 1.10.0 kn cli from the knative/client repository |
| 18 | + wget https://github.com/knative/client/releases/download/knative-v1.10.0/checksums.txt |
| 19 | + wget https://github.com/knative/client/releases/download/knative-v1.10.0/kn-darwin-amd64 |
| 20 | + wget https://github.com/knative/client/releases/download/knative-v1.10.0/checksums.txt.sig |
| 21 | + wget https://github.com/knative/client/releases/download/knative-v1.10.0/checksums.txt.pem |
| 22 | + ``` |
| 23 | +1. Verify the signature: |
| 24 | + ```sh |
| 25 | + cosign verify-blob \ |
| 26 | + --certificate-identity=signer@knative-releases.iam.gserviceaccount.com \ |
| 27 | + --certificate-oidc-issuer=https://accounts.google.com \ |
| 28 | + --cert checksums.txt.pem \ |
| 29 | + --signature checksums.txt.sig \ |
| 30 | + checksums.txt |
| 31 | + ``` |
| 32 | +1. If the signature is valid, you can then verify the SHA256 sums match with the downloaded binary: |
| 33 | + ```sh |
| 34 | + sha256sum --ignore-missing -c checksums.txt |
| 35 | + ``` |
| 36 | + |
| 37 | +!!! note |
| 38 | + Knative images are signed in `KEYLESS` mode. To learn more about keyless signing, please refer to |
| 39 | + [Keyless Signatures](https://github.com/sigstore/cosign/blob/main/KEYLESS.md#keyless-signatures) |
| 40 | + Our signing identity(Subject) for our releases is `signer@knative-releases.iam.gserviceaccount.com` and the Issuer is `https://accounts.google.com` |
| 41 | + |
| 42 | +### Apple macOS |
| 43 | + |
| 44 | +In addition to signing our binaries with `cosign`, we [notarize](https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution) our macOS binaries. You can use the `codesign` utility to verify our binaries from 1.9 release. You should expect an output that looks |
| 45 | +like this. The expected TeamIdentifier is `7R64489VHL` |
| 46 | + |
| 47 | +``` |
| 48 | +codesign --verify -d --verbose=2 ~/Downloads/kn-quickstart-darwin-amd64 |
| 49 | + |
| 50 | +Executable=/Users/REDACTED/Downloads/kn-quickstart-darwin-amd64 |
| 51 | +Identifier=kn-quickstart-darwin-amd64 |
| 52 | +... |
| 53 | +Authority=Developer ID Application: Mahamed Ali (7R64489VHL) |
| 54 | +Authority=Developer ID Certification Authority |
| 55 | +Authority=Apple Root CA |
| 56 | +Timestamp=3 Oct 2022 at 22:50:07 |
| 57 | +... |
| 58 | +TeamIdentifier=7R64489VHL |
| 59 | +``` |
0 commit comments