@@ -89,6 +89,25 @@ var _ = Describe("Securesign install with certificate generation", Ordered, func
89
89
Trillian : v1alpha1.TrillianSpec {Db : v1alpha1.TrillianDB {
90
90
Create : utils .Pointer (true ),
91
91
}},
92
+ TimestampAuthority : v1alpha1.TimestampAuthoritySpec {
93
+ ExternalAccess : v1alpha1.ExternalAccess {
94
+ Enabled : true ,
95
+ },
96
+ Signer : v1alpha1.TimestampAuthoritySigner {
97
+ CertificateChain : v1alpha1.CertificateChain {
98
+ RootCA : v1alpha1.TsaCertificateAuthority {
99
+ OrganizationName : "MyOrg" ,
100
+ OrganizationEmail : "my@email.org" ,
101
+ CommonName : "tsa.hostname" ,
102
+ },
103
+ IntermediateCA : v1alpha1.TsaCertificateAuthority {
104
+ OrganizationName : "MyOrg" ,
105
+ OrganizationEmail : "my@email.org" ,
106
+ CommonName : "tsa.hostname" ,
107
+ },
108
+ },
109
+ },
110
+ },
92
111
},
93
112
}
94
113
})
@@ -138,6 +157,23 @@ var _ = Describe("Securesign install with certificate generation", Ordered, func
138
157
)))
139
158
})
140
159
160
+ It ("operator should generate TSA secret" , func () {
161
+ Eventually (func () * v1.Secret {
162
+ tsa := tas .GetTSA (ctx , cli , namespace .Name , securesign .Name )()
163
+ scr := & v1.Secret {}
164
+ Expect (cli .Get (ctx , types.NamespacedName {Namespace : namespace .Name , Name : tsa .Status .Signer .FileSigner .PrivateKeyRef .Name }, scr )).To (Succeed ())
165
+ return scr
166
+ }).Should (
167
+ WithTransform (func (secret * v1.Secret ) map [string ][]byte { return secret .Data },
168
+ And (
169
+ & matchers.HaveKeyMatcher {Key : "rootPrivateKey" },
170
+ & matchers.HaveKeyMatcher {Key : "rootPrivateKeyPassword" },
171
+ & matchers.HaveKeyMatcher {Key : "interPrivateKey" },
172
+ & matchers.HaveKeyMatcher {Key : "interPrivateKeyPassword" },
173
+ & matchers.HaveKeyMatcher {Key : "certificateChain" },
174
+ )))
175
+ })
176
+
141
177
It ("fulcio is running with mounted certs" , func () {
142
178
server := tas .GetFulcioServerPod (ctx , cli , namespace .Name )()
143
179
Expect (server ).NotTo (BeNil ())
@@ -175,12 +211,29 @@ var _ = Describe("Securesign install with certificate generation", Ordered, func
175
211
176
212
})
177
213
214
+ It ("tsa is running with mounted certs" , func () {
215
+ tas .VerifyTSA (ctx , cli , namespace .Name , securesign .Name )
216
+ server := tas .GetTSAServerPod (ctx , cli , namespace .Name )()
217
+ Expect (server ).NotTo (BeNil ())
218
+ Expect (server .Spec .Volumes ).To (
219
+ ContainElement (
220
+ WithTransform (func (volume v1.Volume ) string {
221
+ if volume .VolumeSource .Secret != nil {
222
+ return volume .VolumeSource .Secret .SecretName
223
+ }
224
+ return ""
225
+ }, Equal (tas .GetTSA (ctx , cli , namespace .Name , securesign .Name )().Status .Signer .FileSigner .PrivateKeyRef .Name ))),
226
+ )
227
+
228
+ })
229
+
178
230
It ("All other components are running" , func () {
179
231
tas .VerifySecuresign (ctx , cli , namespace .Name , securesign .Name )
180
232
tas .VerifyTrillian (ctx , cli , namespace .Name , securesign .Name , true )
181
233
tas .VerifyCTLog (ctx , cli , namespace .Name , securesign .Name )
182
234
tas .VerifyTuf (ctx , cli , namespace .Name , securesign .Name )
183
235
tas .VerifyRekorSearchUI (ctx , cli , namespace .Name , securesign .Name )
236
+ tas .VerifyTSA (ctx , cli , namespace .Name , securesign .Name )
184
237
})
185
238
186
239
It ("Verify Rekor Search UI is accessible" , func () {
@@ -211,6 +264,11 @@ var _ = Describe("Securesign install with certificate generation", Ordered, func
211
264
tuf := tas .GetTuf (ctx , cli , namespace .Name , securesign .Name )()
212
265
Expect (tuf ).ToNot (BeNil ())
213
266
267
+ tsa := tas .GetTSA (ctx , cli , namespace .Name , securesign .Name )()
268
+ Expect (tsa ).ToNot (BeNil ())
269
+ err := tas .GetTSACertificateChain (ctx , cli , tsa .Namespace , tsa .Name , tsa .Status .Url )
270
+ Expect (err ).To (BeNil ())
271
+
214
272
oidcToken , err := support .OidcToken (ctx )
215
273
Expect (err ).ToNot (HaveOccurred ())
216
274
Expect (oidcToken ).ToNot (BeEmpty ())
@@ -224,6 +282,7 @@ var _ = Describe("Securesign install with certificate generation", Ordered, func
224
282
"cosign" , "sign" , "-y" ,
225
283
"--fulcio-url=" + fulcio .Status .Url ,
226
284
"--rekor-url=" + rekor .Status .Url ,
285
+ "--timestamp-server-url=" + tsa .Status .Url + "/api/v1/timestamp" ,
227
286
"--oidc-issuer=" + support .OidcIssuerUrl (),
228
287
"--oidc-client-id=" + support .OidcClientID (),
229
288
"--identity-token=" + oidcToken ,
@@ -233,6 +292,7 @@ var _ = Describe("Securesign install with certificate generation", Ordered, func
233
292
Expect (clients .Execute (
234
293
"cosign" , "verify" ,
235
294
"--rekor-url=" + rekor .Status .Url ,
295
+ "--timestamp-certificate-chain=ts_chain.pem" ,
236
296
"--certificate-identity-regexp" , ".*@redhat" ,
237
297
"--certificate-oidc-issuer-regexp" , ".*keycloak.*" ,
238
298
targetImageName ,
0 commit comments