Repository navigation
Open
Description
Problem
MQTT X.509 auto provisioning now requires the device to prove it holds the private key for its
certificate (GHSA-7jp3-2229-xgqj). Certificate-only x509 requests are rejected with
UNAUTHORIZED, so both load test plans fail at the provisioning step:
test/load1/deployment3/auto-provisioning.jmxtest/load1/deployment3/auto-provisioning-settle-test.jmx
The protocol is documented in the
auto provisioning docs
(updated by openremote/documentation#204) and in the UserAssetProvisioningMQTTHandler javadoc,
and UserAndAssetProvisioningTest has a working client.
Required changes
Plans
For each device thread:
- Subscribe to
provisioning/${id}/response(already first; only the connection that owns this
topic may publish requests, and a connection may own only one response topic). - Publish
{"type":"x509-challenge-request","cert":"${cert}"}toprovisioning/${id}/request. - Wait for the
x509-challengeresponse. In a JSR223 (Groovy) post-processor:- check the challenge starts with
OpenRemote MQTT X509 provisioning v1\nfollowed by
provisioning/${id}/request - sign the exact UTF-8 bytes of
challengeusingalgorithm(SHA256withRSAfor the
generator's RSA key) and Base64 encode it - load and parse the private key once and cache it in
props, not per thread or per sample
- check the challenge starts with
- Publish
{"type":"x509","cert":"${cert}","signature":"${signature}"}to the same request topic. - Wait for the
successresponse and move the existing asset ID regex extractor onto it.
Device key and CSV
- The private key used to generate the committed
deployment3/devices.csvis not in the repo
(device_generator.shwrites it totmp/device.pemand deletestmp/on each run), so the
committed certificates can no longer be used. - Change
device_generator.shto keep the device key somewhere durable (or accept an existing
one), commit a test-only device key next to the plans (the load1 CA key is already committed
undersetup/src/load1), and regeneratedevices.csvwith it. - Make sure the key is shipped to the load generators alongside
devices.csvin the Taurus
*.ymlconfigs.
Things to verify
- That the XMeter
SubSampler(async) +AsyncResponseSamplercombination can wait for a
second message on the same subscription; if not, use two sampling windows or a JSR223 sampler
for the exchange. - That a run with a small
THREAD_COUNTagainst a local manager provisions every device, then
a full 10k run to compare provisioning throughput with the previous single-step exchange
(there is now one extra round trip and a signature verification per device).
Done when
- Both plans provision and run against a manager that includes the fix.
test/load1/README.mdno longer describes the plans as broken.
Metadata
Metadata
Assignees
Labels
No labels
Activity
Merge commit from fork
Fix MQTT X.509 provisioning impersonation