Skip to content

feat(controller): require a token on the HTTP API when EXAFLOW_API_TOKEN is set - #669

Closed
KFilippopolitis wants to merge 1 commit into
masterfrom
feat/controller-api-token-master
Closed

KFilippopolitis wants to merge 1 commit into
masterfrom
feat/controller-api-token-master

Conversation

@KFilippopolitis

@KFilippopolitis KFilippopolitis commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

The controller's HTTP API has no authentication, and platform-backend makes the dataset checks, so anything else that reaches it bypasses them. From an audit against the OWASP cheat sheets and ASVS 5.

  • When EXAFLOW_API_TOKEN is set, the controller requires Authorization: Bearer <token>. /livez and /healthcheck stay open for probes.
  • Flower processes on the workers call the controller (/flower/input, /flower/result, /cdes_metadata), so they send the token too.
  • The controller and worker charts read it from the optional secret exaflow-api-token.

Unset keeps today's behaviour, so backend, controller and workers can be upgraded in turn. The backend side is Medical-Informatics-Platform/platform-backend#52.

Base branch

This targets master, not fix/controller-modernization-wave3. The wave3 PR (#665) moves the app from exaflow/controller/quart to exaflow/controller/http, so whichever merges second must move api_token.py to the new framework.

Tests

tests/standalone_tests/controller: 263 pass, 1 skipped. The skipped test covers the Flower headers; it needs flwr, which did not install in my environment, so the Flower change has not been executed. CI or a full environment should run it. No failures on this base.

All testing was local. Nothing has run against the EBRAINS realm or a real cluster. A real Flower run with the token set was not tested. The backend sending the token was tested against a stub Exaflow, not this controller.

Rollback

Revert the PR, or leave the secret unset.

…KEN is set

The controller has no authentication, and platform-backend makes the dataset
checks, so anything else reaching it bypasses them. Probes stay open. Flower
processes on the workers call the controller too, so they send the token. Unset
keeps today's behaviour, so backend, controller and workers can be upgraded in
turn. The charts read it from the optional secret exaflow-api-token.
@KFilippopolitis
KFilippopolitis deleted the feat/controller-api-token-master branch November 12, 2026 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant