-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathceremony.typ
1639 lines (1293 loc) · 48.3 KB
/
ceremony.typ
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
#import "data.typ": /*
*/ boot_dvd_sha256, /*
*/ git_commit_hash, /*
*/ known_hashes, /*
*/ read_sha256sums, /*
*/
#import "debug.typ": debug_level, debug_text
#import "exception.typ": exception_sheet
#import "model.typ": /*
*/ assert_card, /*
*/ assert_card_reader, /*
*/ assert_card_reader_connected, /*
*/ assert_component_loaded, /*
*/ assert_computer_on, /*
*/ assert_computer_plugged_in, /*
*/ assert_dvd_drive, /*
*/ assert_hsm_installed, /*
*/ assert_hsm_mode, /*
*/ assert_wrist_strap_connected, /*
*/ boot_dvd, /*
*/ boot_dvd_title, /*
*/ realm_dvd, /*
*/ realm_dvd_title, /*
*/ set_card_reader, /*
*/ set_component_loaded, /*
*/ set_wrist_strap_connected, /*
*/ vendor_dvd, /*
*/ vendor_dvd_title, /*
*/
#import "presentation.typ": /*
*/ appendices, /*
*/ bip39_full, /*
*/ bip39_identifying, /*
*/ blank, /*
*/ blank_mac_address, /*
*/ blank_smartcard_id, /*
*/ blanks, /*
*/ ceremony_doc, /*
*/ checkbox, /*
*/ checkbox_symbol, /*
*/ checkboxes,/*
*/ component_demo, /*
*/ entry_array, /*
*/ fill_color, /*
*/ header_fill, /*
*/ hex_identifying, /*
*/ keys, /*
*/ labeled_blank_bag_id, /*
*/ morse_code, /*
*/ outpath, /*
*/ radio, /*
*/ radio_symbol, /*
*/ ref_step, /*
*/ step, /*
*/ steps, /*
*/ todo, /*
*/
#import "routines.typ": *
#show: body => ceremony_doc(
title: "Juicebox Realm Initialization Ceremony",
author: "Juicebox Systems, Inc",
body,
)
This document contains instructions for conducting a key ceremony to initialize
a Juicebox HSM realm.
The source code for this document is available at
#link("https://github.com/juicebox-systems/ceremony")
and identified by the Git commit hash #raw(block: false, git_commit_hash).
Identifying bytes of the SHA-256 hash of the PDF file built from that source
code:
#hex_identifying(bytes: 32)
#block(
width: 50%,
radio[Practice ceremony][Production ceremony]
)
#blanks[Codename][Date][Start time][Location]
#pagebreak(weak: true)
#outline(
indent: auto,
fill: text(
fill: gray,
repeat([.#h(.25em)]),
),
)
= Introduction
The purpose of the ceremony is to create cryptographic keys that may only be
accessed within the trust boundaries of a fixed set of _HSMs_ (Hardware
Security Modules), and only while those HSMs execute a fixed software release.
Additionally, the initialization process will create a single NVRAM file on
each HSM for only the fixed software release to read and write.
One of the cryptographic keys to be generated is an asymmetric key pair used
for encrypted communication with clients. Assuming the private key is indeed
restricted to this software release on these HSMs, clients using the public key
recorded during this ceremony will have certainty that they are communicating
with this software running on the HSMs initialized during this ceremony.
The HSMs used in the ceremony are PCIe expansion cards and thus require a host
computer. The HSMs, software, and ceremony are designed so that secrets are
never accessible to the host computer. However, the security of the realm
depends on the host computer making the correct management requests to the HSMs
and presenting the expected HSM software build to the first HSM to be signed.
The ceremony will use a brand new computer that is never connected to a
network.
The computer's factory Windows OS will be used to verify the hashes of a
publicly auditable #emph(boot_dvd), as well as a vendor-proprietary
#emph(vendor_dvd). Then, the Linux OS on the #boot_dvd will be used for the
main ceremony. See @state_appendix for details on the DVDs and state
management.
Each HSM has an external port for a smartcard reader/writer. The HSMs read and
write secret keys onto smartcards for administrative operations. The ceremony
will utilize two smartcards, referred to as _ACS_ and _OCS_. The smartcards
must be used only as prescribed and must be destroyed during the ceremony.
The ceremony will involve setting up a computer, then using the first HSM to
initialize a _Security World_, write to two smartcards, sign the software, and
create the realm keys. The OCS smartcard will be destroyed after it is used to
sign the software. The keys reside in encrypted form on the host filesystem
(protected by keys that reside on the HSMs and smartcards). As that filesystem
is in volatile memory, the signed software and keys will be burned to a
#emph(realm_dvd) to be accessed later, both during the ceremony and after the
ceremony to set up the production environment.
After completing the Security World and realm initialization process on the
first HSM, the HSM will be reset. Then, each of the five HSMs (including the
first) will be enrolled in the Security World and have its NVRAM file
initialized. After the final HSM has been initialized, the ACS smartcard will
be destroyed.
= Procedures
The following roles are defined for participants of the ceremony:
- The _MC_ introduces the event, keeps it moving, and is the final decision
maker for any exceptions, as explained below.
- The _operator_ executes the steps as instructed in this document. The
operator should be the only person to approach or access the computer, HSMs,
and smartcards during the ceremony. The operator's copy of this document is
the official record.
- Any number of _witnesses_ observe the ceremony.
A small number of other non-participants may also be present for (parts of) the
ceremony, for example to record video.
If, at any point, the instructions are ambiguous, contain an error, fail to
instruct the operator in a particular situation, or must be deviated from, the
operator should write "exception" in the margin and fill out an _exception
sheet_. Several sheets are included at the end of this document
(@exception_sheet_1 through @exception_sheet_5). The participants may then
discuss concerns and options, but the MC ultimately decides how to proceed.
In this document, a checkbox (#checkbox_symbol) denotes a confirmation step
that is not optional. If the operator is unable to meet the requirements to
check a checkbox, that's an exception. A circle (#radio_symbol) is used when
exactly one of multiple mutually exclusive options is required.
The following conventions apply to dates and times hand-written into this
document, unless instructed or annotated otherwise:
- Dates and times should reflect the local time zone.
- Dates should be written as `YYYY-MM-DD`.
- Times should be written as `HH:MM` (24-hour local time with minute
precision).
- The operator's source of time should be the analog clock visible to all
participants.
The ceremony is expected to take about 6 hours. The ceremony instructions
include one break at #ref_step(<intermission>), about halfway through, allowing
(and requiring) the participants to leave the room. If any of the participants
need to leave the room at other times, that should be handled as an exception.
= Participants
#block(
breakable: false,
[
This document is filled out by the following person:
#blanks[Name][Affiliation]
]
)
#v(1em)
#block(
breakable: false,
[
Ceremony participants:
#block(
inset: (x: 2em),
[
#set text(size: 0.9em, weight: "bold")
Do not initial until the completion of the ceremony. By initialing in
this table, you agree that:
- You were present for the entire ceremony (excluding breaks).
- To the best of your knowledge, the instructions in this document were
followed correctly (except as noted elsewhere in this document) and
without deception.
- To the best of your knowledge, this document is a true and accurate
record.
If you do not agree, write "do not agree" instead of your initials and
record an explanation.
]
)
#table(
columns: (auto, 1fr, 1fr, 1in),
align: (center, center, center),
fill: header_fill,
[*Role*], [*Name*], [*Affiliation*],
[*Initials* \ (see above)],
[MC], [], [], [],
[Operator], [], [], [],
..range(10).map(i =>
([Witness], [], [], [])
).flatten()
)
]
)
= Getting Started
== Materials <materials>
#steps(
step(time: "1m", [
Inspect the operator and the environment.
#checkbox[
There is a prominent analog clock with a second hand.
]
#checkbox[
The witnesses confirm that the clock is set to the current local time.
]
#checkbox[
There are two outlets available on the wall or a power strip nearby.
]
]),
step(time: "5m", [
Inspect the materials available to the operator.
#checkbox[
The materials below are available and do not appear tampered with.
]
#checkbox[No other materials are available to the operator.]
]),
)
#let computer_brand = "Lenovo"
#let computer_model = "90T2000SUS"
#checkboxes(
title: [Materials],
[1 antistatic wrist strap],
[1 pair of scissors],
[1 Phillips screwdriver],
[1 rotary tool (to sand through smartcards)],
[1 table number holder (to display smartcards prominently when not in use)],
[2 printouts of this document],
[1 permanent marker],
[1 roll of masking tape],
[
// The ProAmpac GCS9012 tamper-evident bags insist on ballpoint pens.
2 blue ballpoint pens
],
[2 bottles of water],
[2 juice boxes (preferably apple)],
[
1 sealed pack of 100 tamper-evident bags (ProAmpac GCS0912)
// We need these to be secure, with sequential IDs, and large enough to
// fit HSMs, card readers, or this printed document.
//
// The Root DNSSEC KCK Ceremony 50 script declares these bags acceptable:
// AMPAC:
// - GCS1013 (may be discontinued?).
// - GCS0912 (appears to be the ProAmpac Valut Bundle Federal Compliant
// Bags, 9.75x12 size, clear, single-pocket).
// - GCS1216 (appears to be the ProAmpac Valut Bundle Federal Compliant
// Bags, 12.75x16 size, clear, single-pocket).
// MMF Industries (no direct web presence?):
// - 2362010N20
// - 2362011N20
//
// Diego received a sample of ProAmpac GCS0912 bags and determined that
// they are large enough for a smartcard reader and just large enough to
// hold a stack of letter-sized sheets of paper.
],
[1 pre-burned and finalized #boot_dvd],
[1 pre-burned and finalized #vendor_dvd],
[1 sealed spindle of blank DVD-Rs (for the #realm_dvd)],
[
1 computer (#computer_brand #computer_model, including a DVD burner and
keyboard, with the outer box sealed by the purchaser with tamper-evident
tape)
],
[
1 VGA video projector (limited to a low resolution so the text is visible
to all participants)
],
[
1 sealed pack of 10 Entrust smartcards
#v(0.3in) // layout hack
],
[At least 5 of the following Entrust HSMs:
#let hsm_row(sn, esn, packaging) = (
raw(sn, block: false),
raw(esn, block: false),
packaging,
radio_symbol,
radio_symbol,
[\##raw("____")],
)
#table(
columns: 6,
align: center,
fill: header_fill,
[*Serial Number*], [*ESN*], [*Packaging*], [*Present*], [*Absent*], [*Used As*],
..hsm_row("46-X19834", "A114-05E0-D947", [#todo[Bag ID]]),
..hsm_row("46-X20349", "B216-05E0-D947", [#todo[Bag ID]]),
..hsm_row("46-X20517", "3B17-05E0-D947", [#todo[Bag ID]]),
..hsm_row("46-X21267", "341A-05E0-D947", [Factory]),
..hsm_row("46-X21271", "351A-05E0-D947", [Factory]),
..hsm_row("46-X21323", "611A-05E0-D947", [Factory]),
)
The first HSM used in the ceremony should be in factory packaging, which
includes a smartcard reader. Fill in the "Used As" column as you unpack the
HSMs ("\#1", "\#2", etc). The serial number sometimes contains an
additional character after the space (likely `A`), not included here.
],
)
== Set Up the Computer <set_up_computer>
#steps(
step(label: <inspect_computer_packaging>, time: "5m", [
Inspect the computer packaging:
#checkbox[The box does not appear tampered with.]
#checkbox[
The box ends are sealed with customer-applied tamper-evident tape,
on top of somewhat loose #(computer_brand)-branded tape.
]
Inspect the #computer_brand sticker:
- #checkbox[
The model (#outpath[`(31P) M/T Model`]) is
#raw(block: false, computer_model).
]
- Serial Number #outpath[`S(SN)`]:
#entry_array("char", 8, 8)
- Wi-Fi MAC address (#outpath[`WMAC`]):
#blank_mac_address
- #blank[#outpath[`Mfg Date`] (as printed)]
Inspect the shipping sticker(s):
- #blank[#outpath[`SHIP DATE`] (as printed)]
]),
step(time: "4m30s", [
Open the computer box from the top with scissors.
*Outer Box:*
- Remove the small box containing the mouse and power cord from the outer
box.
- Remove the long box containing the keyboard from the outer box.
- Remove the computer, sandwiched by two large pieces of foam, from the
outer box.
- Put away the outer box.
*Desktop:*
- Remove the foam from the desktop, and put away the foam.
- Remove the plastic bag surrounding the desktop (which is not sealed), and
put away the bag.
*Keyboard Box:*
- Open the keyboard box.
- Remove the keyboard from its surrounding plastic (which is not sealed).
- Inspect the keyboard and the label under it.
#blank[Date on label under keyboard (#outpath[`MFG`], as shown)]
- Remove the twist tie on the keyboard's USB cable.
- Put away the keyboard box, plastic bag, and twist tie.
*Mouse and Power Cord Box:*
- Open the mouse and power cord box.
- Remove the power cable from the box.
- Remove the twist tie and plug cover on the power cable, and put away the
tie and cover.
- Remove the mouse (still in a plastic bag) and paperwork from the box,
place them into a tamper-evident bag, and put away the bag. (We don't
expect to need the mouse during this ceremony.)
#labeled_blank_bag_id
- Retain the empty box to prop up the DVD drive later.
#checkbox[The box contents did not appear tampered with or used.]
]),
step(time: "3m", [
Inspect the computer case. Set it down on its right side to inspect the
label on the bottom.
#checkbox[The case does not appear tampered with.]
#checkbox[A Windows sticker is present on the left side panel.]
#checkbox[An Intel Core i5 sticker is present on the front panel.]
#checkbox[
The serial number matches the label on the box
(#ref_step(<inspect_computer_packaging>)).
]
#checkbox[
The manufacturing date (#outpath[`Mfg Date`]) matches the label on the
box (#ref_step(<inspect_computer_packaging>)).
]
]),
step(time: "2m30s", [
Remove the left panel of the case and the front panel:
- Unscrew the two screws holding the left panel in place using the
screwdriver.
- Remove the left panel, and put it away.
- Ground yourself to the unpainted computer chassis with the antistatic
wrist strap. It can be worn on your upper arm or ankle.
- Lift up on the three plastic tabs (top, middle, bottom) to get the left
side of the front panel off.
- Wiggle the front panel off, and put it away.
#checkbox[
The power supply's wattage rating (labeled as
#outpath[`Total output continuous shall not exceed`]) is 260 W.
]
#set_wrist_strap_connected(true)
]),
step(time: "2m30s", [
Remove the SATA drive shelf:
- Brace the DVD drive and press the black and red tab towards the front of
the computer release it. Note: it may eject forcefully.
- Unplug the SATA and power cables from the back of the DVD drive.
- Set the DVD drive nearby on top of the box that the mouse and power cable
came in (since the cables are too short to set the drive down on the
table).
- Unplug the SATA and power cables from the 3.5" hard drive.
- Pull up on the silver and red tab (on the front, left side, middle) to
release the SATA drive shelf.
- Wiggle the SATA drive shelf off (with the 3.5" hard drive attached),
and put away the drive shelf.
- Plug the SATA and power cables back into the DVD drive.
]),
step(time: "3m30s", [
Remove the wireless card and antennas:
- Pull up forcefully on the plastic pin holding the wireless card in place
(near where the DC cables come out of the power supply).
- Remove a small bit of clear plastic that the pin was on.
- Remove the wireless card from the slot.
- Gently pry the two antenna cables from the wireless card.
- Pull forcefully on the front antenna to overcome the adhesive,
then remove any tape holding the cable and pull the cable through.
- Remove the plastic antenna cover on the back of the case by pushing the
tab on top (near the case fan) and wiggling the cover off.
- Pull forcefully on the rear antennas to overcome the adhesive,
then remove any tape holding the cable and pull the cable through.
#checkbox[
The Wi-Fi MAC address (#outpath[`WFM`]) on the wireless card's label
matches the label on the computer box
(#ref_step(<inspect_computer_packaging>)).
]
Place the wireless card, antennas, and plastic bits into a tamper-evident
bag for storage.
#labeled_blank_bag_id
]),
step(time: "1m", [
Prepare the PCIe x16 slot:
- Pull up on the silver and red tab above the placeholder brackets near the
PCIe slots to open the flap.
- Remove the metal placeholder bracket blocking the PCIe x16 slot and put
it away.
- Close the metal flap.
]),
step(time: "3m", [
Open the projector packaging, and put away the packaging.
#checkbox[The packaging does not appear tampered with.]
#checkbox[The projector does not appear tampered with.]
]),
step(time: "30s", [
Plug in the projector power and turn on the projector.
]),
step(time: "30s", [
Plug the USB keyboard and VGA projector into the computer.
]),
boot_into_windows(),
step(time: "1m", [
When the Windows "Out of Box Experience" prompts for input (asking for your
country or region):
- Press #keys(("Shift", "F10")) to open a terminal. (Do not use the
terminal. Opening it switches focus, which enables more hotkeys.)
- Press #keys(("Win", "r")) to open a Run dialog.
- Run `powershell`.
- Press #keys(("Win", "Up")) to maximize the Powershell window.
]),
load_dvd(boot_dvd),
step(time: "1m30s", [
Calculate the SHA-256 hash of the #boot_dvd image.
```powershell
$s = [system.io.file]::open('\\.\e:', 'open', 'read', 'read')
get-filehash -inputstream $s
$s.close()
```
The `get-filehash` command should take about 1 minute.
// This displays 3 column headers and one row:
// Algorithm: SHA256
// Hash: 64 hex characters (uppercase)
// Path: empty
#checkbox[
The #boot_dvd's SHA-256 digest matches
#raw(block: false, boot_dvd_sha256).
]
]),
step(time: "3m", [
Copy the main filesystem image and a small script from the #boot_dvd onto
the NVMe drive.
```powershell
dir
cp -verbose e:\live\filesystem.squashfs
cp -verbose e:\entrust.ps1
dir
```
This will copy the files into `C:\Users\defaultuser0\`. The first copy
command should take about 2 minutes, and the second one should take up to a
few seconds.
]),
load_dvd(vendor_dvd),
step(time: "10m", [
Copy the Entrust-provided files from the #vendor_dvd onto the NVMe drive.
```powershell
cat entrust.ps1
set-executionpolicy -scope process unrestricted
.\entrust.ps1
dir
```
Enter #keys("Y") for yes when setting the policy.
The script verifies the hashes of the files and copies them into
`C:\Users\defaultuser0\`. It should take about 10 minutes. During this
time, review @state_appendix, which discusses the various DVDs and files.
]),
load_dvd(boot_dvd),
power_off(os: "windows"),
boot_into_dvd(uefi_setup: true),
step(time: "2m", [
Display some information about the computer's devices:
```sh
lsblk
lsusb
lspci | nl
```
#checkbox[
`lsblk` reports `loop0` (loopback devices), `sr0` (the DVD drive),
`nvme0n1` with 4 partitions (the Windows disk), and no other block
devices.
]
#checkbox[
`lsusb` reports a "3.0 root hub", a "2.0 root hub", a "Lenovo New
Calliope USB Keyboard", and no other USB devices.
]
#checkbox[
`lspci` reports 24 devices: 22 from Intel, a "Non-Volatile memory
controller" from Samsung Electronics, and an "Ethernet controller" from
Realtek Semiconductor.
]
]),
power_off(),
)
= Realm Creation <realm_creation>
== Prepare the First HSM
#steps(
unpack_hsm(first: true),
boot_into_dvd(),
initialize_hsm(0),
)
== Unpack the Smartcards
#steps(
step(time: "30s", [
Inspect the smartcard packaging.
#checkbox[The packaging does not appear tampered with.]
]),
step(time: "1m", [
Open the smartcard packaging. Take out two cards, and put the rest in a
tamper-evident bag.
#labeled_blank_bag_id
]),
step(time: "1m20s", [
Inspect the first smartcard. Label it "OCS".
#checkbox[The smartcard does not appear tampered with.]
#checkbox[The smartcard has nShield and Entrust trademarks.]
Smartcard ID:
#blank_smartcard_id
]),
step(label: <acs_id>, time: "1m20s", [
Inspect the second smartcard. Label it "ACS".
#checkbox[The smartcard does not appear tampered with.]
#checkbox[The smartcard has nShield and Entrust trademarks.]
Smartcard ID:
#blank_smartcard_id
]),
step(time: "2m", [
Ask a few witnesses to choose a distinctive character or shape, and draw
these on the cards.
]),
step(time: "15s", [
Place the ACS smartcard in the card reader and place the OCS smartcard
visibly in the stand.
#set_card_reader(from: none, to: "ACS")
]),
)
== Create the Security World and Sign the Software
#steps(
step(label: <create_world>, time: "2m", [
Create the HSM Security World, enroll the first HSM in it, and write to the
ACS smartcard. Enter an empty passphrase when prompted.
```sh
ceremony hsm create-world
```
Identifying bytes of `KNSO` hash (#outpath[`hknso`]):
#hex_identifying(bytes: 20)
This command takes about 45 seconds. It writes to the ACS smartcard and
creates encrypted keys on the computer's filesystem.
#assert_card("ACS")
#assert_hsm_mode("initialization")
#assert_component_loaded("secworld", true)
]),
step(label: <display_hkmsw>, time: "1m", [
Display information about the Security World:
```sh
ceremony hsm world-info
```
Identifying bytes of `KMSW` Security World key hash
(#outpath[`World`][`hkm`]):
#hex_identifying(bytes: 20)
#assert_component_loaded("secworld", true)
]),
restart_hsm("operational"),
step(time: "10s", [
Remove the ACS smartcard from the card reader. Place the OCS smartcard in
the card reader and place the ACS smartcard visibly in the stand.
#set_card_reader(from: "ACS", to: "OCS")
]),
step(time: "20s", [
Write to the OCS smartcard. Enter an empty passphrase when prompted.
```sh
ceremony smartcard write-ocs
```
This command should take about 12 seconds.
#assert_hsm_mode("operational")
#assert_card("OCS")
#assert_component_loaded("secworld", true)
]),
step(time: "10s", [
Create a signing key:
```sh
ceremony sign create-key
```
This command should take about 6 seconds. It writes an encrypted key to the
host computer's filesystem.
#assert_card("OCS")
#assert_hsm_mode("operational")
#assert_component_loaded("secworld", true)
]),
step(label: <signing_key_hash>, time: "1m", [
Display information about the signing key:
```sh
ceremony sign key-info
```
Identifying bytes of signing key hash
(#outpath[`Key AppName seeinteg Ident jbox-signer`][`hash`]):
#hex_identifying(bytes: 20)
#assert_component_loaded("secworld", true)
]),
install_codesafe(),
step(time: "40s", [
Build the `entrust_init` tool:
```sh
ceremony build init
```
This command should take about 30 seconds.
#checkbox[
The SHA-256 hash of `entrust_init` encoded as a BIP-39 mnemonic matches:
#bip39_full(bytes: 32, phrase: known_hashes.at("entrust_init_bip39"))
]
#assert_component_loaded("codesafe", true)
#set_component_loaded("entrust_init", true)
]),
step(time: "40s", [
Build the HSM software:
```sh
ceremony build hsm
```
This command should take about 30 seconds.
#checkbox[
Identifying words of the BIP-39 mnemonic encoding of the SHA-256 hash of
`entrust_hsm.elf` match:
#bip39_identifying(
bytes: 32,
phrase: known_hashes.at("entrust_hsm_elf_bip39"),
)
The full mnemonic is checked in the next step when this software is
signed.
]
#assert_component_loaded("codesafe", true)
]),
step(time: "1m", [
Sign the HSM software:
```sh
ceremony sign software
```
This command should take about 2 seconds. It requires the OCS smartcard. It
reads an ELF-format executable from the host computer's filesystem and
writes a signed version of that back to the host computer's filesystem.
#checkbox[
The SHA-256 hash of the input file (`entrust_hsm.elf`) encoded as a
BIP-39 mnemonic matches:
#bip39_full(bytes: 32, phrase: known_hashes.at("entrust_hsm_elf_bip39"))
]
Identifying words of the BIP-39 mnemonic encoding of the SHA-256 hash of
the signed file (`entrust_hsm.sar`):
#bip39_identifying(bytes: 32)
#assert_card("OCS")
#assert_component_loaded("secworld", true)
]),
step(time: "1m", [
Sign the HSM userdata:
```sh
ceremony sign userdata
```
This command should take about 1 second. It requires the OCS smartcard. It
reads the string `dummy` from the host computer's filesystem (the content
is ignored) and writes a signed version of that back to the host computer's
filesystem.
#checkbox[
The input file (`userdata.dummy`) SHA-256 hash encoded as a BIP-39
mnemonic matches:
#bip39_full(
bytes: 32,
// ceremony bip39 encode $(echo -n dummy | sha256sum | cut -d' ' -f1)
phrase: "
remember bind flat patch
banana recall possible tourist
width cycle fringe next
visa people private ready
price tree comic glow
together print annual cash
",
)
]
Identifying words of the BIP-39 mnemonic encoding of the SHA-256 hash of
the signed file (`userdata.sar`):
#bip39_identifying(bytes: 32)
#assert_card("OCS")
#assert_component_loaded("secworld", true)
#set_component_loaded("sar_files", true)
]),
)
== Destroy the OCS Smartcard
#steps(
destroy("OCS")
)
== Create the Realm Keys
#steps(
step(time: "3m", [
Generate the realm keys:
```sh
ceremony realm create-keys
```
Each key's ACL is the same, except for identifiers, having three permission
groups:
- Permission Group 1 allows reading the ACL itself and allows the key to be
duplicated with the same ACL. It should look like:
```
Action: OpPermissions: DuplicateHandle, GetACL
```
- Permission Group 2 allows HSM software signed with the signing key to
read the key (and associated data, which is not used). It should look
like:
```
Requires Cert: hash: ❰SIGNING-KEY-HASH❱ mechanism: Any
Flags: certmech_present
Action: OpPermissions: ExportAsPlain, GetAppData
```
- Permission Group 3 allows the key to be saved as a blob on the host
filesystem, encrypted by the Security World key (`KMSW`), only once. It
should look like (in two lines, wrapped here):
```
Use Limit: Global: max: 1 id: ❰VARYING-40-HEX-CHARS❱
Action: MakeBlob: Flags: AllowKmOnly, AllowNonKm0, kmhash_present kmhash: ❰KMSW-HASH❱
```
#checkbox[
#outpath[`Creating key simple,jbox-mac`...][`Permission Group 2`][`Requires Cert`][`hash`]
matches the signing key hash in #ref_step(<signing_key_hash>).
]
#checkbox[
#outpath[`Creating key simple,jbox-mac`...][`Permission Group 3`][`Action`][`kmhash`]
matches the Security World key hash in #ref_step(<display_hkmsw>).
]
#checkbox[
#outpath[`Creating key simple,jbox-record`...][`Permission Group 2`][`Requires Cert`][`hash`]
shows the same value as the `jbox-mac` permissions.
]
#checkbox[
#outpath[`Creating key simple,jbox-record`...][`Permission Group 3`][`Action`][`kmhash`]
shows the same value as the `jbox-mac` permissions.
]
#checkbox[
#outpath[`Creating key simple,jbox-noise`...][`Permission Group 2`][`Requires Cert`][`hash`]
shows the same value as the `jbox-mac` permissions.
]
#checkbox[
#outpath[`Creating key simple,jbox-noise`...][`Permission Group 3`][`Action`][`kmhash`]
shows the same value as the `jbox-mac` permissions.
]
// Note: does not require smartcard.
#assert_component_loaded("entrust_init", true)
#set_component_loaded("simple_keys", true)
]),
step(time: "1m", [
Verify the ACL on each key no longer allows creating a key blob:
```sh
ceremony realm print-acl mac
ceremony realm print-acl record
ceremony realm print-acl noise
```
#checkbox[
`Permission Group 3` is no longer present for the `jbox-mac` key.
]
#checkbox[
`Permission Group 3` is no longer present for the `jbox-record` key.
]
#checkbox[
`Permission Group 3` is no longer present for the `jbox-noise` key.
]
// Note: does not require smartcard.
#assert_component_loaded("entrust_init", true)
#assert_component_loaded("simple_keys", true)
]),
step(time: "3m", [
Record the public key that clients will use to authenticate this realm.
```sh
ceremony realm noise-public-key
```