Skip to content

Commit a026bcc

Browse files
authored
Fix after RC5 (#47)
2 parents 7f00f5b + ce0f5b6 commit a026bcc

File tree

5 files changed

+47
-20
lines changed

5 files changed

+47
-20
lines changed

example/docs/offline_vault_ceremony.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,18 @@ The 📢`organiser` asks all `share holders` (including 👥`team members`) to c
8181
8282
> [!Tip]
8383
> The public key can be checked with the corresponding hardware token plugged in and with the public key imported in gpg.\
84-
> For this, enter the following command:\
85-
> `echo "It works" | gpg -e -f /path/to/public/key.pub | gpg -d`
84+
> For this, enter the following commands with the correct path to the keys :
85+
```
86+
export GPG_HW_TOKEN_KEY_ID=$(gpg --card-status | sed -n -E -e 's/^[^:]*sign[^:]*:[[:blank:]]*((:?[[:xdigit:]]{4}[[:blank:]]*){10})/\1/pi') && echo "$GPG_HW_TOKEN_KEY_ID"
87+
export TMP_GPG_HOME=$(mktemp -d)
88+
cp ~/.gnupg/*.conf "$TMP_GPG_HOME"/
89+
##############
90+
# Configure the next line
91+
##############
92+
gpg --home="$TMP_GPG_HOME" --import /path/to/share_holders_keys/env/*
93+
gpg --home="$TMP_GPG_HOME" --list-keys --keyid-format LONG --with-colons | sed -n -e '/^pub/{n;p}' | sed -n -E 's/^fpr:([^:]*:){8}([^:]*).*$/\2:6:/p' | gpg --home="$TMP_GPG_HOME" --import-ownertrust
94+
echo "It works" | gpg --home="$TMP_GPG_HOME" -e -r "$GPG_HW_TOKEN_KEY_ID" | gpg -d
95+
```
8696

8797
#### Setting up the trusted commit
8898

@@ -111,9 +121,7 @@ Get the last report for the corresponding environment and verify the signatures
111121
A gpg-based one can be found in [the O.R.CA documentation](https://eove.github.io/orca/unstable/signing_and_verifying.html)
112122

113123
> [!Warning]
114-
> All signatures should be valid. The check above should be valid for at least the 3 👥`team members` of the previous ceremony.
115-
>
116-
> Only **one** invalid/missing signature is enough to **stop the ceremony**. In such a case, the issue should be analysed.
124+
> **Any** invalid/missing/incomplete signature is enough to **stop the ceremony**. In such a case, the issue should be analysed.
117125
118126
Once all signatures has been verified, to get ready for subsequent steps, extract from the `previous ceremony report`:
119127
- the `trusted commit` that was used back then (that we will refer to as `previous trusted commit`)
@@ -243,7 +251,7 @@ These 3 persons should be **physically present during the whole ceremony**, and
243251

244252
> [!Tip]
245253
> To extract these sections from the html version of the ceremony's workflow, use the following filter:\
246-
> `cat /path/to/ceremory_workflow.html | sed -e 's|<\([/]\)*code class="language-report">|\n<\1\@ORCA\@report\@>\n|g' | sed -n -e '/<\@ORCA\@report\@>/,/<\/\@ORCA\@report\@>/{s/<[/]*\@ORCA\@report\@>//;p}' | tee /tmp/blank_report.txt`
254+
> `cat /path/to/ceremony_workflow.html | sed -e 's|<\([/]\)*code class="language-report">|\n<\1\@ORCA\@report\@>\n|g' | sed -n -e '/<\@ORCA\@report\@>/,/<\/\@ORCA\@report\@>/{s/<[/]*\@ORCA\@report\@>//;p}' | tee /tmp/blank_report.txt`
247255
248256
3. The third role is the `observer` (👀).\
249257
This person should be [randomly](https://www.random.org/lists/) picked among all share holders except the two other 👥`team members`. The random draw will be performed by either the 💻`operator` or 📝`reporter`.\
@@ -260,6 +268,9 @@ These 3 persons should be **physically present during the whole ceremony**, and
260268
261269
For the rest of the procedure below, you can consider references to 👥`team members` as a synonym for the group of the 3 roles above.
262270

271+
> [!Warning]
272+
> The 👀`observer` will have to access the keyboard to give sudo access during the checks. The other 👥`team members` should be able to keep an eye on the USB stick while not seeing the keyboard at that moment.
273+
263274
> [!Important]
264275
> In the report below, and only when initializing the vault the first time, a few `FAIL`ed items are expected.\
265276
> They are identified with a star in the report like this `FAIL* []`

example/docs/periodical_checks.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ If a word used in this document is unknown to you, the [O.R.CA documentation con
4040
In order to execute the current document, you will need:
4141
* An initialised offline vault
4242
* An initialised and running online vault
43-
* To fulfill all the prerequisites to run an ceremony
43+
* To fulfill all the prerequisites to run a ceremony
4444

4545
## Recurrent checks
4646

@@ -50,7 +50,7 @@ Checks (and fixes) below should be performed first on the preprod environment, t
5050
If fixes are needed, this means running a ceremony on preprod, and then a ceremony on prod.
5151

5252
> [!Warning]
53-
> In order to run scripts on the offline vault, samples files are provided in the `actions` directory. You should adapt these scripts to your need, then commit to git. Only then, will the live bootable media contain the updated version of these scripts.
53+
> In order to run scripts on the offline vault, samples files are provided in the `actions` directory. You should adapt these scripts to your needs, then commit to git. Only then, will the live bootable media contain the updated version of these scripts.
5454
5555
### Hardware token's certificates that have expired should be renewed
5656

@@ -72,7 +72,7 @@ This is especially important because, when initially generating certificates on
7272

7373
#### Test
7474

75-
Hardware token's certificates expire on 30/12 of the year mentioned in their public key filename (as registered in the folder `share_holders/`)
75+
Hardware token's certificates expire on 30/12 of the year mentioned in their public key filename (as registered in the folder `share_holders/`).
7676
If a hardware token certificate is expired when performing this check, then it should be renewed.
7777

7878
The 📢`organiser` should perform this check and ask the relevant share holders to renew their hardware token's GPG key pair.
@@ -93,7 +93,7 @@ An unseal share rotation should be run also on the online vault.
9393

9494
### Every share holder have and can use their hardware token's GPG key
9595

96-
Every share holder should have a hardware token and should have a GPG public key registered in the folder `share_holders/`
96+
Every share holder should have a hardware token and should have a GPG public key registered in the folder `share_holders/`.
9797
These hardware token's GPG keys' details should match their owner's name and e-mail address at the company.
9898

9999
Every share holder runs the following tests.
@@ -175,7 +175,7 @@ The start of validity date will be called *D<sub>start</sub>*, it can be found i
175175
The expiry date will be called *D<sub>expiry</sub>*, it can be found in the `Validity`'s `Not After` attribute displayed by the command above.
176176

177177
The following statement should be true:
178-
*D<sub>start</sub>*<*D<sub>now</sub>* **and** *D<sub>expiry</sub>*>*D<sub>min</sub>*.
178+
*D<sub>start</sub>*<*D<sub>now</sub>* **and** *D<sub>min</sub>*<*D<sub>expiry</sub>*.
179179
If this is the case, this test is a PASS.
180180
If not, a new online CA should be generated, the fix below should be applied.
181181

@@ -286,7 +286,7 @@ exit -42
286286
> This means that, if that script succeeds, you can trust that CSR.
287287
> However, if it fails, then it can either be a wrong CSR **or** a change in vault. Please check accordingly.
288288
289-
Once the check have been performed, a ceremony is executed on the offline CA and the CSR is signed, we should get a certificate chain output PEM file, let's store it into `/tmp/online_cert.pem`.
289+
Once the check has been performed, a ceremony is executed on the offline CA and the CSR is signed, we should get a certificate chain output PEM file, let's store it into `/tmp/online_cert.pem`.
290290
We now have to import that certificate in the **online vault**.
291291

292292
Once this has been done, in order to be sure that the imported certificate corresponds to a CSR generated by the online vault, please make sure that the current **default** issuer ID for the devices PKI has changed from the value you initially wrote down above:
@@ -338,20 +338,20 @@ You have two options there:
338338
- Either the current offline root CA can be rotated (see [Vault's documentation](https://developer.hashicorp.com/vault/tutorials/pki/pki-engine#step-7-rotate-root-ca))\
339339
This requires writing scripts for this to be run on the offline *ephemeral vault*.
340340
- Or you can create a brand new offline root CA.\
341-
This would be a brand new start of the root CA and this means re-initializing a new vault, start from an empty backup etc.\
341+
This would be a brand new start of the root CA and this means re-initialising a new vault, start from an empty backup etc.\
342342
Please read [the documentation on how to setup a new PKI](https://eove.github.io/orca/unstable/pki_init.html).
343343

344344
> [!Note]
345-
> In any case, the old PKI (and offline CAs) are still valid for at least 6 months, so you can use them up to the end of their validity. After their validity has elapsed, the expired CAs should be kept as read-only and won't be used anymore (except if revokation is required).
345+
> In any case, the old PKI (and offline CAs) are still valid for at least 6 months, so you can use them up to the end of their validity. After their validity has elapsed, the expired CAs should be kept as read-only and won't be used anymore (except if revocation is required).
346346
347347
> [!Tip]
348348
> When renewing the root CA, you may as well evaluate the following aspects:
349349
> - is the crypto used for the trust chain still up-to-date or should it be updated?
350350
> - is hashicorp vault and upstream O.R.CA version (used as a template) still up-to-date and maintained, in general and in NixOS or should the PKI be setup using new tools?
351-
> - the environment in which the vault has been created initially has been progressively migrated from an initialization state 30 years before, it's maybe time to clean-up and start from scratch.
351+
> - the environment in which the vault has been created initially has been progressively migrated from an initialisation state 30 years before, it's maybe time to clean-up and start from scratch.
352352
> - restarting from scratch allows to detach the currently active PKI from all history of previously chained reports and audit trails.
353353
> - we may want to start with better security ecosystem (better crypto, improved initialisation in both hashicorp vault and our own scripts) after 30 years, it's probably time to review the whole setup in depth, including scripts, hashicorp vault, tools (hardware tokens, NixOS bootable media), and where and how backups+reports are saved.
354-
> - after 30 years, it would be good to get new people own the whole system, including setup from scratch
354+
> - after 30 years, it would be good to get new people to own the whole system, including setup from scratch
355355
> - you have 6 months...
356356
357357
### The next periodical check is planned

example/orca-config.nix

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
rotate_keys = false;
55
actions_folder = ./actions;
66
share_holder_keys_folder = ./share_holders_keys;
7+
xkb = {
8+
layout = "fr,fr,us";
9+
variant = "oss,bepo,";
10+
};
711
actions_in_order = [
812
#"create-root-CA"
913
#"create-intermediate-CA"

src/orca-nixos-module.nix

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,16 @@
9898
type = types.ints.positive;
9999
default = 3;
100100
};
101+
xkb = {
102+
layout = mkOption {
103+
type = types.str;
104+
default = "us";
105+
};
106+
variant = mkOption {
107+
type = types.str;
108+
default = "";
109+
};
110+
};
101111
actions_folder = mkOption {
102112
type = types.path;
103113
};
@@ -225,11 +235,9 @@ If it should indeed be allowed to run as root, please double check them for secu
225235
autologinUser = orca_user.name;
226236
autologinOnce = true;
227237
};
228-
xserver.xkb = {
229-
layout = "fr,fr,us";
230-
variant = "oss,bepo,";
238+
xserver.xkb = config.orca.xkb // ({
231239
options = "grp:menu_toggle";
232-
};
240+
});
233241
# Configure vault
234242
vault = {
235243
enable = true;

testing/orca-config.nix

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,8 @@
1313
vm = {
1414
root_public_key = ./root_key.pub;
1515
};
16+
xkb = {
17+
layout = "fr,fr,us";
18+
variant = "oss,bepo,";
19+
};
1620
}

0 commit comments

Comments
 (0)