Skip to content

Commit 5edbf35

Browse files
Add documentation on fetching Knative supply-chain security attestations (knative#6193)
1 parent eb917ab commit 5edbf35

File tree

2 files changed

+52
-1
lines changed

2 files changed

+52
-1
lines changed

config/nav.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,9 @@ nav:
343343
- Eventing code samples: samples/eventing.md
344344
# Reference docs
345345
- Reference:
346-
- Security: reference/security/README.md
346+
- Security:
347+
- Security Model and Disclosure: reference/security/README.md
348+
- Verifying Knative Images: reference/security/verifying-images.md
347349
- Release notes: reference/relnotes/README.md
348350
- Blog: /blog/
349351
- About:
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Verifying Knative Images
2+
3+
Knative publishes SBOMs and SLSA provenance documents for each image in the
4+
Knative release. You can also use this information to configure [the sigstore
5+
policy controller](https://docs.sigstore.dev/policy-controller/overview/) or
6+
other admission controllers to check for these image attestations.
7+
8+
## Prerequisites
9+
10+
You will need to install the [cosign tool](https://github.com/sigstore/cosign/tree/main)
11+
to fetch and interact with the attestations stored in the container registry.
12+
13+
## Knative SLSA Provenance (signed)
14+
15+
The Knative build process produces a SLSA [in-toto](https://in-toto.io/)
16+
attestation for each image in the build process. For a given image in the
17+
Knative release manifests, you can verify the build attestation using the
18+
following:
19+
20+
```bash
21+
cosign verify-attestation \
22+
--certificate-oidc-issuer https://accounts.google.com \
23+
--certificate-identity [email protected] \
24+
--type slsaprovenance02 \
25+
$IMAGE
26+
```
27+
28+
Note that the in-toto document is base64 encoded in the `.payload` attribute
29+
of the attestation; you can use `jq` to extract this with the following
30+
invocation:
31+
32+
```bash
33+
cosign verify-attestation \
34+
--certificate-oidc-issuer https://accounts.google.com \
35+
--certificate-identity [email protected] \
36+
--type slsaprovenance02 \
37+
$IMAGE | jq -r .payload | base64 --decode | jq
38+
```
39+
40+
## Knative SBOMs
41+
42+
For each container image, Knative publishes an SBOM corresponding to each
43+
image. These SBOMs are produced during compilation by the
44+
[`ko` tool](https://ko.build/), and can be downloaded using the `cosign download sbom`
45+
command. Note that the image references in the Knative manifests are to
46+
multi-architecture images; to extract the software components for a particular
47+
architecture (as different architectures may build with different libraries),
48+
you will need to run `cosign download sbom` on the architecture-specific image
49+
(e.g. for `linux/amd64`).

0 commit comments

Comments
 (0)