Skip to content

Commit 846fd19

Browse files
committed
reformulate
1 parent 25f5b5a commit 846fd19

File tree

1 file changed

+42
-4
lines changed

1 file changed

+42
-4
lines changed

modules/tutorials/pages/enabling_verification_of_image_signatures.adoc

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,54 @@ For a more detailed explanation of the policy options, please refer to the https
4343
If the `subjectRegExp` field in the policy is changed to something like `https://github.com/test/.+`, the policy will deny the creation of pods with Stackable images because the identity of the subject that signed the image (a Stackable Github Action Workflow) will no longer match the expression specified in the policy.
4444

4545
== Verifying image signatures in an air-gapped environment
46+
47+
// intro
4648
As mentioned before, our images and Helm charts for SDP are signed keyless. Keyless signing is more complex than "classic" signing with a private and public key, but brings several https://www.chainguard.dev/unchained/benefits-of-keyless-software-signing[benefits]. It's also in line with Kubernetes, https://kubernetes.io/docs/tasks/administer-cluster/verify-signed-artifacts/[which uses keyless signing as well].
4749

50+
=== The general setup
51+
52+
The Policy Controller needs an up-to-date version of the root of trust, this is distributed as a collection of files and in an online setting it is automatically fetched from the https://tuf-repo-cdn.sigstore.dev/[Sigstore TUF Repo CDN].
53+
54+
NOTE: https://theupdateframework.io/[The Update Framework (TUF)] is the mechanism used by the Policy Controller to update the root of trust.
55+
56+
In an air-gapped environment, the CDN is not available, and so instead you have to provide the root of trust files yourself.
57+
There are multiple ways to do this, and you should pick the way that works best for your air-gapped environment.
58+
59+
The files hosted in the CDN are available also on https://github.com/sigstore/root-signing/tree/main/repository/repository[GitHub].
60+
This is the source where you need to get the files.
61+
Then there are two ways to provide these files to the Policy Controller inside of your air-gapped Kubernetes.
62+
Either by hosting them with a HTTP server that is reachable by the Policy Controller, or by zipping the files, serializing them and putting them directly into a custom resource.
63+
For both options we refer to the Sigstore documentation: https://docs.sigstore.dev/policy-controller/overview/#configuring-trustroot-for-custom-tuf-root[configuring a mirror] or https://docs.sigstore.dev/policy-controller/overview/#configuring-trustroot-for-custom-tuf-repository[serializing the files into a custom resource].
64+
65+
Both options yield you a TrustRoot custom resource which you then need to configure in your ClusterImagePolicy.
66+
This is done via the `trustRootRef` attribute, as shown https://docs.sigstore.dev/policy-controller/overview/#configuring-verification-against-different-sigstore-instances[in the Policy Controller's documentation].
67+
68+
=== Updating
69+
70+
The problem for air-gapped environments is that expiration of keys is built into TUF.
71+
That means, to verify image signatures continuously, the Policy Controller needs an up-to-date version of the root of trust.
72+
73+
Depending on which way you are providing the root of trust (mirror or direct files), you need to update that accordingly.
74+
If your cluster has access to for example a bastion host that in turn has limited internet access, configuring a mirror might be the easier way to go for you.
75+
You might even be able to simply configure a reverse proxy to https://tuf-repo-cdn.sigstore.dev/ to avoid manually updating files periodically.
76+
77+
If your setup is completely air-gapped, you will have to do periodic manual updates of the files that you deployed earlier.
78+
It is not clear how often the root of trust needs to be updated (TODO: research if we can find out more)
79+
80+
Either refresh your mirror or periodically supply the files directly via other methods into your airgapped system.
81+
82+
The Policy Controller does not need to be restarted. (TODO verify)
83+
84+
== Further reading
85+
86+
...
87+
88+
=== Background: How it usually works online with Fulcio
89+
4890
Describing the whole flow with all the components is out of scope for this documentation, so we will try to provide a summary of the most important parts instead: +
4991
To verify that an image has been signed by Stackable, customers check that the image has a valid signature and that this signature was created by Stackable's CI (Github Actions). More specifically, they check that the identity of the signer is one of Stackable's Github Actions workflows and that this identity has been confirmed by a trusted authority (Github in that case). The role of the Sigstore project https://github.com/sigstore/fulcio[Fulcio] is to issue a certificate for exactly that: +
5092
"This Fulcio instance confirms that this signature was created by `https://github.com/stackabletech/docker-images/.github/workflows/release.yml@refs/tags/23.11.0` and `https://token.actions.githubusercontent.com` confirmed that identity".
5193

5294
By default, the public Fulcio instance hosted by Sigstore is used for this, which is what we do at Stackable as well.
5395

5496
That means customers wanting to verify these image signatures need to trust the Fulcio instance, which issues the certificates that attest the identity of the signer. The root of trust for Sigstore components like the public Fulcio instance is distributed by a framework called https://docs.sigstore.dev/signing/overview/#root-of-trust[The Update Framework (TUF)]. Thankfully, the whole initialization of the root of trust via TUF is handled by the Policy Controller.
55-
56-
The problem for air-gapped environments is that expiration of keys is built into TUF. That means, to verify image signatures continuously, the Policy Controller needs an up-to-date version of the root of trust. In a environment with internet access, it can just connect to Sigstore's TUF repository and get the latest contents. In an air-gapped environment, this is not possible. It is possible, however, to specify a TUF mirror that is reachable from the air-gapped environment, as explained https://docs.sigstore.dev/policy-controller/overview/#configuring-trustroot-for-custom-tuf-root[here]. This mirror could for example serve the contents of https://tuf-repo-cdn.sigstore.dev via HTTPS. Another way is to provide a base64 encoded, gzipped tarball of the TUF repository, as explained https://docs.sigstore.dev/policy-controller/overview/#configuring-trustroot-for-custom-tuf-repository[here]. Remember that in both cases the contents of the TUF repository need to be updated regularly. The Sigstore TUF repository is hosted at https://tuf-repo-cdn.sigstore.dev/ and the contents are also available https://github.com/sigstore/root-signing/tree/main/repository/repository[on github].
57-
58-
You can then refer to the newly created `TrustRoot` (which is configured to use the TUF mirror) in the policy via the `trustRootRef` attribute, as shown https://docs.sigstore.dev/policy-controller/overview/#configuring-verification-against-different-sigstore-instances[in the Policy Controller's documentation].

0 commit comments

Comments
 (0)