Skip to content

Commit e6fd977

Browse files
authored
Merge pull request #93507 from mramendi/RHDEVDOCS-6410
RHDEVDOCS 6410 Chains automatic Cosign key pair
2 parents 04cc73d + af8893d commit e6fd977

5 files changed

+74
-58
lines changed
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
// This module is included in the following assemblies:
2+
// * secure/using-tekton-chains-for-openshift-pipelines-supply-chain-security.adoc
3+
4+
:_mod-docs-content-type: PROCEDURE
5+
[id="chains-generating-cosign-secret_{context}"]
6+
= Generating the cosign key pair by using the TektonConfig CR
7+
8+
To use the `cosign` signing scheme for {tekton-chains} secrets, you can generate a `cosign` key pair that uses ECDSA encryption by setting the `generateSigningSecret` field in the `TektonConfig` custom resource (CR) to `true`.
9+
10+
.Prerequisites
11+
12+
* You installed the {oc-first} utility.
13+
* You are logged in to your {OCP} cluster with administrative rights for the `openshift-pipelines` namespace.
14+
15+
.Procedure
16+
17+
. Edit the `TektonConfig` CR by running the following command:
18+
+
19+
[source,terminal]
20+
----
21+
$ oc edit TektonConfig config
22+
----
23+
24+
. In the `TektonConfig` CR, set the `generateSigningSecret` value to `true`:
25+
+
26+
.Example of creating an ECDSA cosign key pair by using the TektonConfig CR
27+
[source,yaml]
28+
----
29+
apiVersion: operator.tekton.dev/v1
30+
kind: TektonConfig
31+
metadata:
32+
name: config
33+
spec:
34+
# ...
35+
chain:
36+
disabled: false
37+
generateSigningSecret: true # <1>
38+
# ...
39+
----
40+
<1> The default value is `false`. Setting the value to `true` generates the `ecdsa` key pair.
41+
42+
. After a few minutes, extract the public key from the secret and store it, so that you can use it to verify artifact attestations. Run the following command to extract the key:
43+
+
44+
[source,terminal]
45+
----
46+
$ oc extract -n openshift-pipelines secret/signing-secrets --keys=cosign.pub
47+
----
48+
49+
.Result
50+
51+
The {pipelines-shortname} Operator generates an `ecdsa` type `cosign` key pair and stores it in the `signing-secrets` secret in the `openshift-pipelines` namespace. The secret includes the following files:
52+
53+
* `cosign.key`: The private key
54+
* `cosign.password`: The password for decrypting the private key
55+
* `cosign.pub` The public key
56+
57+
If a `signing-secrets` secret already exists, the Operator does not overwrite the secret.
58+
59+
The `cosign.pub` file in your current directory contains the public key that is extracted from the secret.
60+
61+
[WARNING]
62+
====
63+
If you set the `generateSigningSecret` field from `true` to `false`, the {pipelines-title} Operator overrides and empties any value in the `signing-secrets` secret.
64+
====
65+
66+
The {pipelines-title} Operator does not provide the following security functions:
67+
68+
* Key rotation
69+
* Auditing key usage
70+
* Proper access control to the key

modules/op-chains-generating-x509-secret.adoc

Lines changed: 0 additions & 54 deletions
This file was deleted.

modules/op-chains-signing-secrets-cosign.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
:_mod-docs-content-type: PROCEDURE
55

66
[id="chains-signing-secrets-cosign_{context}"]
7-
= Signing with the cosign tool
7+
= Manually generating signing secrets with the cosign tool
88

99
You can use the `cosign` signing scheme with {tekton-chains} using the `cosign` tool.
1010

modules/op-chains-signing-secrets-skopeo.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
:_mod-docs-content-type: PROCEDURE
55

66
[id="chains-signing-secrets-skopeo_{context}"]
7-
= Signing with the skopeo tool
7+
= Manually generating signing secrets with the skopeo tool
88

99
You can generate keys using the `skopeo` tool and use them in the `cosign` signing scheme with {tekton-chains}.
1010

1111
.Prerequisites
1212

13-
* You installed the link:https://github.com/containers/skopeo[skopeo] tool.
13+
* You installed the `skopeo` package on your Linux system.
1414

1515
.Procedure
1616

secure/using-tekton-chains-for-openshift-pipelines-supply-chain-security.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ include::modules/op-creating-mounting-kms-authentication-token-secret.adoc[level
2626
include::modules/op-enabling-tekton-chains-to-operate-only-in-selected-namespaces.adoc[leveloffset=+2]
2727

2828
include::modules/op-signing-secrets-in-tekton-chains.adoc[leveloffset=+1]
29-
include::modules/op-chains-generating-x509-secret.adoc[leveloffset=+2]
29+
include::modules/op-chains-generating-cosign-secret.adoc[leveloffset=+2]
3030
include::modules/op-chains-signing-secrets-cosign.adoc[leveloffset=+2]
3131
include::modules/op-chains-signing-secrets-skopeo.adoc[leveloffset=+2]
3232
include::modules/op-chains-resolving-existing-secret.adoc[leveloffset=+2]

0 commit comments

Comments
 (0)