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: CHANGELOG.md
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,6 +48,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
48
48
### Changed
49
49
50
50
- Improved `ccf::historical::verify_self_issued_receipt` - now can verify receipts signed by the past service identities if they were back-endorsed (#7546).
51
+
- Local sealing recovery now stores sealed secrets in the ledger instead of separately on disk. (#7554)
52
+
- To configure this use `enable_local_sealing` (top-level) and `command.recover.previous_local_sealing_identity` in the configuration.
53
+
- The configuration options `output_files.sealed_ledger_secret_location` and `command.recover.previous_sealed_ledger_secret_location` have been deprecated and are ignored.
54
+
- Recovery keys are now stored in `public:ccf.gov.nodes.sealed_recovery_keys` and encrypted shares in `public:ccf.internal.sealed_shares`.
55
+
- There is an update in the constitution to reseal whenever a node is added, this ensures that as soon as a node is trusted, it can recover from that point in the ledger.
**Key** Node ID: SHA-256 digest of the node public key, represented as a hex-encoded string.
225
+
226
+
**Value** Sealed recovery key for the node. The private key is encrypted using a key derived from SNP's ``DERIVED_KEY``, allowing the node to unseal its recovery share during local sealing recovery.
227
+
228
+
.. doxygenstruct:: ccf::SealedRecoveryKey
229
+
:project: CCF
230
+
:members:
231
+
221
232
``service.info``
222
233
~~~~~~~~~~~~~~~~
223
234
@@ -559,6 +570,17 @@ While the contents themselves are encrypted, the table is public so as to be acc
559
570
560
571
**Value** Last signed Merkle root of previous service instance, represented as a hex-encoded string.
561
572
573
+
``sealed_shares``
574
+
~~~~~~~~~~~~~~~~~
575
+
576
+
**Value** Per-node encrypted ledger secret wrapping keys, encrypted by the public keys recorded in ``nodes.sealed_recovery_keys``.
577
+
578
+
While the contents themselves are encrypted, the table is public so as to be accessible by a node starting a recovery service.
579
+
580
+
.. doxygenstruct:: ccf::SealedSharesInfo
581
+
:project: CCF
582
+
:members:
583
+
562
584
``last_recovery_type``
563
585
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
564
586
**Value** The mechanism by which the ledger secret was recovered.
Copy file name to clipboardExpand all lines: doc/host_config_schema/cchost_config.json
+8-7Lines changed: 8 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -357,9 +357,9 @@
357
357
"type": "string",
358
358
"description": "Path to the previous service certificate (PEM) file"
359
359
},
360
-
"previous_sealed_ledger_secret_location": {
361
-
"type": ["string"],
362
-
"description": "Path to the sealed ledger secret folder, the ledger secrets for the recovered service will be unsealed from here instead of reconstructed from recovery shares."
360
+
"previous_local_sealing_identity": {
361
+
"type": ["string", "null"],
362
+
"description": "The identity of the previous node which sealed the ledger secrets. Required if local sealing is enabled"
363
363
},
364
364
"self_healing_open": {
365
365
"type": "object",
@@ -638,10 +638,6 @@
638
638
"rpc_addresses_file": {
639
639
"type": "string",
640
640
"description": "Path to file in which all RPC addresses (hostnames and ports) will be written to on startup. This option is particularly useful when binding to port 0 and getting auto-assigned a port by the OS. No file is created if this entry is not specified"
641
-
},
642
-
"sealed_ledger_secret_location": {
643
-
"type": "string",
644
-
"description": "Path to the folder where the node will seal its ledger secrets."
645
641
}
646
642
},
647
643
"description": "This section includes configuration for additional files output by the node",
"description": "Enable sealing of ledger secrets using platform derived key capabilities (e.g. AMD SEV-SNP derived keys). This allows the node to unilaterally recover its ledger secrets on restart without needing to reconstruct them from recovery shares."
Copy file name to clipboardExpand all lines: doc/operations/recovery.rst
+91-19Lines changed: 91 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -116,34 +116,106 @@ Once operators have established a recovered crash-fault tolerant public network,
116
116
Local Sealing Recovery (Experimental)
117
117
-------------------------------------
118
118
119
-
SNP provides the `DERIVED_KEY` guest message which derives a key from the CPU's VCEK (or VLEK), TCB version and the guest's measurement and host_data (policy), thus any change to the CPU, measurement or policy, or a rolled-back TCB version, will prevent the key from being reconstructed.
120
-
If configured, the node will unseal the secrets it previously sealed instead of waiting for recovery shares from members after `transition_to_open` is triggered.
119
+
SNP provides the ``DERIVED_KEY`` guest message which derives a key from the CPU's VCEK (or VLEK), TCB version and the guest's measurement and host_data (policy), thus any change to the CPU, measurement or policy, or a rolled-back TCB version, will prevent the key from being reconstructed.
120
+
If configured, the node will unseal the secrets it previously sealed instead of waiting for recovery shares from members after ``transition_to_open`` is triggered.
121
121
122
-
If, in config.json, `output_files.sealed_ledger_secret_location` is set, the node will derive a key and seal versioned ledger secrets to that directory.
123
-
This capability is noted in`public:ccf.gov.node.info[node].will_locally_seal_ledger_secrets`, to allow it to be audited.
122
+
Overview
123
+
~~~~~~~~
124
124
125
-
Then if`command.recover.previous_sealed_ledger_secret_location` is setin the config.json, when the node recovers and receives the `transition_to_open` transaction, the node will try to unseal the latest ledger secret and use that to recover the ledger.
126
-
If this is unsuccessful, it will fall back to waiting for recovery shares.
127
-
Which of these two paths is taken is noted in the `public:ccf.internal.last_recovery_type`.
125
+
When local sealing is enabled, each node generates an RSA key pair (the "recovery key pair") during join. The private key is encrypted (sealed) using an AES-GCM key derived from the SNP ``DERIVED_KEY``, and the public key along with the sealed private key is stored in the ``public:ccf.gov.nodes.sealed_recovery_keys`` table.
128
126
129
-
.. code-block:: bash
127
+
During normal operation, whenever the ledger secret changes, or a node joins the network, the system also shuffles "sealed shares".
128
+
The primary generates a fresh ledger secret wrapping key, encrypts the ledger secret with that key, and stores a sealed copy of the wrapping key for each trusted node with a sealed recovery public key.
130
129
131
-
$ cat /path/to/config/file
132
-
...
130
+
During recovery, if the node was previously part of the network and has the same CPU, measurement, and policy, it can bypass the need for member recovery shares by re-deriving the sealing key, unsealing its recovery private key, decrypting the sealed wrapping key, and using that to unwrap the ledger secret.
131
+
132
+
The following diagram illustrates the key hierarchy and encryption relationships:
To enablelocal sealing, set``enable_local_sealing`` to ``true``in the node configuration. During recovery, the node's previous identity (node ID) must be specified via ``command.recover.previous_local_sealing_identity`` so the node can look up its sealed share.
206
+
In the future this will be a single shared identifier for both self-healing-open and local sealing recovery, but for now it is simply the previous node ID.
0 commit comments