NOISSUE: Add attestation-test wasm component example using elastic:hal#168
Conversation
|
TDX test results (ran on uv-intel, commit 7ff9ad4) Tested inside a real Intel TDX CVM (kernel 6.11.0-17-generic,
One note: the attestation response still returns a placeholder (platform: |
8048a31 to
52a829c
Compare
Signed-off-by: JeffMboya <jangina.mboya@gmail.com>
…rface Fix incorrect WIT import namespaces in platform-test and attestation-test: - attestation-test: elastic:attestation/hal -> elastic:tee-hal/platform, get-attestation -> attestation - platform-test: elastic:platform/platform -> elastic:tee-hal/platform, get-platform-info -> platform-info Add wasm-hal-runner binary to proplet for standalone testing of wasip1 WASM files with HAL host imports, and expose hal_linker as a public module in lib.rs. Verified against real Intel TDX hardware — both examples produce valid attestation evidence with platform_type: IntelTdx.
Drop platform-test. Rewrite attestation-test as a proper WASM component using wit-bindgen against the elastic:hal@0.1.0 interface from wasmhal commit cfe99ef. The component implements the hal-consumer world: queries platform info, generates a random nonce via the HAL random interface, requests attestation evidence from the TEE platform, and returns it from the exported run() function. Build with: cargo build --target wasm32-wasip2
…d target, add to dependabot
…orm and random calls
…ngs)] Replaces the external wit/ path with an inline WIT string in wit_bindgen::generate!, eliminating the hal.wit file entirely. Removes the mod bindings wrapper and #[allow(warnings)].
Adds hal_component_linker.rs registering elastic:hal/attestation@0.1.0, elastic:hal/platform@0.1.0, and elastic:hal/random@0.1.0 for wasmtime's component model linker. Adds is_hal_component detection and routing in wasmtime_runtime.rs so HAL components invoke start_app_component_export instead of the wasi:cli/run path.
Merges upstream WAVE arg parsing with our HAL linker block and interface- searching func finder. Result extraction keeps byte extraction for list<u8> (attestation evidence).
a2b0917 to
45687d9
Compare
…ee-hal, remove proplet component model changes
Updated: Rewritten as WASI P1 core moduleFollowing reviewer feedback, the example has been refactored from a WASI P2 component model approach to a WASI P1 core module, matching the pattern used by What changed
Verified on Intel TDX CVMRan the new WASI P1 binary ( Real TDX measurements returned. The WASI P1 module dispatches correctly through |
What type of PR is this?
Feature: adds an
attestation-testWASM component example using theelastic:hal/attestation@0.1.0interface from wasmhal.What does this do?
Adds
examples/attestation-test— a wasm32-wasip2 component that callselastic:hal/attestationto generate a TEE attestation report. The component exportselastic:hal/runand is built with wit-bindgen against a minimal local WIT file (attestation interface + world only).Which issue(s) does this PR fix/relate to?
N/A
Have you included tests for your changes?
Tested on an Intel TDX CVM (kernel 6.11.0-17-generic,
/dev/tdx_guestpresent) usinghal-runtimebuilt from wasmhal @cfe99ef. Component loads, WIT interface resolves, and attestation call returns successfully (exit 0).Did you document any new/modified features?
N/A
Notes
WIT sourced from wasmhal @
cfe99ef. The localhal.witis intentionally minimal — only theattestationinterface andhal-consumerworld, sincewit_bindgen::generate!requires a local path at compile time.