-
Notifications
You must be signed in to change notification settings - Fork 137
820 lines (692 loc) · 27.8 KB
/
acme-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
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
name: Basic ACME
on: workflow_call
env:
DS_IMAGE: ${{ vars.DS_IMAGE || 'quay.io/389ds/dirsrv' }}
jobs:
# docs/installation/acme/Installing_PKI_ACME_Responder.md
# docs/user/acme/Using_PKI_ACME_Responder_with_Certbot.md
test:
name: Test
runs-on: ubuntu-latest
env:
SHARED: /tmp/workdir/pki
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Retrieve ACME images
uses: actions/cache@v4
with:
key: acme-images-${{ github.sha }}
path: acme-images.tar
- name: Load ACME images
run: docker load --input acme-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 in PKI container
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
- name: Install CA admin cert
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
docker exec pki pki -n caadmin ca-user-show caadmin
- name: Check initial CA certs
run: |
docker exec pki pki ca-cert-find | tee output
# there should be 6 certs
echo "6" > expected
grep "Serial Number:" output | wc -l > actual
diff expected actual
- name: Set up ACME database in DS container
run: |
docker exec ds ldapmodify \
-H ldap://ds.example.com:3389 \
-D "cn=Directory Manager" \
-w Secret.123 \
-f $SHARED/base/acme/database/ds/schema.ldif
docker exec ds ldapadd \
-H ldap://ds.example.com:3389 \
-D "cn=Directory Manager" \
-w Secret.123 \
-f $SHARED/base/acme/database/ds/create.ldif
docker exec ds ldapadd \
-H ldap://ds.example.com:3389 \
-D "cn=Directory Manager" \
-w Secret.123 \
-f $SHARED/base/acme/realm/ds/create.ldif
- name: Install ACME in PKI container
run: |
docker exec pki pkispawn \
-f /usr/share/pki/server/examples/installation/acme.cfg \
-s ACME \
-D acme_database_url=ldap://ds.example.com:3389 \
-D acme_issuer_url=https://pki.example.com:8443 \
-D acme_realm_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
drwxrwx--- pkiuser pkiuser acme
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 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 acme
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
-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 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
drwxrwx--- pkiuser pkiuser acme
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
drwxr-xr-x pkiuser pkiuser pki
EOF
diff expected output
- name: Check ACME base dir
if: always()
run: |
docker exec pki ls -l /var/lib/pki/pki-tomcat/acme \
| 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 -> /var/lib/pki/pki-tomcat/conf/acme
lrwxrwxrwx pkiuser pkiuser logs -> /var/lib/pki/pki-tomcat/logs/acme
EOF
diff expected output
- name: Check ACME conf dir
run: |
# check file types, owners, and permissions
docker exec pki ls -l /etc/pki/pki-tomcat/acme \
| 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---- pkiuser pkiuser database.conf
-rw-rw---- pkiuser pkiuser issuer.conf
-rw-rw---- pkiuser pkiuser realm.conf
EOF
diff expected output
- name: Check ACME database config
if: always()
run: |
docker exec pki cat /etc/pki/pki-tomcat/acme/database.conf
- name: Check ACME issuer config
if: always()
run: |
docker exec pki cat /etc/pki/pki-tomcat/acme/issuer.conf
- name: Check ACME realm config
if: always()
run: |
docker exec pki cat /etc/pki/pki-tomcat/acme/realm.conf
- name: Check ACME logs dir
if: always()
run: |
docker exec pki ls -l /var/log/pki/pki-tomcat/acme
- name: Check initial ACME accounts
run: |
docker exec ds ldapsearch \
-H ldap://ds.example.com:3389 \
-D "cn=Directory Manager" \
-w Secret.123 \
-b ou=accounts,dc=acme,dc=pki,dc=example,dc=com \
-s one \
-o ldif_wrap=no \
-LLL | tee output
# there should be no accounts
echo "0" > expected
grep "^dn:" output | wc -l > actual
diff expected actual
- name: Check initial ACME orders
run: |
docker exec ds ldapsearch \
-H ldap://ds.example.com:3389 \
-D "cn=Directory Manager" \
-w Secret.123 \
-b ou=orders,dc=acme,dc=pki,dc=example,dc=com \
-s one \
-o ldif_wrap=no \
-LLL | tee output
# there should be no orders
echo "0" > expected
grep "^dn:" output | wc -l > actual
diff expected actual
- name: Check initial ACME authorizations
run: |
docker exec ds ldapsearch \
-H ldap://ds.example.com:3389 \
-D "cn=Directory Manager" \
-w Secret.123 \
-b ou=authorizations,dc=acme,dc=pki,dc=example,dc=com \
-s one \
-o ldif_wrap=no \
-LLL | tee output
# there should be no authorizations
echo "0" > expected
grep "^dn:" output | wc -l > actual
diff expected actual
- name: Check initial ACME challenges
run: |
docker exec ds ldapsearch \
-H ldap://ds.example.com:3389 \
-D "cn=Directory Manager" \
-w Secret.123 \
-b ou=challenges,dc=acme,dc=pki,dc=example,dc=com \
-s one \
-o ldif_wrap=no \
-LLL | tee output
# there should be no challenges
echo "0" > expected
grep "^dn:" output | wc -l > actual
diff expected actual
- name: Check initial ACME certs
run: |
docker exec ds ldapsearch \
-H ldap://ds.example.com:3389 \
-D "cn=Directory Manager" \
-w Secret.123 \
-b ou=certificates,dc=acme,dc=pki,dc=example,dc=com \
-s one \
-o ldif_wrap=no \
-LLL | tee output
# there should be no certs
echo "0" > expected
grep "^dn:" output | wc -l > actual
diff expected actual
- name: Check CA certs after ACME installation
run: |
docker exec pki pki ca-cert-find | tee output
# there should be 6 certs
echo "6" > expected
grep "Serial Number:" output | wc -l > actual
diff expected actual
- name: Run PKI healthcheck in PKI container
run: docker exec pki pki-healthcheck --failures-only
- name: Verify ACME in PKI container
run: docker exec pki pki acme-info
- name: Set up client container
run: |
tests/bin/runner-init.sh client
env:
HOSTNAME: client.example.com
- name: Connect client container to network
run: docker network connect example client --alias client.example.com
- name: Install certbot in client container
run: docker exec client dnf install -y certbot
- name: Register ACME account
run: |
docker exec client certbot register \
--server http://pki.example.com:8080/acme/directory \
--email [email protected] \
--agree-tos \
--non-interactive
- name: Check ACME accounts after registration
run: |
docker exec ds ldapsearch \
-H ldap://ds.example.com:3389 \
-D "cn=Directory Manager" \
-w Secret.123 \
-b ou=accounts,dc=acme,dc=pki,dc=example,dc=com \
-s one \
-o ldif_wrap=no \
-LLL | tee output
# there should be one account
echo "1" > expected
grep "^dn:" output | wc -l > actual
diff expected actual
# status should be valid
echo "valid" > expected
sed -n 's/^acmeStatus: *\(.*\)$/\1/p' output > actual
diff expected actual
# email should be [email protected]
echo "mailto:[email protected]" > expected
sed -n 's/^acmeAccountContact: *\(.*\)$/\1/p' output > actual
diff expected actual
- name: Enroll client cert
run: |
docker exec client certbot certonly \
--server http://pki.example.com:8080/acme/directory \
-d client.example.com \
--key-type rsa \
--standalone \
--non-interactive
- name: Check client cert
run: |
docker exec client pki client-cert-import \
--cert /etc/letsencrypt/live/client.example.com/fullchain.pem \
client1
# store serial number
docker exec client pki nss-cert-show client1 | tee output
sed -n 's/^ *Serial Number: *\(.*\)/\1/p' output > serial1.txt
# subject should be CN=client.example.com
echo "CN=client.example.com" > expected
sed -n 's/^ *Subject DN: *\(.*\)/\1/p' output > actual
diff expected actual
- name: Check ACME orders after enrollment
run: |
docker exec ds ldapsearch \
-H ldap://ds.example.com:3389 \
-D "cn=Directory Manager" \
-w Secret.123 \
-b ou=orders,dc=acme,dc=pki,dc=example,dc=com \
-s one \
-o ldif_wrap=no \
-LLL | tee output
# there should be one order
echo "1" > expected
grep "^dn:" output | wc -l > actual
diff expected actual
- name: Check ACME authorizations after enrollment
run: |
docker exec ds ldapsearch \
-H ldap://ds.example.com:3389 \
-D "cn=Directory Manager" \
-w Secret.123 \
-b ou=authorizations,dc=acme,dc=pki,dc=example,dc=com \
-s one \
-o ldif_wrap=no \
-LLL | tee output
# there should be one authorization
echo "1" > expected
grep "^dn:" output | wc -l > actual
diff expected actual
- name: Check ACME challenges after enrollment
run: |
docker exec ds ldapsearch \
-H ldap://ds.example.com:3389 \
-D "cn=Directory Manager" \
-w Secret.123 \
-b ou=challenges,dc=acme,dc=pki,dc=example,dc=com \
-s one \
-o ldif_wrap=no \
-LLL | tee output
# there should be one challenge
echo "1" > expected
grep "^dn:" output | wc -l > actual
diff expected actual
- name: Check ACME certs after enrollment
run: |
docker exec ds ldapsearch \
-H ldap://ds.example.com:3389 \
-D "cn=Directory Manager" \
-w Secret.123 \
-b ou=certificates,dc=acme,dc=pki,dc=example,dc=com \
-s one \
-o ldif_wrap=no \
-LLL | tee output
# there should be no certs (they are stored in CA)
echo "0" > expected
grep "^dn:" output | wc -l > actual
diff expected actual
- name: Check CA certs after enrollment
run: |
docker exec pki pki ca-cert-find | tee output
# there should be 7 certs
echo "7" > expected
grep "Serial Number:" output | wc -l > actual
diff expected actual
# check client cert
SERIAL=$(cat serial1.txt)
docker exec pki pki ca-cert-show $SERIAL | tee output
# subject should be CN=client.example.com
echo "CN=client.example.com" > expected
sed -n 's/^ *Subject DN: *\(.*\)/\1/p' output > actual
diff expected actual
- name: Renew client cert
run: |
docker exec client certbot renew \
--server http://pki.example.com:8080/acme/directory \
--cert-name client.example.com \
--force-renewal \
--no-random-sleep-on-renew \
--non-interactive
- name: Check renewed client cert
run: |
docker exec client pki client-cert-import \
--cert /etc/letsencrypt/live/client.example.com/fullchain.pem \
client2
# store serial number
docker exec client pki nss-cert-show client2 | tee output
sed -n 's/^ *Serial Number: *\(.*\)/\1/p' output > serial2.txt
# subject should be CN=client.example.com
echo "CN=client.example.com" > expected
sed -n 's/^ *Subject DN: *\(.*\)/\1/p' output > actual
diff expected actual
- name: Check ACME orders after renewal
run: |
docker exec ds ldapsearch \
-H ldap://ds.example.com:3389 \
-D "cn=Directory Manager" \
-w Secret.123 \
-b ou=orders,dc=acme,dc=pki,dc=example,dc=com \
-s one \
-o ldif_wrap=no \
-LLL | tee output
# there should be two orders
echo "2" > expected
grep "^dn:" output | wc -l > actual
diff expected actual
- name: Check ACME authorizations after renewal
run: |
docker exec ds ldapsearch \
-H ldap://ds.example.com:3389 \
-D "cn=Directory Manager" \
-w Secret.123 \
-b ou=authorizations,dc=acme,dc=pki,dc=example,dc=com \
-s one \
-o ldif_wrap=no \
-LLL | tee output
# there should be two authorizations
echo "2" > expected
grep "^dn:" output | wc -l > actual
diff expected actual
- name: Check ACME challenges after renewal
run: |
docker exec ds ldapsearch \
-H ldap://ds.example.com:3389 \
-D "cn=Directory Manager" \
-w Secret.123 \
-b ou=challenges,dc=acme,dc=pki,dc=example,dc=com \
-s one \
-o ldif_wrap=no \
-LLL | tee output
# there should be two challenges
echo "2" > expected
grep "^dn:" output | wc -l > actual
diff expected actual
- name: Check ACME certs after renewal
run: |
docker exec ds ldapsearch \
-H ldap://ds.example.com:3389 \
-D "cn=Directory Manager" \
-w Secret.123 \
-b ou=certificates,dc=acme,dc=pki,dc=example,dc=com \
-s one \
-o ldif_wrap=no \
-LLL | tee output
# there should be no certs (they are stored in CA)
echo "0" > expected
grep "^dn:" output | wc -l > actual
diff expected actual
- name: Check CA certs after renewal
run: |
docker exec pki pki ca-cert-find | tee output
# there should be 8 certs
echo "8" > expected
grep "Serial Number:" output | wc -l > actual
diff expected actual
# check renewed client cert
SERIAL=$(cat serial2.txt)
docker exec pki pki ca-cert-show $SERIAL | tee output
# subject should be CN=client.example.com
echo "CN=client.example.com" > expected
sed -n 's/^ *Subject DN: *\(.*\)/\1/p' output > actual
diff expected actual
- name: Revoke client cert
run: |
docker exec client certbot revoke \
--server http://pki.example.com:8080/acme/directory \
--cert-name client.example.com \
--non-interactive
- name: Check CA certs after revocation
run: |
docker exec pki pki ca-cert-find | tee output
# there should be 8 certs
echo "8" > expected
grep "Serial Number:" output | wc -l > actual
diff expected actual
# check original client cert
SERIAL=$(cat serial1.txt)
docker exec pki pki ca-cert-show $SERIAL | tee output
# status should be valid
echo "VALID" > expected
sed -n 's/^ *Status: *\(.*\)/\1/p' output > actual
diff expected actual
# check renewed-then-revoked client cert
SERIAL=$(cat serial2.txt)
docker exec pki pki ca-cert-show $SERIAL | tee output
# status should be revoked
echo "REVOKED" > expected
sed -n 's/^ *Status: *\(.*\)/\1/p' output > actual
diff expected actual
- name: Update ACME account
run: |
docker exec client certbot update_account \
--server http://pki.example.com:8080/acme/directory \
--email [email protected] \
--non-interactive
- name: Check ACME accounts after update
run: |
docker exec ds ldapsearch \
-H ldap://ds.example.com:3389 \
-D "cn=Directory Manager" \
-w Secret.123 \
-b ou=accounts,dc=acme,dc=pki,dc=example,dc=com \
-s one \
-o ldif_wrap=no \
-LLL | tee output
# there should be one account
echo "1" > expected
grep "^dn:" output | wc -l > actual
diff expected actual
# email should be [email protected]
echo "mailto:[email protected]" > expected
sed -n 's/^acmeAccountContact: *\(.*\)$/\1/p' output > actual
diff expected actual
- name: Remove ACME account
run: |
docker exec client certbot unregister \
--server http://pki.example.com:8080/acme/directory \
--non-interactive
- name: Check ACME accounts after unregistration
run: |
docker exec ds ldapsearch \
-H ldap://ds.example.com:3389 \
-D "cn=Directory Manager" \
-w Secret.123 \
-b ou=accounts,dc=acme,dc=pki,dc=example,dc=com \
-s one \
-o ldif_wrap=no \
-LLL | tee output
# there should be one account
echo "1" > expected
grep "^dn:" output | wc -l > actual
diff expected actual
# status should be deactivated
echo "deactivated" > expected
sed -n 's/^acmeStatus: *\(.*\)$/\1/p' output > actual
diff expected actual
- name: Remove ACME from PKI container
run: docker exec pki pkidestroy -s ACME -v
- name: Remove CA from PKI container
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 acme
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
-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
drwxrwx--- pkiuser pkiuser acme
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
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 ACME debug log
if: always()
run: |
docker exec pki find /var/lib/pki/pki-tomcat/logs/acme -name "debug.*" -exec cat {} \;
- name: Check certbot log
if: always()
run: |
docker exec client cat /var/log/letsencrypt/letsencrypt.log
- name: Gather artifacts from server containers
if: always()
run: |
tests/bin/ds-artifacts-save.sh --output=/tmp/artifacts/pki ds
tests/bin/pki-artifacts-save.sh pki
continue-on-error: true
- name: Gather artifacts from client container
if: always()
run: |
mkdir -p /tmp/artifacts/client
docker logs client > /tmp/artifacts/client/container.out 2> /tmp/artifacts/client/container.err
mkdir -p /tmp/artifacts/client/etc/letsencrypt
docker cp client:/etc/letsencrypt/live /tmp/artifacts/client/etc/letsencrypt
mkdir -p /tmp/artifacts/client/var/log/letsencrypt
docker cp client:/var/log/letsencrypt/letsencrypt.log /tmp/artifacts/client/var/log/letsencrypt
continue-on-error: true
- name: Upload artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: acme-basic
path: /tmp/artifacts