Skip to content

Commit 685a719

Browse files
Add SNP-style virtual attestations, restoring code update tests (#6770)
Co-authored-by: Amaury Chamayou <[email protected]> Co-authored-by: Amaury Chamayou <[email protected]>
1 parent 9735004 commit 685a719

37 files changed

+1212
-706
lines changed

CMakeLists.txt

+12-13
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,6 @@ set(CCF_JS_SOURCES
301301
${CCF_DIR}/src/js/registry.cpp
302302
)
303303

304-
set(OE_BINDIR "")
305-
306304
if(COMPILE_TARGET STREQUAL "snp")
307305
add_host_library(ccf_js.snp "${CCF_JS_SOURCES}")
308306
add_san(ccf_js.snp)
@@ -1020,8 +1018,6 @@ if(BUILD_TESTS)
10201018
PYTHON_SCRIPT ${CMAKE_SOURCE_DIR}/tests/e2e_suite.py
10211019
LABEL suite
10221020
ADDITIONAL_ARGS
1023-
--oe-binary
1024-
${OE_BINDIR}
10251021
--ledger-recovery-timeout
10261022
20
10271023
--test-duration
@@ -1099,9 +1095,8 @@ if(BUILD_TESTS)
10991095
NAME governance_test
11001096
PYTHON_SCRIPT ${CMAKE_SOURCE_DIR}/tests/governance.py
11011097
CONSTITUTION ${CONSTITUTION_ARGS}
1102-
ADDITIONAL_ARGS
1103-
--oe-binary ${OE_BINDIR} --initial-operator-count 1
1104-
--jinja-templates-path ${CMAKE_SOURCE_DIR}/samples/templates
1098+
ADDITIONAL_ARGS --initial-operator-count 1 --jinja-templates-path
1099+
${CMAKE_SOURCE_DIR}/samples/templates
11051100
)
11061101

11071102
add_e2e_test(
@@ -1113,8 +1108,11 @@ if(BUILD_TESTS)
11131108
add_e2e_test(
11141109
NAME code_update_test
11151110
PYTHON_SCRIPT ${CMAKE_SOURCE_DIR}/tests/code_update.py
1116-
ADDITIONAL_ARGS --oe-binary ${OE_BINDIR} --js-app-bundle
1117-
${CMAKE_SOURCE_DIR}/samples/apps/logging/js
1111+
ADDITIONAL_ARGS
1112+
--js-app-bundle
1113+
${CMAKE_SOURCE_DIR}/samples/apps/logging/js
1114+
--constitution
1115+
${CMAKE_SOURCE_DIR}/samples/constitutions/virtual/virtual_attestation_actions.js
11181116
)
11191117

11201118
if(BUILD_TPCC)
@@ -1249,9 +1247,7 @@ if(BUILD_TESTS)
12491247
${CMAKE_SOURCE_DIR}/python/config_1_x.ini
12501248
)
12511249

