@@ -11,14 +11,15 @@ weight: 420
11
11
12
12
## {{% heading "prerequisites" %}}
13
13
14
- These instructions are for Kubernetes {{< skew currentVersion >}}. If you want
14
+ These instructions are for Kubernetes v {{< skew currentVersion >}}. If you want
15
15
to check the integrity of components for a different version of Kubernetes,
16
16
check the documentation for that Kubernetes release.
17
17
18
18
You will need to have the following tools installed:
19
19
20
20
- ` cosign ` ([ install guide] ( https://docs.sigstore.dev/cosign/installation/ ) )
21
21
- ` curl ` (often provided by your operating system)
22
+ - ` jq ` ([ download jq] ( https://stedolan.github.io/jq/download/ ) )
22
23
23
24
## Verifying binary signatures
24
25
@@ -41,68 +42,66 @@ for FILE in "${FILES[@]}"; do
41
42
done
42
43
```
43
44
44
- Then verify the blob by using ` cosign ` :
45
+ Then verify the blob by using ` cosign verify-blob ` :
45
46
46
47
``` 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
48
49
```
49
50
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
-
53
51
{{< note >}}
52
+ Cosign 2.0 requires the ` --certificate-identity ` and ` --certificate-oidc-issuer ` options.
53
+
54
54
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/ )
56
60
{{< /note >}}
57
61
58
62
## Verifying image signatures
59
63
60
64
For a complete list of images that are signed please refer
61
65
to [ Releases] ( /releases/download/ ) .
62
66
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
64
68
the ` cosign verify ` command:
65
69
66
70
``` 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 .
68
72
```
69
73
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
-
76
74
### Verifying images for all control plane components
77
75
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 :
79
77
80
78
``` 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
82
80
input=images.txt
83
81
while IFS= read -r image
84
82
do
85
- COSIGN_EXPERIMENTAL=1 cosign verify " $image "
83
+ cosign verify
" $image " --certificate-identity [email protected] --certificate-oidc-issuer https://accounts.google.com | jq .
86
84
done < " $input "
87
85
```
88
86
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 `
93
91
94
92
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 )
96
94
section.
97
95
98
96
## Verifying Image Signatures with Admission Controller
99
97
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
103
101
[ 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 ` :
106
105
107
106
- [ Installation] ( https://github.com/sigstore/helm-charts/tree/main/charts/policy-controller )
108
107
- [ Configuration Options] ( https://github.com/sigstore/policy-controller/tree/main/config )
0 commit comments