Skip to content

Commit 9999d3a

Browse files
committed
Update cosign verify instructions for 2.0
Cosign 2.0 introduced significant command syntax changes to verify images and blobs
1 parent bf58bb4 commit 9999d3a

File tree

1 file changed

+27
-28
lines changed

1 file changed

+27
-28
lines changed

content/en/docs/tasks/administer-cluster/verify-signed-artifacts.md

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@ weight: 420
1111

1212
## {{% heading "prerequisites" %}}
1313

14-
These instructions are for Kubernetes {{< skew currentVersion >}}. If you want
14+
These instructions are for Kubernetes v{{< skew currentVersion >}}. If you want
1515
to check the integrity of components for a different version of Kubernetes,
1616
check the documentation for that Kubernetes release.
1717

1818
You will need to have the following tools installed:
1919

2020
- `cosign` ([install guide](https://docs.sigstore.dev/cosign/installation/))
2121
- `curl` (often provided by your operating system)
22+
- `jq` ([download jq](https://stedolan.github.io/jq/download/))
2223

2324
## Verifying binary signatures
2425

@@ -41,68 +42,66 @@ for FILE in "${FILES[@]}"; do
4142
done
4243
```
4344

44-
Then verify the blob by using `cosign`:
45+
Then verify the blob by using `cosign verify-blob`:
4546

4647
```shell
47-
cosign verify-blob "$BINARY" --signature "$BINARY".sig --certificate "$BINARY".cert
48+
cosign verify-blob "$BINARY" --signature "$BINARY".sig --certificate "$BINARY".cert --certificate-identity [email protected] --certificate-oidc-issuer https://accounts.google.com
4849
```
4950

50-
cosign v1.9.0 is required to be able to use the `--certificate` flag. Please use
51-
`--cert` for older versions of cosign.
52-
5351
{{< note >}}
52+
Cosign 2.0 requires the `--certificate-identity` and `--certificate-oidc-issuer` options.
53+
5454
To learn more about keyless signing, please refer to [Keyless
55-
Signatures](https://github.com/sigstore/cosign/blob/main/KEYLESS.md#keyless-signatures).
55+
Signatures](https://docs.sigstore.dev/cosign/keyless).
56+
57+
Previous versions of Cosign required that you set `COSIGN_EXPERIMENTAL=1`.
58+
59+
For additional information, plase refer to the [sigstore Blog](https://blog.sigstore.dev/cosign-2-0-released/)
5660
{{< /note >}}
5761

5862
## Verifying image signatures
5963

6064
For a complete list of images that are signed please refer
6165
to [Releases](/releases/download/).
6266

63-
Let's pick one image from this list and verify its signature using
67+
Pick one image from this list and verify its signature using
6468
the `cosign verify` command:
6569

6670
```shell
67-
COSIGN_EXPERIMENTAL=1 cosign verify registry.k8s.io/kube-apiserver-amd64:v{{< skew currentPatchVersion >}}
71+
cosign verify registry.k8s.io/kube-apiserver-amd64:v{{< skew currentPatchVersion >}} --certificate-identity [email protected] --certificate-oidc-issuer https://accounts.google.com | jq .
6872
```
6973

70-
{{< note >}}
71-
`COSIGN_EXPERIMENTAL=1` is used to allow verification of images signed
72-
in `KEYLESS` mode. To learn more about keyless signing, please refer to
73-
[Keyless Signatures](https://github.com/sigstore/cosign/blob/main/KEYLESS.md#keyless-signatures)
74-
. {{< /note >}}
75-
7674
### Verifying images for all control plane components
7775

78-
To verify all signed control plane images, please run this command:
76+
To verify all signed control plane images for the latest stable version (v{{< skew currentPatchVersion >}}), please run the following commands:
7977

8078
```shell
81-
curl -Ls "https://sbom.k8s.io/$(curl -Ls https://dl.k8s.io/release/stable.txt)/release" | grep "SPDXID: SPDXRef-Package-registry.k8s.io" | grep -v sha256 | cut -d- -f3- | sed 's/-/\//' | sed 's/-v1/:v1/' > images.txt
79+
curl -Ls "https://sbom.k8s.io/$(curl -Ls https://dl.k8s.io/release/stable.txt)/release" | grep "SPDXID: SPDXRef-Package-registry.k8s.io" | grep -v sha256 | cut -d- -f3- | sed 's/-/\//' | sed 's/-v1/:v1/' | sort > images.txt
8280
input=images.txt
8381
while IFS= read -r image
8482
do
85-
COSIGN_EXPERIMENTAL=1 cosign verify "$image"
83+
cosign verify "$image" --certificate-identity [email protected] --certificate-oidc-issuer https://accounts.google.com | jq .
8684
done < "$input"
8785
```
8886

89-
Once you have verified an image, specify that image by its digest in your Pod
90-
manifests as per this
91-
example: `registry-url/image-name@sha256:45b23dee08af5e43a7fea6c4cf9c25ccf269ee113168c19722f87876677c5cb2`
92-
.
87+
Once you have verified an image, you can specify the image by its digest in your Pod
88+
manifests as per this example:
89+
90+
`registry-url/image-name@sha256:45b23dee08af5e43a7fea6c4cf9c25ccf269ee113168c19722f87876677c5cb2`
9391

9492
For more information, please refer
95-
to [Image Pull Policy](/docs/concepts/containers/images/#image-pull-policy)
93+
to the [Image Pull Policy](/docs/concepts/containers/images/#image-pull-policy)
9694
section.
9795

9896
## Verifying Image Signatures with Admission Controller
9997

100-
For non-control plane images (
101-
e.g. [conformance image](https://github.com/kubernetes/kubernetes/blob/master/test/conformance/image/README.md))
102-
, signatures can also be verified at deploy time using
98+
For non-control plane images (for example
99+
[conformance image](https://github.com/kubernetes/kubernetes/blob/master/test/conformance/image/README.md)),
100+
signatures can also be verified at deploy time using
103101
[sigstore policy-controller](https://docs.sigstore.dev/policy-controller/overview)
104-
admission controller. To get started with `policy-controller` here are a few helpful
105-
resources:
102+
admission controller.
103+
104+
Here are some helpful resources to get started with `policy-controller`:
106105

107106
- [Installation](https://github.com/sigstore/helm-charts/tree/main/charts/policy-controller)
108107
- [Configuration Options](https://github.com/sigstore/policy-controller/tree/main/config)

0 commit comments

Comments
 (0)