Skip to content

Commit 92b3d9b

Browse files
committed
Split secrets to variables and secrets
All environment variables used for builds are currently stored under the key 'build-secrets' Some of the environment variables are not actually secret and should be visible. Differentiate the environment variables that are not secret by adding them under a new key 'build_variables' Do the same with 'gitops_secrets' and 'gitops_variables' Signed-off-by: Tomáš Nevrlka <[email protected]>
1 parent 50e2953 commit 92b3d9b

File tree

1 file changed

+80
-60
lines changed

1 file changed

+80
-60
lines changed

templates/data.yaml

Lines changed: 80 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -13,33 +13,62 @@ build_steps:
1313
substeps: [show-sbom-rhdh, summary]
1414
concurrent: true
1515

16-
build_secrets:
17-
- name: ROX_API_TOKEN
16+
build_variables:
1817
- name: ROX_CENTRAL_ENDPOINT
19-
- name: GITOPS_AUTH_PASSWORD
18+
2019
- name: GITOPS_AUTH_USERNAME
20+
if: '!isGitLab'
2121
commented_out: true
22-
comment: Uncomment this when using Gitlab
22+
- name: GITOPS_AUTH_USERNAME
23+
if: 'isGitLab'
2324

24-
- name: IMAGE_REGISTRY_USER
25+
- name: IMAGE_REGISTRY_USER
2526
if: 'isGitHub'
2627
comment: "Set this to the user for your specific registry"
27-
- name: IMAGE_REGISTRY_PASSWORD
28-
if: 'isGitHub'
29-
comment: "Set this password for your specific registry"
28+
- name: IMAGE_REGISTRY_USER
29+
if: '!isGitHub'
30+
commented_out: true
31+
comment: "Set this to the user for your specific registry"
32+
3033
# Expose Rekor and TUF in GitHub Actions so they can be set by user in secrets
3134
- name: REKOR_HOST
3235
if: 'isGitHub'
3336
comment: "Set this only when using an external Rekor instance"
34-
commented_out: true
3537
- name: TUF_MIRROR
3638
if: 'isGitHub'
3739
comment: "Set this only when using an external TUF instance"
40+
# Rekor and TUF again, but there is a difference between GH Actions and Jenkins
41+
- name: REKOR_HOST
42+
if: 'isJenkins'
43+
comment: "Set when using Jenkins on non-local cluster and using an external Rekor instance"
3844
commented_out: true
39-
- name: IMAGE_REGISTRY_USER
40-
if: '!isGitHub'
45+
- name: TUF_MIRROR
46+
if: 'isJenkins'
47+
comment: "Set when using Jenkins on non-local cluster and using an external TUF instance"
4148
commented_out: true
42-
comment: "Set this to the user for your specific registry"
49+
50+
- name: QUAY_IO_CREDS_USR
51+
if: '!isJenkins'
52+
commented_out: true
53+
54+
- name: ARTIFACTORY_IO_CREDS_USR
55+
if: '!isJenkins'
56+
commented_out: true
57+
58+
- name: NEXUS_IO_CREDS_USR
59+
if: '!isJenkins'
60+
commented_out: true
61+
62+
- name: COSIGN_PUBLIC_KEY
63+
64+
build_secrets:
65+
- name: ROX_API_TOKEN
66+
67+
- name: GITOPS_AUTH_PASSWORD
68+
69+
- name: IMAGE_REGISTRY_PASSWORD
70+
if: 'isGitHub'
71+
comment: "Set this password for your specific registry"
4372
- name: IMAGE_REGISTRY_PASSWORD
4473
if: '!isGitHub'
4574
commented_out: true
@@ -48,82 +77,91 @@ build_secrets:
4877
- name: QUAY_IO_CREDS
4978
if: isJenkins
5079
comment: "Default registry is set to quay.io"
51-
- name: QUAY_IO_CREDS_USR
52-
if: '!isJenkins'
53-
commented_out: true
5480
- name: QUAY_IO_CREDS_PSW
5581
if: '!isJenkins'
56-
commented_out: true
82+
commented_out: true
83+
5784
- name: ARTIFACTORY_IO_CREDS
5885
if: isJenkins
5986
commented_out: true
60-
- name: ARTIFACTORY_IO_CREDS_USR
61-
if: '!isJenkins'
62-
commented_out: true
6387
- name: ARTIFACTORY_IO_CREDS_PSW
6488
if: '!isJenkins'
65-
commented_out: true
89+
commented_out: true
90+
6691
- name: NEXUS_IO_CREDS
6792
if: isJenkins
6893
commented_out: true
69-
- name: NEXUS_IO_CREDS_USR
70-
if: '!isJenkins'
71-
commented_out: true
7294
- name: NEXUS_IO_CREDS_PSW
7395
if: '!isJenkins'
74-
commented_out: true
96+
commented_out: true
97+
7598
- name: COSIGN_SECRET_PASSWORD
7699
- name: COSIGN_SECRET_KEY
77-
- name: COSIGN_PUBLIC_KEY
78-
# Rekor and TUF again, but there is a difference between GH Actions and Jenkins
79-
- name: REKOR_HOST
80-
if: 'isJenkins'
81-
comment: "Set when using Jenkins on non-local cluster and using an external Rekor instance"
82-
commented_out: true
83-
- name: TUF_MIRROR
84-
if: 'isJenkins'
85-
comment: "Set when using Jenkins on non-local cluster and using an external TUF instance"
86-
commented_out: true
87100