1252-
list(APPEND LTS_TEST_ARGS --oe-binary ${OE_BINDIR} --ccf-version
1253-
${CCF_VERSION}
1254-
)
1250+
list(APPEND LTS_TEST_ARGS --ccf-version ${CCF_VERSION})
12551251
if(LONG_TESTS)
12561252
list(APPEND LTS_TEST_ARGS --check-ledger-compatibility)
12571253
endif()
@@ -1261,7 +1257,10 @@ if(BUILD_TESTS)
12611257
NAME lts_compatibility
12621258
PYTHON_SCRIPT ${CMAKE_SOURCE_DIR}/tests/lts_compatibility.py
12631259
LABEL e2e
1264-
ADDITIONAL_ARGS ${LTS_TEST_ARGS}
1260+
ADDITIONAL_ARGS
1261+
${LTS_TEST_ARGS}
1262+
--constitution
1263+
${CMAKE_SOURCE_DIR}/samples/constitutions/virtual/virtual_attestation_actions.js
12651264
)
12661265
set_property(
12671266
TEST lts_compatibility

doc/audit/builtin_maps.rst

+23-3
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,30 @@ DEPRECATED. Previously contained versions of the code allowed to join the curren
138138
* - ``cae46d1...bb908b64e``
139139
- ``ALLOWED_TO_JOIN``
140140

141+
``nodes.virtual.host_data``
142+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
143+
144+
Map mimicking SNP host_data for virtual nodes, restricting which host_data values may be presented by new nodes joining the network.
145+
146+
**Key** Host data: The host data.
147+
148+
**Value** Metadata: The platform specific meaning of the host data.
149+
150+
``nodes.virtual.measurements``
151+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
152+
153+
Trusted virtual measurements for new nodes allowed to join the network. Virtual measurements are constructed by CCF to test and debug code update flows on hardware without TEE protections.
154+
155+
.. warning:: Since virtual nodes provide no protection, this should be empty on production instances.
156+
157+
**Key** Measurement, represented as a base64 hex-encoded string (length: 64).
158+
159+
**Value** Status represented as JSON.
160+
141161
``nodes.snp.host_data``
142162
~~~~~~~~~~~~~~~~~~~~~~~
143163

144-
Trusted attestation report host data field for new nodes allowed to join the network (:doc:`SNP <../operations/platforms/snp>` only).
164+
Trusted attestation report host data field for new nodes allowed to join the network (:doc:`SNP <../operations/platforms/snp>` only). Only the presence of the joiner's host data key is checked, so the metadata is optional and may be empty for space-saving or privacy reasons.
145165

146166
**Key** Host data: The host data.
147167

@@ -150,7 +170,7 @@ Trusted attestation report host data field for new nodes allowed to join the net
150170
``nodes.snp.measurements``
151171
~~~~~~~~~~~~~~~~~~~~~~~~~~
152172

153-
Trusted measurements for new nodes allowed to join the network (:doc:`SNP <../operations/platforms/snp>` only).
173+
Trusted SNP measurements for new nodes allowed to join the network (:doc:`SNP <../operations/platforms/snp>` only).
154174

155175
.. note:: For improved serviceability on confidential ACI deployments, see :ref:`audit/builtin_maps:``nodes.snp.uvm_endorsements``` map.
156176

@@ -387,7 +407,7 @@ JWT signing keys, used until 6.0.
387407
**Value** List of (DER-encoded certificate, issuer, constraint), represented as JSON.
388408

389409
``jwt.public_signing_keys_metadata_v2``
390-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
410+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
391411

392412
JWT signing keys, from 6.0.0 onwards.
393413

doc/schemas/gov/2024-07-01/gov.json

+32-1
Original file line numberDiff line numberDiff line change
@@ -1708,11 +1708,16 @@
17081708
"snp": {
17091709
"$ref": "#/definitions/ServiceState.SnpJoinPolicy",
17101710
"description": "Policy applied to nodes running in AMD SEV-SNP containers."
1711+
},
1712+
"virtual": {
1713+
"$ref": "#/definitions/ServiceState.VirtualJoinPolicy",
1714+
"description": "Policy applied to virtual nodes (insecure, intended for debugging)."
17111715
}
17121716
},
17131717
"required": [
17141718
"sgx",
1715-
"snp"
1719+
"snp",
1720+
"virtual"
17161721
]
17171722
},
17181723
"ServiceState.JoinPolicy": {
@@ -2232,6 +2237,32 @@
22322237
],
22332238
"x-ms-discriminator-value": "OE_SGX_v1"
22342239
},
2240+
"ServiceState.VirtualJoinPolicy": {
2241+
"type": "object",
2242+
"description": "Join policy fields specific to nodes running on virtual nodes with no hardware protection.",
2243+
"properties": {
2244+
"measurements": {
2245+
"type": "array",
2246+
"description": "Code measurements of acceptable enclaves.",
2247+
"items": {
2248+
"type": "string",
2249+
"format": "byte"
2250+
}
2251+
},
2252+
"hostData": {
2253+
"type": "array",
2254+
"description": "Collection of acceptable host data values.",
2255+
"items": {
2256+
"type": "string",
2257+
"format": "byte"
2258+
}
2259+
}
2260+
},
2261+
"required": [
2262+
"measurements",
2263+
"hostData"
2264+
]
2265+
},
22352266
"ServiceState.SnpJoinPolicy": {
22362267
"type": "object",
22372268
"description": "Join policy fields specific to nodes running on AMD SEV-SNP hardware.",

doc/schemas/gov_openapi.json

+50-1
Original file line numberDiff line numberDiff line change
@@ -1240,6 +1240,12 @@
12401240
"string": {
12411241
"type": "string"
12421242
},
1243+
"string_to_CodeStatus": {
1244+
"additionalProperties": {
1245+
"$ref": "#/components/schemas/CodeStatus"
1246+
},
1247+
"type": "object"
1248+
},
12431249
"string_to_JwtIssuerMetadata": {
12441250
"additionalProperties": {
12451251
"$ref": "#/components/schemas/JwtIssuerMetadata"
@@ -1331,7 +1337,7 @@
13311337
"info": {
13321338
"description": "This API is used to submit and query proposals which affect CCF's public governance tables.",
13331339
"title": "CCF Governance API",
1334-
"version": "4.5.0"
1340+
"version": "4.5.1"
13351341
},
13361342
"openapi": "3.0.0",
13371343
"paths": {
@@ -2153,6 +2159,49 @@
21532159
}
21542160
}
21552161
},
2162+
"/gov/kv/nodes/virtual/host_data": {
2163+
"get": {
2164+
"deprecated": true,
2165+
"operationId": "GetGovKvNodesVirtualHostData",
2166+
"responses": {
2167+
"200": {
2168+
"description": "Default response description"
2169+
},
2170+
"default": {
2171+
"$ref": "#/components/responses/default"
2172+
}
2173+
},
2174+
"summary": "This route is auto-generated from the KV schema.",
2175+
"x-ccf-forwarding": {
2176+
"$ref": "#/components/x-ccf-forwarding/sometimes"
2177+
}
2178+
}
2179+
},
2180+
"/gov/kv/nodes/virtual/measurements": {
2181+
"get": {
2182+
"deprecated": true,
2183+
"operationId": "GetGovKvNodesVirtualMeasurements",
2184+
"responses": {
2185+
"200": {
2186+
"content": {
2187+
"application/json": {
2188+
"schema": {
2189+
"$ref": "#/components/schemas/string_to_CodeStatus"
2190+
}
2191+
}
2192+
},
2193+
"description": "Default response description"
2194+
},
2195+
"default": {
2196+
"$ref": "#/components/responses/default"
2197+
}
2198+
},
2199+
"summary": "This route is auto-generated from the KV schema.",
2200+
"x-ccf-forwarding": {
2201+
"$ref": "#/components/x-ccf-forwarding/sometimes"
2202+
}
2203+
}
2204+
},
21562205
"/gov/kv/proposals": {
21572206
"get": {
21582207
"deprecated": true,

doc/schemas/node_openapi.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@
576576
"format": {
577577
"$ref": "#/components/schemas/QuoteFormat"
578578
},
579-
"mrenclave": {
579+
"measurement": {
580580
"$ref": "#/components/schemas/string"
581581
},
582582
"node_id": {
@@ -858,7 +858,7 @@
858858
"info": {
859859
"description": "This API provides public, uncredentialed access to service and node state.",
860860
"title": "CCF Public Node API",
861-
"version": "4.11.0"
861+
"version": "4.12.0"
862862
},
863863
"openapi": "3.0.0",
864864
"paths": {

include/ccf/ds/quote_info.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ namespace ccf
3232
std::vector<uint8_t> endorsements;
3333
/// UVM endorsements (SNP-only)
3434
std::optional<std::vector<uint8_t>> uvm_endorsements;
35-
/// Endorsed TCB (hex-encoded)
35+
/// Endorsed TCB (hex-encoded) (SNP-only)
3636
std::optional<std::string> endorsed_tcb = std::nullopt;
3737
};
3838

0 commit comments

Comments
 (0)