Generate MQTT credentials per test run - #100
Open
oysand wants to merge 2 commits into
Open
Conversation
This was referenced Aug 25, 2026
oysand
force-pushed
the
generate-mqtt-credentials-per-test-run
branch
2 times, most recently
from
August 27, 2026 12:14
db646a5 to
9dd87fe
Compare
This was referenced Aug 27, 2026
oysand
force-pushed
the
generate-mqtt-credentials-per-test-run
branch
from
August 27, 2026 12:29
9dd87fe to
83d374d
Compare
Contributor
Author
|
Pushed
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The suite was handed four secrets from
FlotillaTestsKv:FLOTILLA-MQTT-PASSWORDflotillaline of the committedpasswd_fileISAR-MQTT-PASSWORDisarSARA-MQTT-PASSWORDsaraFLOTILLA-BROKER-SERVER-KEYThese were real credentials shared with every environment, because the broker validated against the
passwd_fileand certificate baked into its image. A fifth secret,INTEGRATION_TEST_AZURE_CLIENT_SECRET, existed only to read those four.After this PR the integration tests require no secrets at all.
uv run pytest -s .with Docker running. Sincemainmoved the service images to public ghcr.io packages, no registry login is needed either.What
utilities/mqtt_credentials.pymints, per test session:access_control.equinor/flotilla#2908 makes the broker assemble these into its configuration on startup. Nothing leaves the session and nothing grants anything anywhere else.
TLS and the broker ACLs are still exercised end to end — this is not a weakening. ISAR verifies the broker certificate against the generated CA, handed to it as
ISAR_MQTT_CA_CERT(equinor/isar#1166).Also:
FLOTILLA_MQTT_PASSWORD,ISAR_MQTT_PASSWORD,SARA_MQTT_PASSWORDandFLOTILLA_BROKER_SERVER_KEYfromsettings.py.AZURE_*/KEYVAULT_NAMEenv fromrun_integration_tests.yml.build_local_images.shnow also buildsflotilla-broker, since verifying a change here needs the broker built from a local checkout.cryptographypromoted to a direct dependency; it was already present transitively.Depends on
Both must merge and publish an image first, otherwise this suite runs against a broker that ignores
MQTT_PASSWORDS:Merge order for
INTEGRATION_TEST_AZURE_CLIENT_SECRETIt is still declared in
run_integration_tests.yml, marked deprecated andrequired: false, but nothing reads it. It cannot be removed yet:flotilla,saraandisar-robotstill pass it, and GitHub rejects a caller passing a secret the reusable workflow does not declare.FlotillaTestsKvand retire the service principal.Verified
Re-verified after rebasing onto current
main(the ACR to ghcr.io move). Built all four images from local checkouts withscripts/build_local_images.sh(isar-robot overlaid with the local isar wheel carrying equinor/isar#1166), then ran the full suite in parallel with.envmoved away andFLOTILLA_MQTT_PASSWORD,ISAR_MQTT_PASSWORD,SARA_MQTT_PASSWORD,FLOTILLA_BROKER_SERVER_KEYexplicitly unset:Separately exercised the broker image directly: TLS handshake with hostname verification against the generated CA,
Denied PUBLISHforsara→isar/x/status,not authorisedon subscribe toisar/#, wrong-password refusal, and both fallback paths.Ready for review checklist:
robotics-infrastructurework.Merge order
This is one of five PRs that remove the need for any external secret to run the armada
integration tests. They must merge in this order:
Make the MQTT CA certificate configurable isar#1166 — MQTT CA certificate configurable
then wait for the
:devimages to publishOut of order it breaks: armada's reusable workflow currently declares
INTEGRATION_TEST_AZURE_CLIENT_SECRETasrequired: trueand every caller uses@main, so acaller that stops passing it before step 2 fails immediately. Conversely step 2 needs the new
broker and the configurable ISAR CA already published, because it feeds the broker its
credentials through the environment.
Follow-up rollout is tracked in equinor/robotics-infrastructure#1169.