Demo 5 — Plugin Ed25519 signature verification
Demo 5 — Plugin Ed25519 signature verification
Module brief: §Module 5
UVP
Plugins are code with database-level privileges. Treat them like code: only load what’s signed by a trusted key.
Use cases
- Multi-publisher plugin ecosystems. First-party + community + customer-private plugins coexist; trust root decides what loads.
- Air-gapped environments. No registry, no internet — operators
ship a
.wasm+.sigpair on an SD card. - Compliance. Auditors want “we cryptographically verified every plugin that ran” in the SOC 2 evidence pile. Signatures give them that, traceable to the signer label in the loader logs.
What this demo shows
End-to-end pipeline using only openssl and the proxy:
- Generate Ed25519 keypair (operator’s release key).
- Sign
cost-governor.wasmwith it. - Configure the proxy with
trust_root = /etc/helios/keys. - Drop the signed
.wasm+.sigin the plugin dir → loads, logssigned_by=release-key. - Drop a tampered
.wasm(one byte flipped) → load refuses withSignatureInvalid. - Drop an unsigned
.wasm→ load refuses withrequires a sidecar .sig file.
Run it
cd demos/v0.4.0/05-plugin-signatures./demo.shSample sequence (the script automates this):
# 1. Generate key + write trust rootopenssl genpkey -algorithm Ed25519 -out signing.pemopenssl pkey -in signing.pem -pubout -outform DER | tail -c 32 \ | base64 > keys/release-key.pub
# 2. Sign the pluginopenssl pkeyutl -sign -inkey signing.pem -rawin -in plugins/cost-governor.wasm \ | base64 -w 0 > plugins/cost-governor.sig
# 3. Start proxy with trust_root configureddocker compose up -d
# 4. Watch logs — should see "signed_by=release-key"docker compose logs proxy | grep "signature verified"Negative-path test (also in demo.sh):
# Tamper with the .wasmprintf '\xff' | dd of=plugins/cost-governor.wasm bs=1 count=1 conv=notrunc \ seek=$(($(stat -c%s plugins/cost-governor.wasm) - 1))docker compose restart proxydocker compose logs proxy | grep -i "signature"# → "Signature verification failed: signature did not match any trusted key"Implementation pointer
src/plugins/loader.rs::SignatureVerifier (~80 lines of
trust-root parsing + verify). Wired through
PluginManager::load_plugin when [plugins].trust_root is set in
TOML.
HeliosDB compatibility
Backend-agnostic — signature verification is pure proxy-side.