-
Notifications
You must be signed in to change notification settings - Fork 8
/
.gitlab-ci.yml
1017 lines (945 loc) · 29.7 KB
/
.gitlab-ci.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
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# Gitlab CI settings for building and testing Maat.
variables:
SARACODE_ROOT: https://saracode-backend.jhuapl.edu/v2/project
ARCHIVE_USER: archive
ARCHIVE_HOST: manda-ci-repo.jhuapl.edu
MAAT_VERSION: 2.0-1
IMAGE_PREFIX: artifactory.jhuapl.edu/maat
stages:
- sara-kickoff
- build
- docs
- test
- package
- deploy
- systemtest
- sara-collect
## MACROS
# default settings used by most tasks
default:
before_script:
- autoreconf -i
- "[ -d build ] || mkdir build"
- cd build
# configure and build without selinux
.build_no_selinux: &build_no_selinux
- ../configure --prefix=$PWD/../inst --with-systemdsystemunitdir=$PWD/../inst/lib/systemd --disable-selinux
- make install
# configure and build without selinux and without TPM
.build_no_selinux_no_tpm: &build_no_selinux_no_tpm
- ../configure --prefix=$PWD/../inst --with-systemdsystemunitdir=$PWD/../inst/lib/systemd --disable-selinux --disable-tpm
- make install
# configure and build with selinux and without TPM
.build_with_selinux_no_tpm: &build_with_selinux_no_tpm
- ../configure --prefix=$PWD/../inst --with-systemdsystemunitdir=$PWD/../inst/lib/systemd --disable-tpm
- make install
# configure and build with selinux and without TPM for PhotonOS
.build_no_selinux_no_tpm_photonos5: &build_no_selinux_no_tpm_photonos5
- cat /builds/JHUAPL-MS-Root-CA-05-21-2038-B64-text.cer >> /etc/pki/tls/certs/ca-bundle.crt
- tdnf -y install autoconf automake libtool check-devel glib-devel gcc glibc-devel binutils make elfutils-devel json-c-devel selinux-policy-devel libselinux-devel libxml2-devel tpm2-tss tpm2-tss-devel tpm2-tools openssl-devel libcap-devel
- tdnf -y install gcovr
- autoreconf -i
- "[ -d build ] || mkdir build"
- cd build
- ../configure --prefix=$PWD/../inst --with-systemdsystemunitdir=$PWD/../inst/lib/systemd --disable-tpm --disable-selinux --enable-coverage --enable-tests
- make
- make install
# configure and build with selinux and without TPM for PhotonOS
.build_with_selinux_no_tpm_photonos5: &build_with_selinux_no_tpm_photonos5
- cat /builds/JHUAPL-MS-Root-CA-05-21-2038-B64-text.cer >> /etc/pki/tls/certs/ca-bundle.crt
- tdnf -y install autoconf automake libtool check-devel glib-devel gcc glibc-devel binutils make elfutils-devel json-c-devel selinux-policy-devel libselinux-devel libxml2-devel tpm2-tss tpm2-tss-devel tpm2-tools openssl-devel libcap-devel
- autoreconf -i
- "[ -d build ] || mkdir build"
- cd build
- ../configure --prefix=$PWD/../inst --with-systemdsystemunitdir=$PWD/../inst/lib/systemd --disable-tpm --enable-coverage --enable-tests --enable-photon
- make
- make install
# configure and build with selinux and TPM
.build_with_selinux_and_tpm: &build_with_selinux_and_tpm
- ../configure --prefix=$PWD/../inst --with-systemdsystemunitdir=$PWD/../inst/lib/systemd
- make install
# build documentation
.build_docs: &build_docs
- ../configure --prefix=$PWD/../inst --with-systemdsystemunitdir=$PWD/../inst/lib/systemd --disable-selinux --enable-tests --disable-tpm
- make docs
- mv documentation/build ../maat-docs
# run check tests without selinux
.test_no_selinux: &test_no_selinux
- ../configure --prefix=$PWD/../inst --with-systemdsystemunitdir=$PWD/../inst/lib/systemd --disable-selinux --enable-tests --enable-coverage
- make check
- gcovr --xml-pretty --exclude-unreachable-branches --print-summary -o coverage.xml --root ${CI_PROJECT_DIR}
# run check tests without selinux adn without TPM
.test_no_selinux_no_tpm: &test_no_selinux_no_tpm
- ../configure --prefix=$PWD/../inst --with-systemdsystemunitdir=$PWD/../inst/lib/systemd --disable-selinux --enable-tests --disable-tpm --enable-coverage
- make check
- gcovr --xml-pretty --exclude-unreachable-branches --print-summary -o coverage.xml --root ${CI_PROJECT_DIR}
# configure and build with selinux and without TPM for PhotonOS
.test_no_selinux_no_tpm_photonos5: &test_no_selinux_no_tpm_photonos5
- *build_no_selinux_no_tpm_photonos5
- make check
- gcovr --xml-pretty --exclude-unreachable-branches --print-summary -o coverage.xml --root ${CI_PROJECT_DIR}
# Run check tests with gcc address sanitizer enabled
.test_asan: &test_asan
- ../configure --prefix=$PWD/../inst --with-systemdsystemunitdir=$PWD/../inst/lib/systemd --disable-selinux --enable-tests --enable-coverage CFLAGS='-fsanitize=address -g -O0'
# There are actual ODR violations but ignore for now
- ASAN_OPTIONS='detect_leaks=0 detect_odr_violation=0' make check
- gcovr --xml-pretty --exclude-unreachable-branches --print-summary -o coverage.xml --root ${CI_PROJECT_DIR}
# Run check tests with gcc address sanitizer enabled without TPM
.test_asan_no_tpm: &test_asan_no_tpm
- ../configure --prefix=$PWD/../inst --with-systemdsystemunitdir=$PWD/../inst/lib/systemd --disable-selinux --disable-tpm --enable-tests --enable-coverage CFLAGS='-fsanitize=address -g -O0'
# There are actual ODR violations but ignore for now
- ASAN_OPTIONS='detect_leaks=0 detect_odr_violation=0' make check
- gcovr --xml-pretty --exclude-unreachable-branches --print-summary -o coverage.xml --root ${CI_PROJECT_DIR}
# Build debian packages for ${release} and ${arch}
.deb_build: &deb_build
- /usr/bin/pbuilder-dist ${release} ${arch} create
- /usr/bin/pbuilder-dist ${release} ${arch} update # is this necessary?
- ../configure --prefix=/usr --disable-selinux
- make dist
- mkdir staging
- cp maat-*.tar.gz staging
- mkdir tmp
- cd tmp
- tar xzf ../maat-*.tar.gz
- sed -i.bak "s/-1)/-1${release}0)/g" maat-*/debian/changelog
- dpkg-source -b maat-*
- echo "PBUILDERSATISFYDEPENDSCMD=${PBSAT}" > .pbset-${release}-${arch}
- /usr/bin/pbuilder-dist ${release} ${arch} build --buildresult $PWD/../staging/${release}-${arch}-results --configfile .pbset-${release}-${arch} maat*${release}*.dsc
# Create debian repo for ${release}
.deb_repo: &deb_repo
- cd build/staging
- mkdir -p ubuntu/conf
- cp ../../ci/ubuntu_distributions ubuntu/conf/distributions
- "echo \"Codename: ${release}\" >> ubuntu/conf/distributions"
- echo "basedir ." > ubuntu/conf/options
- cd ubuntu
- reprepro -V includedeb ${release} ../${release}-*-results/maat*.deb
- cd ../..
# Create RPM repo for ${release} and ${arch}
.rpm_repo: &rpm_repo
- ../configure --prefix=/usr --disable-tpm --disable-selinux-libdir-mapping
- make rpm
- cp /root/rpmbuild/RPMS/x86_64/*.rpm .
# System test on RHEL with selinux enabled
.rhel_selinux_system_test: &rhel_selinux_system_test
- cd build
- sudo yum install -y maat-${MAAT_VERSION}.el${release}.x86_64.rpm maat-selinux-${MAAT_VERSION}.el${release}.x86_64.rpm
- cd ../
- sudo semanage port -a -t attestmgr_port_t -p tcp 2343
- sudo cp demo/credentials/client.* /etc/maat/credentials/
- sudo rpm -qa --qf "%{NAME}\n" | sudo tee -a /usr/share/maat/asps/packages.whitelist
- "LIBMAAT_LOG_SYSLOG=0 LIBMAAT_DEBUG_LEVEL=5 /usr/bin/attestmgr -i 127.0.0.1:2342 -u /tmp/app.sock -C /etc/maat/minimal-am-config.xml 2>&1 | tee app.log &"
- "LIBMAAT_LOG_SYSLOG=0 LIBMAAT_DEBUG_LEVEL=5 /usr/bin/attestmgr -i 127.0.0.1:2343 -u /tmp/att.sock -C /etc/maat/minimal-am-config.xml 2>&1 | tee att.log &"
- sleep 10
- "valgrind /usr/bin/test_client -l localhost -a 2342 -t localhost -p 2343 -r userspace 2>&1 | tee test_client.log || true"
- "kill %2 || true"
- "kill %1 || true"
- sudo rm -f /etc/maat/credentials/client.*
- "if ! grep PASS test_client.log ; then echo 'Did not find PASS!' ; exit 1 ; fi"
## sara-kickoff
# Start saracode analysis
kickoff-saracode:
stage: sara-kickoff
tags:
- new-docker
inherit:
default: false
script:
- ci/sara_kickoff.sh
artifacts:
paths:
- saracode_build_id
expire_in: 2 hours
when: on_success
## build
# build without selinux for ubuntu20
build-ubuntu20:
stage: build
tags:
- new-docker
image: ${IMAGE_PREFIX}/ubuntu20:0.0.5
script:
- *build_no_selinux_no_tpm
# build without selinux with TPM for ubuntu20
build-ubuntu20-tpm:
stage: build
tags:
- new-docker
image: ${IMAGE_PREFIX}/ubuntu20:0.0.5
script:
- *build_no_selinux
# build without selinux for ubuntu22
build-ubuntu22:
stage: build
tags:
- new-docker
image: ${IMAGE_PREFIX}/ubuntu22:0.0.5
script:
- *build_no_selinux_no_tpm
# build without selinux with TPM for ubuntu22
build-ubuntu22-tpm:
stage: build
tags:
- new-docker
image: ${IMAGE_PREFIX}/ubuntu22:0.0.5
script:
- *build_no_selinux
# build without selinux for rhel8
build-rhel8-no-selinux:
stage: build
tags:
- new-docker
image: ${IMAGE_PREFIX}/rhel8:0.0.5
script:
- *build_no_selinux_no_tpm
# build with selinux for rhel8
build-rhel8-selinux:
stage: build
tags:
- new-docker
image: ${IMAGE_PREFIX}/rhel8:0.0.5
script:
- *build_with_selinux_no_tpm
# build with selinux and tpm support for rhel8
build-rhel8-selinux-tpm:
stage: build
tags:
- new-docker
image: ${IMAGE_PREFIX}/rhel8:0.0.5
script:
- *build_with_selinux_and_tpm
# build without selinux for rhel9
build-rhel9-no-selinux:
stage: build
tags:
- new-docker
image: ${IMAGE_PREFIX}/rhel9:0.0.5
script:
- *build_no_selinux_no_tpm
# build with selinux for rhel9
build-rhel9-selinux:
stage: build
tags:
- new-docker
image: ${IMAGE_PREFIX}/rhel9:0.0.5
script:
- *build_with_selinux_no_tpm
#build without selinux without TPM for ubuntu23
build-ubuntu23:
stage: build
tags:
- new-docker
image: ${IMAGE_PREFIX}/ubuntu23:0.0.6
script:
- *build_no_selinux_no_tpm
#build without selinux without TPM for debian 11
build-debian11:
stage: build
tags:
- new-docker
image: ${IMAGE_PREFIX}/debian11:0.0.1
script:
- *build_no_selinux_no_tpm
# build without selinux for PhotonOS 5.0
build-photonos5:
stage: build
inherit:
default: false
tags:
- photonos5
script:
- *build_with_selinux_no_tpm_photonos5
## docs
# build docs on ubuntu20
docs-ubuntu:
stage: docs
tags:
- new-docker
image: ${IMAGE_PREFIX}/ubuntu20:0.0.5
script:
- *build_docs
artifacts:
paths:
- maat-docs
expire_in: 2 weeks
when: on_success
## test
# regular make check tests on ubuntu20
test-ubuntu20-basic:
stage: test
tags:
- new-ubuntu20
script:
- *test_no_selinux_no_tpm
coverage: /^\s*lines:\s*\d+.\d+\%/
artifacts:
paths:
- build/src/test/*.log
- build/lib/test/*.log
expire_in: 2 weeks
reports:
coverage_report:
coverage_format: cobertura
path: build/coverage.xml
when: always
# regular make check tests on ubuntu20 with TPM
test-ubuntu20-basic-tpm:
stage: test
tags:
- new-ubuntu20
- new-tpm
script:
- *test_no_selinux
coverage: /^\s*lines:\s*\d+.\d+\%/
artifacts:
paths:
- build/src/test/*.log
- build/lib/test/*.log
expire_in: 2 weeks
reports:
coverage_report:
coverage_format: cobertura
path: build/coverage.xml
when: always
# make check tests with address sanitizer on ubuntu20
test-ubuntu20-asan:
stage: test
tags:
- new-ubuntu20
script:
- *test_asan_no_tpm
coverage: /^\s*lines:\s*\d+.\d+\%/
artifacts:
paths:
- build/src/test/*.log
- build/lib/test/*.log
expire_in: 2 weeks
reports:
coverage_report:
coverage_format: cobertura
path: build/coverage.xml
when: always
# make check tests with address sanitizer on ubuntu20
test-ubuntu20-asan-tpm:
stage: test
tags:
- new-ubuntu20
script:
- *test_asan
coverage: /^\s*lines:\s*\d+.\d+\%/
artifacts:
paths:
- build/src/test/*.log
- build/lib/test/*.log
expire_in: 2 weeks
reports:
coverage_report:
coverage_format: cobertura
path: build/coverage.xml
when: always
# regular make check tests on ubuntu22
test-ubuntu22-basic:
stage: test
tags:
- new-ubuntu22
script:
- *test_no_selinux_no_tpm
coverage: /^\s*lines:\s*\d+.\d+\%/
artifacts:
paths:
- build/src/test/*.log
- build/lib/test/*.log
expire_in: 2 weeks
reports:
coverage_report:
coverage_format: cobertura
path: build/coverage.xml
when: always
# regular make check tests on ubuntu22 with TPM
test-ubuntu22-basic-tpm:
stage: test
tags:
- new-ubuntu22
- new-tpm
script:
- *test_no_selinux
coverage: /^\s*lines:\s*\d+.\d+\%/
artifacts:
paths:
- build/src/test/*.log
- build/lib/test/*.log
expire_in: 2 weeks
reports:
coverage_report:
coverage_format: cobertura
path: build/coverage.xml
when: always
# make check tests with address sanitizer on ubuntu22
test-ubuntu22-asan:
stage: test
tags:
- new-docker
image: ${IMAGE_PREFIX}/ubuntu22:0.0.5
script:
- *test_asan_no_tpm
coverage: /^\s*lines:\s*\d+.\d+\%/
artifacts:
paths:
- build/src/test/*.log
expire_in: 2 weeks
reports:
coverage_report:
coverage_format: cobertura
path: build/coverage.xml
when: always
# Disabled due to what may be a bug with gcc and/or libasan that only seems to
# occur on ubuntu22
# see https://github.com/actions/runner-images/issues/9524
# make check tests with address sanitizer on ubuntu22
# test-ubuntu22-asan-tpm:
# stage: test
# tags:
# - ubuntu22
# - tpm
# script:
# - *test_asan
# coverage: /^\s*lines:\s*\d+.\d+\%/
# artifacts:
# paths:
# - build/src/test/*.log
# - build/lib/test/*.log
# expire_in: 2 weeks
# reports:
# coverage_report:
# coverage_format: cobertura
# path: build/coverage.xml
# when: always
# regular make check tests on ubuntu23
test-ubuntu23-basic:
stage: test
tags:
- new-docker
image: ${IMAGE_PREFIX}/ubuntu23:0.0.6
script:
- *test_no_selinux_no_tpm
coverage: /^\s*lines:\s*\d+.\d+\%/
artifacts:
paths:
- build/src/test/*.log
- build/lib/test/*.log
expire_in: 2 weeks
reports:
coverage_report:
coverage_format: cobertura
path: build/coverage.xml
when: always
# regular make check tests on debian 11
test-debian11-basic:
stage: test
tags:
- new-docker
image: ${IMAGE_PREFIX}/debian11:0.0.1
script:
- *test_no_selinux_no_tpm
coverage: /^\s*lines:\s*\d+.\d+\%/
artifacts:
paths:
- build/src/test/*.log
- build/lib/test/*.log
expire_in: 2 weeks
reports:
coverage_report:
coverage_format: cobertura
path: build/coverage.xml
when: always
# regular make check tests on photonos
test-photonos5-basic:
stage: test
inherit:
default: false
tags:
- photonos5
script:
- *test_no_selinux_no_tpm_photonos5
coverage: /^\s*lines:\s*\d+.\d+\%/
artifacts:
paths:
- build/src/test/*.log
expire_in: 2 weeks
reports:
coverage_report:
coverage_format: cobertura
path: build/coverage.xml
when: always
# make check tests without selinux on rhel8
test-rhel8-basic-no-selinux:
stage: test
tags:
- new-docker
image: ${IMAGE_PREFIX}/rhel8:0.0.5
script:
- *test_no_selinux_no_tpm
coverage: /^\s*lines:\s*\d+.\d+\%/
artifacts:
paths:
- build/src/test/*.log
- build/lib/test/*.log
expire_in: 2 weeks
reports:
coverage_report:
coverage_format: cobertura
path: build/coverage.xml
when: always
# make check tests with address sanitizer on rhel8
test-rhel8-asan:
stage: test
tags:
- new-docker
image: ${IMAGE_PREFIX}/rhel8:0.0.5
script:
- *test_asan_no_tpm
coverage: /^\s*lines:\s*\d+.\d+\%/
artifacts:
paths:
- build/src/test/*.log
- build/lib/test/*.log
expire_in: 2 weeks
reports:
coverage_report:
coverage_format: cobertura
path: build/coverage.xml
when: always
# make check tests without selinux on rhel9
test-rhel9-basic-no-selinux:
stage: test
tags:
- new-docker
image: ${IMAGE_PREFIX}/rhel9:0.0.5
script:
- *test_no_selinux_no_tpm
coverage: /^\s*lines:\s*\d+.\d+\%/
artifacts:
paths:
- build/src/test/*.log
- build/lib/test/*.log
expire_in: 2 weeks
reports:
coverage_report:
coverage_format: cobertura
path: build/coverage.xml
when: always
# make check tests with address sanitizer on rhel9
test-rhel9-asan:
stage: test
tags:
- new-docker
image: ${IMAGE_PREFIX}/rhel9:0.0.5
script:
- *test_asan_no_tpm
coverage: /^\s*lines:\s*\d+.\d+\%/
artifacts:
paths:
- build/src/test/*.log
- build/lib/test/*.log
expire_in: 2 weeks
reports:
coverage_report:
coverage_format: cobertura
path: build/coverage.xml
when: always
## package
# package ubuntu20 focal deb
package-ubuntu20-amd64-deb:
stage: package
tags:
- new-ubuntu20
variables:
release: focal
arch: amd64
PBSAT: /usr/lib/pbuilder/pbuilder-satisfydepends-aptitude
script:
- *deb_build
artifacts:
paths:
- build/staging
expire_in: 2 weeks
# package ubuntu22 jammy deb
package-ubuntu22-amd64-deb:
stage: package
tags:
- new-ubuntu22
variables:
release: jammy
arch: amd64
PBSAT: /usr/lib/pbuilder/pbuilder-satisfydepends-aptitude
script:
- *deb_build
artifacts:
paths:
- build/staging
expire_in: 2 weeks
# package rhel8 rpm
package-rhel8-x86_64-rpm:
stage: package
tags:
- new-docker
image: ${IMAGE_PREFIX}/rhel8:0.0.5
script:
- *rpm_repo
artifacts:
paths:
- build/*.rpm
expire_in: 2 weeks
# package rhel9 rpm
package-rhel9-x86_64-rpm:
stage: package
tags:
- new-docker
image: ${IMAGE_PREFIX}/rhel9:0.0.5
script:
- *rpm_repo
artifacts:
paths:
- build/*.rpm
expire_in: 2 weeks
## deploy
# create ubuntu20 focal repo
create-ubuntu20-repo:
stage: deploy
tags:
- new-ubuntu20
needs:
- package-ubuntu20-amd64-deb
inherit:
default: false
variables:
release: focal
script:
- *deb_repo
artifacts:
paths:
- build/staging
expire_in: 2 weeks
# create ubuntu22 jammy repo
create-ubuntu22-repo:
stage: deploy
tags:
- new-ubuntu22
needs:
- package-ubuntu22-amd64-deb
inherit:
default: false
variables:
release: jammy
script:
- *deb_repo
artifacts:
paths:
- build/staging
expire_in: 2 weeks
## systemtest
# system test on rhel8
system-test-rhel8:
stage: systemtest
tags:
- new-rhel8
inherit:
default: false
timeout: 2 hours
variables:
release: 8
before_script:
- "sudo killall -15 attestmgr || true"
- "sudo killall -9 attestmgr || true"
- sudo semanage port -d -t attestmgr_port_t -p tcp 2343 || true
- sudo yum remove maat maat-selinux -y || true
script:
*rhel_selinux_system_test
artifacts:
paths:
- "*.log"
expire_in: 2 weeks
when: always
# system test on rhel9
system-test-rhel9:
stage: systemtest
tags:
- new-rhel9
inherit:
default: false
variables:
release: 9
timeout: 2 hours
before_script:
- "sudo killall -15 attestmgr || true"
- "sudo killall -9 attestmgr || true"
- sudo semanage port -d -t attestmgr_port_t -p tcp 2343 || true
- sudo yum remove maat maat-selinux -y || true
script:
*rhel_selinux_system_test
artifacts:
paths:
- "*.log"
expire_in: 2 weeks
when: always
# system test on ubuntu20 with valgrind
system-test-ubuntu20-valgrind:
stage: systemtest
tags:
- new-ubuntu20
inherit:
default: false
needs:
- create-ubuntu20-repo
variables:
release: focal
arch: amd64
before_script:
- "sudo killall -15 attestmgr || true"
- "sudo killall -9 attestmgr || true"
script:
- rm -rf ~/maat-deb
- mkdir ~/maat-deb
- cp -r build/staging/* ~/maat-deb/
- echo -n "deb [allow-insecure=yes] file:/home/gitlab-runner/maat-deb/ubuntu ${release} multiverse" > maat.list
- sudo cp maat.list /etc/apt/sources.list.d/
- sudo apt-get --allow-unauthenticated update
- sudo apt-get --allow-unauthenticated -y --reinstall install maat
- sudo cp demo/credentials/client.* /etc/maat/credentials/
- LIBMAAT_LOG_SYSLOG=0 valgrind --show-leak-kinds=definite --leak-check=full /usr/bin/attestmgr -i 127.0.0.1:2342 -u /tmp/app.sock -C /etc/maat/minimal-am-config.xml 2>&1 | tee app.log &
- LIBMAAT_LOG_SYSLOG=0 valgrind --show-leak-kinds=definite --leak-check=full /usr/bin/attestmgr -i 127.0.0.1:2343 -u /tmp/att.sock -C /etc/maat/minimal-am-config.xml 2>&1 | tee att.log &
- sleep 10
- "valgrind --show-leak-kinds=definite --leak-check=full /usr/bin/test_client -l localhost -a 2342 -t localhost -p 2343 -r processes 2>&1 | tee test_client.log || true"
- "kill %2 || true"
- "kill %1 || true"
- sudo rm -f /etc/maat/credentials/client.*
- "if ! grep PASS test_client.log ; then echo 'Did not find PASS!' ; exit 1 ; fi"
artifacts:
paths:
- app.log
- att.log
- test_client.log
expire_in: 2 weeks
# system test on ubunt20 that is expected to fail
system-test-ubuntu20-fail:
stage: systemtest
tags:
- new-ubuntu20
inherit:
default: false
needs:
- create-ubuntu20-repo
variables:
release: focal
arch: amd64
before_script:
- "sudo killall -15 attestmgr || true"
- "sudo killall -9 attestmgr || true"
script:
- rm -rf ~/maat-deb
- mkdir ~/maat-deb
- cp -r build/staging/* ~/maat-deb/
- echo -n "deb [allow-insecure=yes] file:/home/gitlab-runner/maat-deb/ubuntu ${release} multiverse" > maat.list
- sudo cp maat.list /etc/apt/sources.list.d/
- sudo apt-get --allow-unauthenticated update
- sudo apt-get --allow-unauthenticated -y --reinstall install maat
- sudo cp demo/credentials/client.* /etc/maat/credentials/
- echo "ubuntu-session 3.36.0-2ubuntu1 amd64" | sudo tee -a /usr/share/maat/asps/package.blacklist
- LIBMAAT_LOG_SYSLOG=0 /usr/bin/attestmgr -i 127.0.0.1:2342 -u /tmp/app.sock -C /etc/maat/minimal-am-config.xml &
- LIBMAAT_LOG_SYSLOG=0 /usr/bin/attestmgr -i 127.0.0.1:2343 -u /tmp/att.sock -C /etc/maat/minimal-am-config.xml &
- sleep 10
- "/usr/bin/test_client -l localhost -a 2342 -t localhost -p 2343 -r packages | tee test_client.log || true"
- "kill %2 || true"
- "kill %1 || true"
- "sudo rm -f /etc/maat/credentials/client.*"
- "if ! grep FAIL test_client.log ; then echo 'Did not find FAIL!' ; exit 1 ; fi"
after_script:
- sudo truncate -s 0 /usr/share/maat/asps/package.blacklist
artifacts:
paths:
- test_client.log
expire_in: 2 weeks
# system test on ubuntu20
system-test-ubuntu20-tpm:
stage: systemtest
tags:
- new-ubuntu20
- new-tpm
inherit:
default: false
needs:
- create-ubuntu20-repo
variables:
release: focal
arch: amd64
before_script:
- "sudo killall -15 attestmgr || true"
- "sudo killall -9 attestmgr || true"
script:
- rm -rf ~/maat-deb
- mkdir ~/maat-deb
- cp -r build/staging/* ~/maat-deb/
- echo -n "deb [allow-insecure=yes] file:/home/gitlab-runner/maat-deb/ubuntu ${release} multiverse" > maat.list
- sudo cp maat.list /etc/apt/sources.list.d/
- sudo apt-get --allow-unauthenticated update
- sudo apt-get --allow-unauthenticated -y --reinstall install maat
- export TPM2TOOLS_TCTI=tabrmd && tpm2_createek -c demo/credentials/ek.handle && tpm2_createak -C demo/credentials/ek.handle -c demo/credentials/ak.ctx -u demo/credentials/akpub.pem -f pem -p maatpass
- sudo cp demo/credentials/ak* /etc/maat/credentials/
- sudo cp demo/credentials/client.* /etc/maat/credentials/
- LIBMAAT_LOG_SYSLOG=0 /usr/bin/attestmgr -i 127.0.0.1:2342 -u /tmp/app.sock -C /etc/maat/minimal-am-config.xml -T 1 -v 1 &
- LIBMAAT_LOG_SYSLOG=0 /usr/bin/attestmgr -i 127.0.0.1:2343 -u /tmp/att.sock -C /etc/maat/minimal-am-config.xml -T 1 -v 1 &
- sleep 10
- "/usr/bin/test_client -l localhost -a 2342 -t localhost -p 2343 -r processes | tee test_client.log || true"
- "kill %2 || true"
- "kill %1 || true"
- sudo rm -f /etc/maat/credentials/ak*
- sudo rm -f /etc/maat/credentials/client.*
- "if ! grep PASS test_client.log ; then echo 'Did not find PASS!' ; exit 1 ; fi"
artifacts:
paths:
- test_client.log
expire_in: 2 weeks
# system test on ubunt20 that is expected to fail
system-test-ubuntu20-fail-tpm:
stage: systemtest
tags:
- new-ubuntu20
- new-tpm
inherit:
default: false
needs:
- create-ubuntu20-repo
variables:
release: focal
arch: amd64
before_script:
- "sudo killall -15 attestmgr || true"
- "sudo killall -9 attestmgr || true"
script:
- rm -rf ~/maat-deb
- mkdir ~/maat-deb
- cp -r build/staging/* ~/maat-deb/
- echo -n "deb [allow-insecure=yes] file:/home/gitlab-runner/maat-deb/ubuntu ${release} multiverse" > maat.list
- sudo cp maat.list /etc/apt/sources.list.d/
- sudo apt-get --allow-unauthenticated update
- sudo apt-get --allow-unauthenticated -y --reinstall install maat
- export TPM2TOOLS_TCTI=tabrmd && tpm2_createek -c demo/credentials/ek.handle && tpm2_createak -C demo/credentials/ek.handle -c demo/credentials/ak.ctx -u demo/credentials/akpub.pem -f pem -p maatpass
- sudo cp demo/credentials/ak* /etc/maat/credentials/
- sudo cp demo/credentials/client.* /etc/maat/credentials/
- echo "ubuntu-session 3.36.0-2ubuntu1 amd64" | sudo tee -a /usr/share/maat/asps/package.blacklist
- LIBMAAT_LOG_SYSLOG=0 /usr/bin/attestmgr -i 127.0.0.1:2342 -u /tmp/app.sock -C /etc/maat/minimal-am-config.xml -T 1 -v 1 &
- LIBMAAT_LOG_SYSLOG=0 /usr/bin/attestmgr -i 127.0.0.1:2343 -u /tmp/att.sock -C /etc/maat/minimal-am-config.xml -T 1 -v 1 &
- sleep 10
- "/usr/bin/test_client -l localhost -a 2342 -t localhost -p 2343 -r packages | tee test_client.log || true"
- "kill %2 || true"
- "kill %1 || true"
- "sudo rm -f /etc/maat/credentials/ak*"
- "sudo rm -f /etc/maat/credentials/client.*"
- "if ! grep FAIL test_client.log ; then echo 'Did not find FAIL!' ; exit 1 ; fi"
after_script:
- sudo truncate -s 0 /usr/share/maat/asps/package.blacklist
artifacts:
paths:
- test_client.log
expire_in: 2 weeks
# system test on ubuntu22
system-test-ubuntu22-tpm:
stage: systemtest
tags:
- new-ubuntu22
- new-tpm
inherit:
default: false
needs:
- create-ubuntu22-repo
variables:
release: jammy
arch: amd64
before_script:
- "sudo killall -15 attestmgr || true"
- "sudo killall -9 attestmgr || true"
script:
- rm -rf ~/maat-deb
- mkdir ~/maat-deb
- cp -r build/staging/* ~/maat-deb/
- echo -n "deb [allow-insecure=yes] file:/home/gitlab-runner/maat-deb/ubuntu ${release} multiverse" > maat.list
- sudo cp maat.list /etc/apt/sources.list.d/
- sudo apt-get --allow-unauthenticated update
- sudo apt-get --allow-unauthenticated -y --reinstall install maat
- export TPM2TOOLS_TCTI=tabrmd && tpm2_createek -c demo/credentials/ek.handle && tpm2_createak -C demo/credentials/ek.handle -c demo/credentials/ak.ctx -u demo/credentials/akpub.pem -f pem -p maatpass
- sudo cp demo/credentials/ak* /etc/maat/credentials/
- sudo cp demo/credentials/client.* /etc/maat/credentials/
- LIBMAAT_LOG_SYSLOG=0 /usr/bin/attestmgr -i 127.0.0.1:2342 -u /tmp/app.sock -C /etc/maat/minimal-am-config.xml -T 1 -v 1 &
- LIBMAAT_LOG_SYSLOG=0 /usr/bin/attestmgr -i 127.0.0.1:2343 -u /tmp/att.sock -C /etc/maat/minimal-am-config.xml -T 1 -v 1 &
- sleep 10
- "/usr/bin/test_client -l localhost -a 2342 -t localhost -p 2343 -r processes | tee test_client.log || true"
- "kill %2 || true"
- "kill %1 || true"
- sudo rm -f /etc/maat/credentials/ak*
- sudo rm -f /etc/maat/credentials/client.*
- "if ! grep PASS test_client.log ; then echo 'Did not find PASS!' ; exit 1 ; fi"
artifacts:
paths:
- test_client.log
expire_in: 2 weeks
# system test on ubunt22 that is expected to fail
system-test-ubuntu22-fail-tpm:
stage: systemtest
tags:
- new-ubuntu22
- new-tpm
inherit:
default: false
needs:
- create-ubuntu22-repo
variables:
release: jammy
arch: amd64
before_script:
- "sudo killall -15 attestmgr || true"
- "sudo killall -9 attestmgr || true"
script:
- rm -rf ~/maat-deb
- mkdir ~/maat-deb
- cp -r build/staging/* ~/maat-deb/
- echo -n "deb [allow-insecure=yes] file:/home/gitlab-runner/maat-deb/ubuntu ${release} multiverse" > maat.list
- sudo cp maat.list /etc/apt/sources.list.d/
- sudo apt-get --allow-unauthenticated update
- sudo apt-get --allow-unauthenticated -y --reinstall install maat
- export TPM2TOOLS_TCTI=tabrmd && tpm2_createek -c demo/credentials/ek.handle && tpm2_createak -C demo/credentials/ek.handle -c demo/credentials/ak.ctx -u demo/credentials/akpub.pem -f pem -p maatpass
- sudo cp demo/credentials/ak* /etc/maat/credentials/
- sudo cp demo/credentials/client.* /etc/maat/credentials/
- echo "ubuntu-session 3.36.0-2ubuntu1 amd64" | sudo tee -a /usr/share/maat/asps/package.blacklist
- LIBMAAT_LOG_SYSLOG=0 /usr/bin/attestmgr -i 127.0.0.1:2342 -u /tmp/app.sock -C /etc/maat/minimal-am-config.xml -T 1 -v 1 &
- LIBMAAT_LOG_SYSLOG=0 /usr/bin/attestmgr -i 127.0.0.1:2343 -u /tmp/att.sock -C /etc/maat/minimal-am-config.xml -T 1 -v 1 &
- sleep 10
- "/usr/bin/test_client -l localhost -a 2342 -t localhost -p 2343 -r packages | tee test_client.log || true"
- "kill %2 || true"
- "kill %1 || true"
- "sudo rm -f /etc/maat/credentials/ak*"
- "sudo rm -f /etc/maat/credentials/client.*"
- "if ! grep FAIL test_client.log ; then echo 'Did not find FAIL!' ; exit 1 ; fi"
after_script:
- sudo truncate -s 0 /usr/share/maat/asps/package.blacklist
artifacts:
paths:
- test_client.log
expire_in: 2 weeks
## sara-collect