From 26103217c8074dba85330905ee7d4fae4127fb6f Mon Sep 17 00:00:00 2001 From: Dominik Roos Date: Thu, 19 Sep 2024 21:31:31 +0200 Subject: [PATCH] docs: add interactive TRC signing ceremony builder (#4624) And an interactive TRC signing ceremony builder. It supports all three types of TRC ceremony: base, regular, and sensitive. The user can select between scion-pki and openssl. Furthermore, support for pkcs11 is available for openssl. In a future iteration, support for scion-pki kms will be added. The builder is intended to be used by a voting (or root CA) participant. The adminstrator role is not supported in this version. (Administrators should be very knowledgable about the TRC ceremony anyway.) The builder is based on aplinejs and tailwindcss. This allows us to included it in our RTD page with zero dependency and build steps. ![image](https://github.com/user-attachments/assets/e02dc043-7233-4713-8267-fa67ce489b2d) [doc] --- doc/Makefile | 3 +- doc/conf.py | 5 + doc/cryptography/index.rst | 1 + .../trc-signing-ceremony-builder.rst | 1020 +++++++++++++++++ tools/cryptoplayground/crypto_lib.sh | 2 +- tools/cryptoplayground/trc_ceremony.sh | 2 +- 6 files changed, 1030 insertions(+), 3 deletions(-) create mode 100644 doc/cryptography/trc-signing-ceremony-builder.rst diff --git a/doc/Makefile b/doc/Makefile index 92fe92a6fa..4da3aebaeb 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -13,6 +13,7 @@ SPHINX_AUTOBUILD ?= bazel run //doc:sphinx-autobuild -- SPHINXOPTS ?= -W --keep-going # treat warnings as errors, but process all files when an error occurs SOURCEDIR = $(abspath .) BUILDDIR = $(abspath ./_build) +HOST ?= localhost # Build docs with Sphinx using the "make mode" option. # Explicitly list the main build targets so they auto-complete in shells. @@ -30,7 +31,7 @@ html latex latexpdf linkcheck help: # Note: most options are forwarded as-is to sphinx, but --keep-going is not understood and we explicitly drop it. .PHONY: autobuild autobuild: - $(SPHINX_AUTOBUILD) "$(SOURCEDIR)" "$(BUILDDIR)" $(filter-out --keep-going,$(SPHINXOPTS)) + $(SPHINX_AUTOBUILD) "--host=$(HOST)" "$(SOURCEDIR)" "$(BUILDDIR)" $(filter-out --keep-going,$(SPHINXOPTS)) .PHONY: clean clean: diff --git a/doc/conf.py b/doc/conf.py index a3532826b2..62230146ea 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -106,3 +106,8 @@ html_css_files = [ "css/custom.css", ] + +html_js_files = [ + "https://unpkg.com/@alpinejs/persist@3.14.1/dist/cdn.min.js", + "https://unpkg.com/alpinejs@3.14.1/dist/cdn.min.js", +] diff --git a/doc/cryptography/index.rst b/doc/cryptography/index.rst index 4945e66f1a..711a58b477 100644 --- a/doc/cryptography/index.rst +++ b/doc/cryptography/index.rst @@ -11,6 +11,7 @@ SCION Cryptography trc-signing-ceremony-preparations trc-signing-ceremony-phases-base trc-signing-ceremony-phases-sensitive + trc-signing-ceremony-builder ca-operations interactions drkey diff --git a/doc/cryptography/trc-signing-ceremony-builder.rst b/doc/cryptography/trc-signing-ceremony-builder.rst new file mode 100644 index 0000000000..d009955111 --- /dev/null +++ b/doc/cryptography/trc-signing-ceremony-builder.rst @@ -0,0 +1,1020 @@ +.. _trc-signing-ceremony-builder: + +.. raw:: html + + + + + +.. raw:: html + + + +
+ + +
+

TRC Ceremony Builder

+ +
+

TRC

+ + + + + + + + + + + + + + + + + + + +
Ceremony Type + +
ISD + +
ISD required
+
Base Number + +
Serial Number + +
+
+ + +
+

Actions

+ + + + + + + + + + + + + + + + + + + + + + + + + +
SelectAction
+ + New sensitive voting certificate
+ + New regular voting certificate
+ + New root certificate
+ + Cast a vote
+
+ + +
+

General Settings

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Working Directory + +
Signing Tool + +
Short ID + +
Short Identifier required
+
Exchange Mechanism + +
Shared Drive + +
Skip Preparation + +
Skip Certificate Exchange + +
Show Expected Output Hints + +
+
+ + +
+

Certificate Subject

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
ISD-AS + +
ISD-AS required
+
Country + +
State + +
Locality + +
Organization + +
Organizational Unit + +
+
+ + + + + + + + + + +
+ + +
+
+ + + + + + + + + + + +
+
+

Phase 2: Creation of Payload

+
+ Follow the instructions of the TRC ceremony adminstrator to + receive the TRC payload. +
+
+ + + + + +
+

2. Check TRC Payload

+
sha256sum
+ + +
+ +
+

3. Inspect TRC Payload

+
scion-pki trc inspect
+ + +
+
+ + +
+
+

Phase 3: Signing of the TRC Payload

+
+ Follow the instructions of the TRC ceremony adminstrator and + create the required signatures. +
+
+ + + + + + + + +
+ + +
+
+

Phase 4: Assembly of the TRC

+
+ Follow the instructions of the TRC ceremony adminstrator to + recieve the signed TRC. This step concludes the ceremony. +
+
+ + + + + +
+

2. Check TRC

+
sha256sum .trc
+ + +
+ +
+

3. Inspect TRC

+
scion-pki trc inspect --predecessor
+ + +
+ +
+

4. Format TRC

+
+ The output of the TRC ceremony is a DER encoded TRC. To convert + it to a more ergonomic PEM format, use the following command. +
+
scion-pki trc format --format pem
+ + +
+
+ +
+ diff --git a/tools/cryptoplayground/crypto_lib.sh b/tools/cryptoplayground/crypto_lib.sh index de3f7917f9..01e225acef 100644 --- a/tools/cryptoplayground/crypto_lib.sh +++ b/tools/cryptoplayground/crypto_lib.sh @@ -92,7 +92,7 @@ in_docker() { -e TRCID=$TRCID \ -e PREDID=$PREDID \ nginx:1.27.1 \ - sh -c "set -e && . /scripts/crypto_lib.sh && $@" + sh -c "set -ex && . /scripts/crypto_lib.sh && $@" } ###################### diff --git a/tools/cryptoplayground/trc_ceremony.sh b/tools/cryptoplayground/trc_ceremony.sh index 7d3e8bd265..6415707094 100755 --- a/tools/cryptoplayground/trc_ceremony.sh +++ b/tools/cryptoplayground/trc_ceremony.sh @@ -12,7 +12,7 @@ export USE_SCION_PKI_SIGN=${USE_SCION_PKI_SIGN:-} . $PLAYGROUND/crypto_lib.sh -set -e +set -ex if [ -z "$USE_SCION_PKI_SIGN" ]; then STARTDATE="20200624120000Z"