-
Notifications
You must be signed in to change notification settings - Fork 139
679 lines (564 loc) · 24.7 KB
/
ocsp-basic-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
name: Basic OCSP
on: workflow_call
env:
DS_IMAGE: ${{ vars.DS_IMAGE || 'quay.io/389ds/dirsrv' }}
jobs:
# docs/installation/ocsp/Installing_OCSP.md
test:
name: Test
runs-on: ubuntu-latest
env:
SHARED: /tmp/workdir/pki
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Retrieve PKI images
uses: actions/cache@v4
with:
key: pki-images-${{ github.sha }}
path: pki-images.tar
- name: Load PKI images
run: docker load --input pki-images.tar
- name: Create network
run: docker network create example
- name: Set up DS container
run: |
tests/bin/ds-create.sh \
--image=${{ env.DS_IMAGE }} \
--hostname=ds.example.com \
--password=Secret.123 \
ds
- name: Connect DS container to network
run: docker network connect example ds --alias ds.example.com
- name: Set up PKI container
run: |
tests/bin/runner-init.sh pki
env:
HOSTNAME: pki.example.com
- name: Connect PKI container to network
run: docker network connect example pki --alias pki.example.com
- name: Install CA
run: |
docker exec pki pkispawn \
-f /usr/share/pki/server/examples/installation/ca.cfg \
-s CA \
-D pki_ds_url=ldap://ds.example.com:3389 \
-v
docker exec pki pki-server cert-find
- name: Check security domain config in CA
run: |
# CA should run security domain service
cat > expected << EOF
securitydomain.checkIP=false
securitydomain.checkinterval=300000
securitydomain.flushinterval=86400000
securitydomain.host=pki.example.com
securitydomain.httpport=8080
securitydomain.httpsadminport=8443
securitydomain.name=EXAMPLE
securitydomain.select=new
securitydomain.source=ldap
EOF
docker exec pki pki-server ca-config-find | grep ^securitydomain. | sort | tee actual
diff expected actual
docker exec pki pki-server cert-export ca_signing --cert-file ${SHARED}/ca_signing.crt
docker exec pki pki nss-cert-import \
--cert $SHARED/ca_signing.crt \
--trust CT,C,C \
ca_signing
# REST API should return security domain info
cat > expected << EOF
Domain: EXAMPLE
CA Subsystem:
Host ID: CA pki.example.com 8443
Hostname: pki.example.com
Port: 8080
Secure Port: 8443
Domain Manager: TRUE
EOF
docker exec pki pki securitydomain-show | tee output
diff expected output
- name: Install OCSP
run: |
docker exec pki pkispawn \
-f /usr/share/pki/server/examples/installation/ocsp.cfg \
-s OCSP \
-D pki_ds_url=ldap://ds.example.com:3389 \
-v
- name: Check PKI server base dir after installation
run: |
# check file types, owners, and permissions
docker exec pki ls -l /var/lib/pki/pki-tomcat \
| sed \
-e '/^total/d' \
-e 's/^\(\S*\) *\S* *\(\S*\) *\(\S*\) *\S* *\S* *\S* *\S* *\(.*\)$/\1 \2 \3 \4/' \
| tee output
# TODO: review permissions
cat > expected << EOF
lrwxrwxrwx pkiuser pkiuser alias -> /var/lib/pki/pki-tomcat/conf/alias
lrwxrwxrwx pkiuser pkiuser bin -> /usr/share/tomcat/bin
drwxrwx--- pkiuser pkiuser ca
drwxrwx--- pkiuser pkiuser common
lrwxrwxrwx pkiuser pkiuser conf -> /etc/pki/pki-tomcat
lrwxrwxrwx pkiuser pkiuser lib -> /usr/share/pki/server/lib
lrwxrwxrwx pkiuser pkiuser logs -> /var/log/pki/pki-tomcat
drwxrwx--- pkiuser pkiuser ocsp
drwxrwx--- pkiuser pkiuser temp
drwxr-xr-x pkiuser pkiuser webapps
drwxrwx--- pkiuser pkiuser work
EOF
diff expected output
- name: Check PKI server conf dir after installation
run: |
# check file types, owners, and permissions
docker exec pki ls -l /etc/pki/pki-tomcat \
| sed \
-e '/^total/d' \
-e 's/^\(\S*\) *\S* *\(\S*\) *\(\S*\) *\S* *\S* *\S* *\S* *\(.*\)$/\1 \2 \3 \4/' \
| tee output
# TODO: review permissions
cat > expected << EOF
drwxrwx--- pkiuser pkiuser Catalina
drwxrwx--- pkiuser pkiuser alias
drwxrwx--- pkiuser pkiuser ca
-rw-r--r-- pkiuser pkiuser catalina.policy
lrwxrwxrwx pkiuser pkiuser catalina.properties -> /usr/share/pki/server/conf/catalina.properties
drwxrwx--- pkiuser pkiuser certs
lrwxrwxrwx pkiuser pkiuser context.xml -> /etc/tomcat/context.xml
lrwxrwxrwx pkiuser pkiuser logging.properties -> /usr/share/pki/server/conf/logging.properties
drwxrwx--- pkiuser pkiuser ocsp
-rw-rw---- pkiuser pkiuser password.conf
-rw-rw---- pkiuser pkiuser server.xml
-rw-rw---- pkiuser pkiuser serverCertNick.conf
-rw-rw---- pkiuser pkiuser tomcat.conf
lrwxrwxrwx pkiuser pkiuser web.xml -> /etc/tomcat/web.xml
EOF
diff expected output
- name: Check server.xml
if: always()
run: |
docker exec pki cat /etc/pki/pki-tomcat/server.xml
- name: Check PKI server logs dir after installation
run: |
# check file types, owners, and permissions
docker exec pki ls -l /var/log/pki/pki-tomcat \
| sed \
-e '/^total/d' \
-e 's/^\(\S*\) *\S* *\(\S*\) *\(\S*\) *\S* *\S* *\S* *\S* *\(.*\)$/\1 \2 \3 \4/' \
| tee output
DATE=$(date +'%Y-%m-%d')
# TODO: review permissions
cat > expected << EOF
drwxr-x--- pkiuser pkiuser backup
drwxrwx--- pkiuser pkiuser ca
-rw-rw-r-- pkiuser pkiuser catalina.$DATE.log
-rw-rw-r-- pkiuser pkiuser host-manager.$DATE.log
-rw-rw-r-- pkiuser pkiuser localhost.$DATE.log
-rw-r--r-- pkiuser pkiuser localhost_access_log.$DATE.txt
-rw-rw-r-- pkiuser pkiuser manager.$DATE.log
drwxrwx--- pkiuser pkiuser ocsp
drwxr-xr-x pkiuser pkiuser pki
EOF
diff expected output
- name: Check OCSP base dir
run: |
# check file types, owners, and permissions
docker exec pki ls -l /var/lib/pki/pki-tomcat/ocsp \
| sed \
-e '/^total/d' \
-e 's/^\(\S*\) *\S* *\(\S*\) *\(\S*\) *\S* *\S* *\S* *\S* *\(.*\)$/\1 \2 \3 \4/' \
| tee output
# TODO: review permissions
cat > expected << EOF
lrwxrwxrwx pkiuser pkiuser alias -> /var/lib/pki/pki-tomcat/alias
lrwxrwxrwx pkiuser pkiuser conf -> /var/lib/pki/pki-tomcat/conf/ocsp
lrwxrwxrwx pkiuser pkiuser logs -> /var/lib/pki/pki-tomcat/logs/ocsp
lrwxrwxrwx pkiuser pkiuser registry -> /etc/sysconfig/pki/tomcat/pki-tomcat
EOF
diff expected output
- name: Check OCSP conf dir
run: |
# check file types, owners, and permissions
docker exec pki ls -l /var/lib/pki/pki-tomcat/conf/ocsp \
| sed \
-e '/^total/d' \
-e 's/^\(\S*\) *\S* *\(\S*\) *\(\S*\) *\S* *\S* *\S* *\S* *\(.*\)$/\1 \2 \3 \4/' \
| tee output
# TODO: review permissions
cat > expected << EOF
-rw-rw-r-- pkiuser pkiuser CS.cfg
-rw-rw-r-- pkiuser pkiuser registry.cfg
EOF
diff expected output
- name: Check PKI server status
run: |
docker exec pki pki-server status | tee output
# CA should be a domain manager, but OCSP should not
echo "True" > expected
echo "False" >> expected
sed -n 's/^ *SD Manager: *\(.*\)$/\1/p' output > actual
diff expected actual
- name: Check security domain config in OCSP
run: |
# OCSP should join security domain in CA
cat > expected << EOF
securitydomain.host=pki.example.com
securitydomain.httpport=8080
securitydomain.httpsadminport=8443
securitydomain.name=EXAMPLE
securitydomain.select=existing
EOF
docker exec pki pki-server ocsp-config-find | grep ^securitydomain. | sort | tee actual
diff expected actual
- name: Check OCSP signing cert
run: |
docker exec pki pki-server cert-export ocsp_signing \
--cert-file ocsp_signing.crt
docker exec pki openssl req -text -noout \
-in /var/lib/pki/pki-tomcat/conf/certs/ocsp_signing.csr
docker exec pki openssl x509 -text -noout -in ocsp_signing.crt
- name: Check OCSP audit signing cert
run: |
docker exec pki pki-server cert-export ocsp_audit_signing \
--cert-file ocsp_audit_signing.crt
docker exec pki openssl req -text -noout \
-in /var/lib/pki/pki-tomcat/conf/certs/ocsp_audit_signing.csr
docker exec pki openssl x509 -text -noout -in ocsp_audit_signing.crt
- name: Check subsystem cert
run: |
docker exec pki pki-server cert-export subsystem \
--cert-file subsystem.crt
docker exec pki openssl req -text -noout \
-in /var/lib/pki/pki-tomcat/conf/certs/subsystem.csr
docker exec pki openssl x509 -text -noout -in subsystem.crt
- name: Check SSL server cert
run: |
docker exec pki pki-server cert-export sslserver \
--cert-file sslserver.crt
docker exec pki openssl req -text -noout \
-in /var/lib/pki/pki-tomcat/conf/certs/sslserver.csr
docker exec pki openssl x509 -text -noout -in sslserver.crt
- name: Check OCSP admin cert
run: |
docker exec pki openssl x509 -text -noout -in /root/.dogtag/pki-tomcat/ca_admin.cert
- name: Check OCSP publishing in CA
run: |
docker exec pki pki-server ca-config-find | grep ^ca.publish. | sort > output
cat > expected << EOF
ca.publish.enable=true
EOF
sed -n '/^ca.publish.enable=/p' output | tee actual
diff expected actual
cat > expected << EOF
ca.publish.publisher.instance.OCSPPublisher-pki-example-com-8443.enableClientAuth=true
ca.publish.publisher.instance.OCSPPublisher-pki-example-com-8443.host=pki.example.com
ca.publish.publisher.instance.OCSPPublisher-pki-example-com-8443.nickName=subsystem
ca.publish.publisher.instance.OCSPPublisher-pki-example-com-8443.path=/ocsp/agent/ocsp/addCRL
ca.publish.publisher.instance.OCSPPublisher-pki-example-com-8443.pluginName=OCSPPublisher
ca.publish.publisher.instance.OCSPPublisher-pki-example-com-8443.port=8443
EOF
sed -n '/^ca.publish.publisher.instance.OCSPPublisher-/p' output | tee actual
diff expected actual
cat > expected << EOF
ca.publish.rule.instance.ocsprule-pki-example-com-8443.enable=true
ca.publish.rule.instance.ocsprule-pki-example-com-8443.mapper=NoMap
ca.publish.rule.instance.ocsprule-pki-example-com-8443.pluginName=Rule
ca.publish.rule.instance.ocsprule-pki-example-com-8443.publisher=OCSPPublisher-pki-example-com-8443
ca.publish.rule.instance.ocsprule-pki-example-com-8443.type=crl
EOF
sed -n '/^ca.publish.rule.instance.ocsprule-/p' output | tee actual
diff expected actual
# set buffer size to 0 so that revocation will take effect immediately
docker exec pki pki-server ca-config-set auths.revocationChecking.bufferSize 0
# update CRL immediately after each cert revocation
docker exec pki pki-server ca-crl-ip-mod -D alwaysUpdate=true MasterCRL
# restart CA subsystem
docker exec pki pki-server ca-redeploy --wait
- name: Run PKI healthcheck
run: docker exec pki pki-healthcheck --failures-only
- name: Initialize PKI client
run: |
docker exec pki pki-server cert-export ca_signing --cert-file ca_signing.crt
docker exec pki pki nss-cert-import \
--cert ca_signing.crt \
--trust CT,C,C \
ca_signing
docker exec pki pki pkcs12-import \
--pkcs12 /root/.dogtag/pki-tomcat/ca_admin_cert.p12 \
--pkcs12-password Secret.123
- name: Check OCSP responder with no CRLs
run: |
# create CA agent and its cert
docker exec pki /usr/share/pki/tests/ca/bin/ca-agent-create.sh
docker exec pki /usr/share/pki/tests/ca/bin/ca-agent-cert-create.sh
# get cert serial number
docker exec pki pki nss-cert-show caagent | tee output
CERT_ID=$(sed -n "s/^\s*Serial Number:\s*\(\S*\)$/\1/p" output)
# check cert status using OCSPClient
docker exec pki OCSPClient \
-d /root/.dogtag/nssdb \
-h pki.example.com \
-p 8080 \
-t /ocsp/ee/ocsp \
-c ca_signing \
--serial $CERT_ID \
> >(tee stdout) 2> >(tee stderr >&2) || true
# the responder should fail
sed -n "s/^SEVERE:\s*\(\S*\)/\1/p" stderr > actual
echo "InvalidBERException: Incorrect tag: expected [UNIVERSAL 16], found [UNIVERSAL 28]" > expected
diff expected actual
# check cert status using OpenSSL
docker exec pki openssl ocsp \
-url http://pki.example.com:8080/ocsp/ee/ocsp \
-CAfile ca_signing.crt \
-issuer ca_signing.crt \
-serial $CERT_ID \
> >(tee stdout) 2> >(tee stderr >&2) || true
# remove the random parts of stderr so it can be compared
sed -i "s/^[^:]*:error:/error:/g" stderr
# remove file names and line numbers so it can be compared
sed -i "s/^\([^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\)[^:]*:[^:]*:/\1/" stderr
# the responder should fail
echo "Error querying OCSP responder" > expected
echo "error:1E800076:HTTP routines:OSSL_HTTP_REQ_CTX_nbio:unexpected content type:expected=application/ocsp-response, actual=text/html" >> expected
echo "error:1E800067:HTTP routines:OSSL_HTTP_REQ_CTX_exchange:error receiving:server=http://pki.example.com:8080" >> expected
diff expected stderr
- name: Check OCSP responder with revoked cert
run: |
# revoke CA agent cert
docker exec pki /usr/share/pki/tests/ca/bin/ca-agent-cert-revoke.sh
sleep 5
# get cert serial number
docker exec pki pki nss-cert-show caagent | tee output
CERT_ID=$(sed -n "s/^\s*Serial Number:\s*\(\S*\)$/\1/p" output)
# check cert status using OCSPClient
docker exec pki OCSPClient \
-d /root/.dogtag/nssdb \
-h pki.example.com \
-p 8080 \
-t /ocsp/ee/ocsp \
-c ca_signing \
--serial $CERT_ID | tee output
# the status should be revoked
sed -n "s/^CertStatus=\(.*\)$/\1/p" output > actual
echo Revoked > expected
diff expected actual
# check cert status using OpenSSL
docker exec pki openssl ocsp \
-url http://pki.example.com:8080/ocsp/ee/ocsp \
-CAfile ca_signing.crt \
-issuer ca_signing.crt \
-serial $CERT_ID | tee output
# the status should be revoked
sed -n "s/^$CERT_ID:\s*\(\S*\)$/\1/p" output > actual
echo revoked > expected
diff expected actual
- name: Check OCSP responder with unrevoked cert
run: |
# unrevoke CA agent cert
docker exec pki /usr/share/pki/tests/ca/bin/ca-agent-cert-unrevoke.sh
# get cert serial number
docker exec pki pki nss-cert-show caagent | tee output
CERT_ID=$(sed -n "s/^\s*Serial Number:\s*\(\S*\)$/\1/p" output)
# check cert status using OCSPClient
docker exec pki OCSPClient \
-d /root/.dogtag/nssdb \
-h pki.example.com \
-p 8080 \
-t /ocsp/ee/ocsp \
-c ca_signing \
--serial $CERT_ID | tee output
# the status should be good
sed -n "s/^CertStatus=\(.*\)$/\1/p" output > actual
echo Good > expected
diff expected actual
# check cert status using OpenSSL
docker exec pki openssl ocsp \
-url http://pki.example.com:8080/ocsp/ee/ocsp \
-CAfile ca_signing.crt \
-issuer ca_signing.crt \
-serial $CERT_ID | tee output
# the status should be good
sed -n "s/^$CERT_ID:\s*\(\S*\)$/\1/p" output > actual
echo good > expected
diff expected actual
- name: Check OCSP responder with non existing cert
run: |
# get cert serial number
CERT_ID=0x1
docker exec pki pki ca-cert-show $CERT_ID || true
# check cert status on OCSP subsystem using OCSPClient
docker exec pki OCSPClient \
-d /root/.dogtag/nssdb \
-h pki.example.com \
-p 8080 \
-t /ocsp/ee/ocsp \
-c ca_signing \
--serial $CERT_ID | tee output
# the status should be good
sed -n "s/^CertStatus=\(.*\)$/\1/p" output > actual
echo Good > expected
diff expected actual
# check cert status on OCSP using OpenSSL
docker exec pki openssl ocsp \
-url http://pki.example.com:8080/ocsp/ee/ocsp \
-CAfile ca_signing.crt \
-issuer ca_signing.crt \
-serial $CERT_ID | tee output
# the status should be good
sed -n "s/^$CERT_ID:\s*\(\S*\)$/\1/p" output > actual
echo good > expected
diff expected actual
# check cert status on CA subsystem using OCSPClient
docker exec pki OCSPClient \
-d /root/.dogtag/nssdb \
-h pki.example.com \
-p 8080 \
-t /ca/ocsp \
-c ca_signing \
--serial $CERT_ID | tee output
# the status should be unknown
sed -n "s/^CertStatus=\(.*\)$/\1/p" output > actual
echo Unknown > expected
diff expected actual
# check cert status on CA using OpenSSL
docker exec pki openssl ocsp \
-url http://pki.example.com:8080/ca/ocsp \
-CAfile ca_signing.crt \
-issuer ca_signing.crt \
-serial $CERT_ID | tee output
# the status should be unknown
sed -n "s/^$CERT_ID:\s*\(\S*\)$/\1/p" output > actual
echo unknown > expected
diff expected actual
- name: Check OCSP responder with non managed CA
run: |
# get cert serial number
docker exec pki pki nss-cert-show caagent | tee output
CERT_ID=$(sed -n "s/^\s*Serial Number:\s*\(\S*\)$/\1/p" output)
# Generate a new self signed CA certificate and create a request
docker exec pki openssl req \
-newkey rsa:2048 -nodes \
-keyout new_ca.key \
-x509 -days 365 -out new_ca.crt \
-subj "/O=EXAMPLE/OU=pki-tomcat/CN=CA Signing Certificate External"
docker exec pki openssl ocsp -issuer new_ca.crt \
-serial $CERT_ID -reqout ocsp_new_ca.req
# check cert status using OCSPClient
docker exec pki OCSPClient \
-h pki.example.com \
-p 8080 \
-t /ocsp/ee/ocsp \
--input ocsp_new_ca.req | tee output
# the status should be unknown
sed -n "s/^CertStatus=\(.*\)$/\1/p" output > actual
echo Unknown > expected
diff expected actual
# check cert status using OpenSSL
docker exec pki openssl ocsp \
-url http://pki.example.com:8080/ocsp/ee/ocsp \
-CAfile ca_signing.crt \
-issuer new_ca.crt \
-serial $CERT_ID | tee output
# the status should be unknown
sed -n "s/^$CERT_ID:\s*\(\S*\)$/\1/p" output > actual
echo unknown > expected
diff expected actual
- name: Gather artifacts
if: always()
run: |
tests/bin/ds-artifacts-save.sh ds
tests/bin/pki-artifacts-save.sh pki
continue-on-error: true
- name: Remove OCSP
run: docker exec pki pkidestroy -s OCSP -v
- name: Remove CA
run: docker exec pki pkidestroy -s CA -v
- name: Check PKI server base dir after removal
run: |
# check file types, owners, and permissions
docker exec pki ls -l /var/lib/pki/pki-tomcat \
| sed \
-e '/^total/d' \
-e 's/^\(\S*\) *\S* *\(\S*\) *\(\S*\) *\S* *\S* *\S* *\S* *\(.*\)$/\1 \2 \3 \4/' \
| tee output
# TODO: review permissions
cat > expected << EOF
lrwxrwxrwx pkiuser pkiuser conf -> /etc/pki/pki-tomcat
lrwxrwxrwx pkiuser pkiuser logs -> /var/log/pki/pki-tomcat
EOF
diff expected output
- name: Check PKI server conf dir after removal
run: |
# check file types, owners, and permissions
docker exec pki ls -l /etc/pki/pki-tomcat \
| sed \
-e '/^total/d' \
-e 's/^\(\S*\) *\S* *\(\S*\) *\(\S*\) *\S* *\S* *\S* *\S* *\(.*\)$/\1 \2 \3 \4/' \
| tee output
# TODO: review permissions
cat > expected << EOF
drwxrwx--- pkiuser pkiuser Catalina
drwxrwx--- pkiuser pkiuser alias
drwxrwx--- pkiuser pkiuser ca
-rw-r--r-- pkiuser pkiuser catalina.policy
lrwxrwxrwx pkiuser pkiuser catalina.properties -> /usr/share/pki/server/conf/catalina.properties
drwxrwx--- pkiuser pkiuser certs
lrwxrwxrwx pkiuser pkiuser context.xml -> /etc/tomcat/context.xml
lrwxrwxrwx pkiuser pkiuser logging.properties -> /usr/share/pki/server/conf/logging.properties
drwxrwx--- pkiuser pkiuser ocsp
-rw-rw---- pkiuser pkiuser password.conf
-rw-rw---- pkiuser pkiuser server.xml
-rw-rw---- pkiuser pkiuser serverCertNick.conf
-rw-rw---- pkiuser pkiuser tomcat.conf
lrwxrwxrwx pkiuser pkiuser web.xml -> /etc/tomcat/web.xml
EOF
diff expected output
- name: Check PKI server logs dir after removal
run: |
# check file types, owners, and permissions
docker exec pki ls -l /var/log/pki/pki-tomcat \
| sed \
-e '/^total/d' \
-e 's/^\(\S*\) *\S* *\(\S*\) *\(\S*\) *\S* *\S* *\S* *\S* *\(.*\)$/\1 \2 \3 \4/' \
| tee output
DATE=$(date +'%Y-%m-%d')
# TODO: review permissions
cat > expected << EOF
drwxr-x--- pkiuser pkiuser backup
drwxrwx--- pkiuser pkiuser ca
-rw-rw-r-- pkiuser pkiuser catalina.$DATE.log
-rw-rw-r-- pkiuser pkiuser host-manager.$DATE.log
-rw-rw-r-- pkiuser pkiuser localhost.$DATE.log
-rw-r--r-- pkiuser pkiuser localhost_access_log.$DATE.txt
-rw-rw-r-- pkiuser pkiuser manager.$DATE.log
drwxrwx--- pkiuser pkiuser ocsp
drwxr-xr-x pkiuser pkiuser pki
EOF
diff expected output
- name: Check DS server systemd journal
if: always()
run: |
docker exec ds journalctl -x --no-pager -u [email protected]
- name: Check DS container logs
if: always()
run: |
docker logs ds
- name: Check PKI server systemd journal
if: always()
run: |
docker exec pki journalctl -x --no-pager -u [email protected]
- name: Check CA debug log
if: always()
run: |
docker exec pki find /var/lib/pki/pki-tomcat/logs/ca -name "debug.*" -exec cat {} \;
- name: Check OCSP debug log
if: always()
run: |
docker exec pki find /var/lib/pki/pki-tomcat/logs/ocsp -name "debug.*" -exec cat {} \;
- name: Upload artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: ocsp-basic
path: /tmp/artifacts