Skip to content

Commit 086af40

Browse files
authored
Merge pull request #41071 from mrgiles/39775_cosign2_update
Update cosign verify instructions for 2.0
2 parents ab987d4 + 98c8d73 commit 086af40

File tree

1 file changed

+42
-32
lines changed

1 file changed

+42
-32
lines changed

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

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

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

14-
These instructions are for Kubernetes {{< skew currentVersion >}}. If you want
15-
to check the integrity of components for a different version of Kubernetes,
16-
check the documentation for that Kubernetes release.
17-
1814
You will need to have the following tools installed:
1915

2016
- `cosign` ([install guide](https://docs.sigstore.dev/cosign/installation/))
2117
- `curl` (often provided by your operating system)
18+
- `jq` ([download jq](https://stedolan.github.io/jq/download/))
2219

2320
## Verifying binary signatures
2421

@@ -41,68 +38,81 @@ for FILE in "${FILES[@]}"; do
4138
done
4239
```
4340

44-
Then verify the blob by using `cosign`:
41+
Then verify the blob by using `cosign verify-blob`:
4542

4643
```shell
47-
cosign verify-blob "$BINARY" --signature "$BINARY".sig --certificate "$BINARY".cert
44+
cosign verify-blob "$BINARY" \
45+
--signature "$BINARY".sig \
46+
--certificate "$BINARY".cert \
47+
--certificate-identity [email protected] \
48+
--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 >}}
54-
To learn more about keyless signing, please refer to [Keyless
55-
Signatures](https://github.com/sigstore/cosign/blob/main/KEYLESS.md#keyless-signatures).
52+
Cosign 2.0 requires the `--certificate-identity` and `--certificate-oidc-issuer` options.
53+
54+
To learn more about keyless signing, please refer to [Keyless Signatures](https://docs.sigstore.dev/cosign/keyless).
55+
56+
Previous versions of Cosign required that you set `COSIGN_EXPERIMENTAL=1`.
57+
58+
For additional information, plase refer to the [sigstore Blog](https://blog.sigstore.dev/cosign-2-0-released/)
5659
{{< /note >}}
5760

5861
## Verifying image signatures
5962

6063
For a complete list of images that are signed please refer
6164
to [Releases](/releases/download/).
6265

63-
Let's pick one image from this list and verify its signature using
66+
Pick one image from this list and verify its signature using
6467
the `cosign verify` command:
6568

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

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-
7676
### Verifying images for all control plane components
7777

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

8081
```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
82+
curl -Ls "https://sbom.k8s.io/$(curl -Ls https://dl.k8s.io/release/stable.txt)/release" \
83+
| grep "SPDXID: SPDXRef-Package-registry.k8s.io" \
84+
| grep -v sha256 | cut -d- -f3- | sed 's/-/\//' | sed 's/-v1/:v1/' \
85+
| sort > images.txt
8286
input=images.txt
8387
while IFS= read -r image
8488
do
85-
COSIGN_EXPERIMENTAL=1 cosign verify "$image"
89+
cosign verify "$image" \
90+
--certificate-identity [email protected] \
91+
--certificate-oidc-issuer https://accounts.google.com \
92+
| jq .
8693
done < "$input"
8794
```
8895

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-
.
96+
Once you have verified an image, you can specify the image by its digest in your Pod
97+
manifests as per this example:
98+
99+
```console
100+
registry-url/image-name@sha256:45b23dee08af5e43a7fea6c4cf9c25ccf269ee113168c19722f87876677c5cb2
101+
```
93102

94103
For more information, please refer
95-
to [Image Pull Policy](/docs/concepts/containers/images/#image-pull-policy)
104+
to the [Image Pull Policy](/docs/concepts/containers/images/#image-pull-policy)
96105
section.
97106

98107
## Verifying Image Signatures with Admission Controller
99108

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
109+
For non-control plane images (for example
110+
[conformance image](https://github.com/kubernetes/kubernetes/blob/master/test/conformance/image/README.md)),
111+
signatures can also be verified at deploy time using
103112
[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:
113+
admission controller.
114+
115+
Here are some helpful resources to get started with `policy-controller`:
106116

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

0 commit comments

Comments
 (0)