@@ -11,14 +11,11 @@ weight: 420
11
11
12
12
## {{% heading "prerequisites" %}}
13
13
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
-
18
14
You will need to have the following tools installed:
19
15
20
16
- ` cosign ` ([ install guide] ( https://docs.sigstore.dev/cosign/installation/ ) )
21
17
- ` curl ` (often provided by your operating system)
18
+ - ` jq ` ([ download jq] ( https://stedolan.github.io/jq/download/ ) )
22
19
23
20
## Verifying binary signatures
24
21
@@ -41,68 +38,81 @@ for FILE in "${FILES[@]}"; do
41
38
done
42
39
```
43
40
44
- Then verify the blob by using ` cosign ` :
41
+ Then verify the blob by using ` cosign verify-blob ` :
45
42
46
43
``` 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
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 >}}
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/ )
56
59
{{< /note >}}
57
60
58
61
## Verifying image signatures
59
62
60
63
For a complete list of images that are signed please refer
61
64
to [ Releases] ( /releases/download/ ) .
62
65
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
64
67
the ` cosign verify ` command:
65
68
66
69
``` 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 .
68
74
```
69
75
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
76
### Verifying images for all control plane components
77
77
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:
79
80
80
81
``` 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
82
86
input=images.txt
83
87
while IFS= read -r image
84
88
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 .
86
93
done < " $input "
87
94
```
88
95
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
+ ```
93
102
94
103
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 )
96
105
section.
97
106
98
107
## Verifying Image Signatures with Admission Controller
99
108
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
103
112
[ 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 ` :
106
116
107
117
- [ Installation] ( https://github.com/sigstore/helm-charts/tree/main/charts/policy-controller )
108
118
- [ Configuration Options] ( https://github.com/sigstore/policy-controller/tree/main/config )
0 commit comments