You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.keyceremony-shared-interactive.md
+118
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,8 @@ This is an example runbook for an interactive key ceremony using Secret Sharing.
3
3
4
4
2013-12-16 Martin Bartosch
5
5
6
+
# Creation of a secret share set and CA initialization
7
+
6
8
Assumptions:
7
9
2048 Bit RSA key protected by a 128 Bit random pass phrase.
8
10
The pass phrase is split into 5 shares, of which 3 will be needed to perform CA operations.
@@ -52,3 +54,119 @@ cd dummyca
52
54
53
55
```
54
56
57
+
58
+
59
+
## Replacing a secret share set
60
+
61
+
If a share gets lost or if the existing quorum should be changed to a different one, it is possible to recreate the secret share set with a completely different secret share set, replacing the old share set.
62
+
63
+
This is done be decrypting the private key with the old quorum and re-encrypting the key with a newly created quorum, thus also changing the underlying passphrase.
64
+
65
+
Please note that the old private key file with the old share set will still be sufficient to unlock the private key, so make sure to destroy the old set and key once it has been verified that the new share set works.
66
+
67
+
The following procedure (also available as bin/change-quorum.sh) can be applied to perform this task.
68
+
69
+
Please note that you need to edit the script to adapt old and new quorum parameters. The script will fail if these parameters are not correct.
70
+
71
+
```bash
72
+
#!/bin/bash -e
73
+
#
74
+
# 2019-12 Martin Bartosch
75
+
# This script can assist CA Administrators in recreating a secret sharing
76
+
# quorum.
77
+
78
+
# specify old (existing) quorum
79
+
K_OLD=3
80
+
N_OLD=5
81
+
82
+
# new quorum, default: identical to old quorum
83
+
K_NEW=$K_OLD
84
+
N_NEW=$N_OLD
85
+
86
+
KEY_OLD="$1"
87
+
KEY_NEW="$2"
88
+
89
+
if [ -z"$KEY_NEW" ] ;then
90
+
cat <<EOF
91
+
Usage:
92
+
$0 OLD_KEY_FILE NEW_KEY_FILE
93
+
94
+
This script will recreate a share set and write a copy of the existing
95
+
private key KEY_OLD_FILE to the file KEY_NEW_FILE.
96
+
The script will not overwrite KEY_NEW_FILE if the file already exists.
97
+
The private key in KEY_NEW_FILE will be identical to KEY_OLD_FILE but it will
98
+
be encrypted with a different random passphrase determined by the new
99
+
quorum.
100
+
After verifying that KEY_NEW_FILE can be used with the newly created quorum
101
+
it can be used instead of KEY_OLD_FILE.
102
+
103
+
Assumptions:
104
+
- the existing quorum and the new quorum are defined in this script
105
+
(edit below settings to reflect the actual setup)
106
+
- the existing private key is protected with the old quorum
107
+
108
+
EOF
109
+
exit 0
110
+
fi
111
+
112
+
# assert that secret is in $PATH
113
+
type secret
114
+
type openssl
115
+
116
+
if [ !-r"$KEY_OLD" ] ;then
117
+
echo"Old key $KEY_OLD not readable."
118
+
exit 1
119
+
fi
120
+
if [ -e"$KEY_NEW" ] ;then
121
+
echo"New key $KEY_NEW already exists, refusing to overwrite."
122
+
exit 1
123
+
fi
124
+
125
+
126
+
echo"Recreating secret key sharing quorum"
127
+
echo"Old quorum:"
128
+
echo"k = $K_OLD"
129
+
echo"n = $N_OLD"
130
+
echo"New quorum:"
131
+
echo"k = $K_NEW"
132
+
echo"n = $N_NEW"
133
+
134
+
echo
135
+
echo"Unlocking old $K_OLD/$N_OLD quorum (press RETURN)"
136
+
read
137
+
138
+
export PASSPHRASE=""
139
+
eval`secret get --k $K_OLD --n $N_OLD`
140
+
141
+
if [ $?!= 0 ] ;then
142
+
echo"Error unlocking old quorum."
143
+
exit 1
144
+
fi
145
+
146
+
if [ -z"$PASSPHRASE" ] ;then
147
+
echo"Could not unlock old quorum."
148
+
exit 1
149
+
fi
150
+
151
+
export PASSPHRASE_OLD="$PASSPHRASE"
152
+
153
+
clear
154
+
echo
155
+
echo"Creating new $K_NEW/$N_NEW quorum (press RETURN)"
0 commit comments