88101
gitops_steps:
89102
- name: Verify EC
90103
substeps: [gather-deploy-images, verify-enterprise-contract]
91104
- name: Upload SBOM
92105
substeps: [gather-images-to-upload-sbom, download-sbom-from-url-in-attestation, upload-sbom-to-trustification]
93106

94-
gitops_secrets:
107+
gitops_variables:
95108
- name: COSIGN_PUBLIC_KEY
96109
comment: Used to verify the image signature and attestation
110+
97111
- name: TRUSTIFICATION_BOMBASTIC_API_URL
98112
comment: URL of the BOMbastic api host (e.g. https://sbom.trustification.dev)
99113
- name: TRUSTIFICATION_OIDC_ISSUER_URL
100114
comment: URL of the OIDC token issuer (e.g. https://sso.trustification.dev/realms/chicken)
101115
- name: TRUSTIFICATION_OIDC_CLIENT_ID
102-
- name: TRUSTIFICATION_OIDC_CLIENT_SECRET
103116
- name: TRUSTIFICATION_SUPPORTED_CYCLONEDX_VERSION
117+
104118
# If the OCI registry is not public then ec needs some credentials so it can see the attestations.
105119
# Todo: Use different credentials here so we provide read access only instead of read/write access.
106-
# github always uses these
107-
- name: IMAGE_REGISTRY_USER
120+
# github always uses these
121+
- name: IMAGE_REGISTRY_USER
108122
if: 'isGitHub'
109123
comment: "Set this to the user for your specific registry"
110-
- name: IMAGE_REGISTRY_PASSWORD
111-
if: 'isGitHub'
112-
comment: "Set this password for your specific registry"
124+
113125
# Expose Rekor and TUF in GitHub Actions so they can be set by user in secrets
114126
- name: REKOR_HOST
115127
if: 'isGitHub'
116128
comment: "Set this only when using an external Rekor instance"
117-
commented_out: true
118129
- name: TUF_MIRROR
119130
if: 'isGitHub'
120131
comment: "Set this only when using an external TUF instance"
132+
# Rekor and TUF again, but there is a difference between GH Actions and Jenkins
133+
- name: REKOR_HOST
134+
if: 'isJenkins'
135+
comment: "Set when using Jenkins on non-local cluster and using an external Rekor instance"
136+
commented_out: true
137+
- name: TUF_MIRROR
138+
if: 'isJenkins'
139+
comment: "Set when using Jenkins on non-local cluster and using an external TUF instance"
121140
commented_out: true
141+
122142
# other CIs in transition so comment out and leave Quay.io
123143
- name: IMAGE_REGISTRY_USER
124144
if: '!isGitHub'
125145
commented_out: true
126146
comment: "Set this to the user for your specific registry"
147+
148+
- name: QUAY_IO_CREDS_USR
149+
if: '!isJenkins'
150+
commented_out: true
151+
152+
- name: ARTIFACTORY_IO_CREDS_USR
153+
if: '!isJenkins'
154+
commented_out: true
155+
156+
- name: NEXUS_IO_CREDS_USR
157+
if: '!isJenkins'
158+
commented_out: true
159+
160+
gitops_secrets:
161+
- name: TRUSTIFICATION_OIDC_CLIENT_SECRET
162+
- name: IMAGE_REGISTRY_PASSWORD
163+
if: 'isGitHub'
164+
comment: "Set this password for your specific registry"
127165
- name: IMAGE_REGISTRY_PASSWORD
128166
if: '!isGitHub'
129167
commented_out: true
@@ -133,36 +171,18 @@ gitops_secrets:
133171
# to be documented
134172
- name: QUAY_IO_CREDS
135173
if: isJenkins
136-
- name: QUAY_IO_CREDS_USR
137-
if: '!isJenkins'
138-
commented_out: true
139174
- name: QUAY_IO_CREDS_PSW
140175
if: '!isJenkins'
141176
commented_out: true
142177
- name: ARTIFACTORY_IO_CREDS
143178
if: isJenkins
144179
commented_out: true
145-
- name: ARTIFACTORY_IO_CREDS_USR
146-
if: '!isJenkins'
147-
commented_out: true
148180
- name: ARTIFACTORY_IO_CREDS_PSW
149181
if: '!isJenkins'
150182
commented_out: true
151183
- name: NEXUS_IO_CREDS
152184
if: isJenkins
153185
commented_out: true
154-
- name: NEXUS_IO_CREDS_USR
155-
if: '!isJenkins'
156-
commented_out: true
157186
- name: NEXUS_IO_CREDS_PSW
158187
if: '!isJenkins'
159188
commented_out: true
160-
# Rekor and TUF again, but there is a difference between GH Actions and Jenkins
161-
- name: REKOR_HOST
162-
if: 'isJenkins'
163-
comment: "Set when using Jenkins on non-local cluster and using an external Rekor instance"
164-
commented_out: true
165-
- name: TUF_MIRROR
166-
if: 'isJenkins'
167-
comment: "Set when using Jenkins on non-local cluster and using an external TUF instance"
168-
commented_out: true

0 commit comments

Comments
 (0)