Skip to content

proTES: validate LS Login bearer tokens and define how downstream TES credentials are handled #201

Closed
5 of 5 issues completed

Description

@uniqueg

Why?

proTES is the gateway in the M4.4 chain, and the M&Ds doc requires OAuth2-based access control "at least to the gateway". It is also the single entry point to the TES network for Conquest (elixir-cloud-aai/generic-issues#28), and it discovers backends dynamically from the Cloud Registry (#202, done in elixir-cloud-aai/TESK#260).

State when this issue was opened (for reference):

  • pro_tes/config.yaml wired FOCA bearer validation, but had disable_auth: True for the TES API.
  • Incoming credentials were handled as HTTP Basic (parse_basic_auth() in pro_tes/ga4gh/tes/task_runs.py), passed through to the downstream TES instances, and persisted in the task document in MongoDB (db_document.basic_auth).
  • The middleware management API (api/middleware_management.yaml) had no security.
  • The default tes.service_list in config.yaml was outdated compared with the current network.

Current state on dev (2026-10-23, 54f8611):

  • The TES API requires bearer tokens (disable_auth: False; docs: note where charts from 0.3.0 on are published TESK#240): RFC 9068 access tokens only (verify_token_type: True), trusted issuers, audience and optional client allowlist (security.auth.issuers, audience, clients), groups from userinfo (userinfo_claims), on FOCA 0.17 (build!: require FOCA 0.17 and Python 3.13 #245). GET /service-info, the spec and the Swagger UI are public. The app refuses to start without trusted issuers, without an audience (unless verify_audience: false) and without a group mapped to admin (pro_tes/security.py, docs/access-control.md).
  • Users own their tasks (feat(access-control)!: own tasks per user #250): the owner is the token's sub; GET /tasks lists only the caller's tasks, and GET /tasks/{id} and :cancel are allowed for the owner only (also not for admins; maintainer decision). Task identifiers are unique, so that no owner role is inherited (fix(db)!: make task identifiers unique #258).
  • No Basic parsing, no stored credentials (feat!: call TES backends with service tokens #251): proTES calls the backends with credentials of its own, set per backend (auth: client_credentials (default) | basic | none), never with those of its callers. basic (transitional) reads the credentials from environment variables. On startup, remove_stored_credentials() (pro_tes/utils/db.py) removes basic_auth from tasks stored by earlier versions. Credentials in input/output URLs are rejected (or stripped, url_credentials).
  • No default backends (feat!: call TES backends with service tokens #251): custom.tes.service_list: [] in pro_tes/config.yaml and config_models.py; the app warns if no backend is configured or discovered. Backends can also be discovered from a registry (feat: discover TES backends from the registry #260; verified, https, public addresses, discovered backends get client_credentials or none).
  • The middleware management API is not served (unregistered in fix: early cancel leaves the executor running TESK#219, FOCA 0.15), so it isn't reachable at all; the spec still describes runtime installs from Git/PyPI/local paths and has no security (fix(api)!: load only installed middlewares #217, on hold).
  • The repository has no LS Login or ELIXIR defaults: issuers, audiences, clients, group mappings and backends are deployment configuration; config comments, chart values, docs and tests use fictitious examples (login.example.org, compute-users, tes.example.org).

Core design problem (resolved): a request carries one Authorization header, so once clients send Bearer <token>, proTES can't receive per-request Basic credentials for the downstream instances. Resolved by proTES authenticating downstream with its own credentials (see "Downstream credentials (decided)").

Access policy (agreed):

  • Public: GET /service-info.
  • Running tasks (create, list, get, cancel): members of ECP_CLN or any subgroup.
  • Middleware management API: members of ECP_CLN:ADMIN only.

Authorization policy (agreed). Users must be members of the LS Login (Perun) group ECP_CLN (organization ELIXIR, "ELIXIR Compute Platform group for cloud apps") or any of its subgroups. The subgroups are currently ADMIN, BioHackCloud, BioHackCloud Admins, ELIXIR-CH, ELIXIR-CZ, ELIXIR-DE, ELIXIR-FI, ELIXIR-GR, ELIXIR-NL and OSS, plus the new EOC-Compute for approved compute users (elixir-cloud-aai/tes-dashboard#36). Membership is managed as LS Login VO groups and released to services as entitlement values, typically in the eduperson_entitlement claim.

Do not hardcode a guessed string: the exact value(s), whether subgroup members carry the parent ECP_CLN value, and whether the claim appears in the access token or only via userinfo are checked with a real test member in elixir-cloud-aai/generic-issues#31.

Generic configuration. This policy is the ELIXIR On-Cloud deployment's, not proTES's: proTES maps groups to the roles user and admin (security.access_control.claim_groups, group_mapping; exact values) and has no LS Login or ECP_CLN defaults. The ELIXIR On-Cloud values (issuer https://login.aai.lifescience-ri.eu/oidc/, userinfo_claims: [eduperson_entitlement], the ECP_CLN entitlement values, the frontends' client IDs) belong in its deployment configuration, outside this repository (elixir-cloud-aai/generic-issues#31). The sample access token (2026-10-20) carries no group claims, so groups come from userinfo.

Downstream credentials (decided). Replaces options (a)–(c) of step 1. Per the ELIXIR On-Cloud authentication policy:

  • Now (MVP): users are validated at the edge: issuer allowlist, signature, exp/nbf, typ: at+jwt, client/audience allowlist (the frontends' client IDs), and ECP_CLN from userinfo. proTES calls the TES backends with its own token (OAuth 2.0 client credentials, RFC 6749 §4.4); backends check issuer, signature, expiry and that client_id is proTES's, without an aud check. That avoids expired user tokens in long-running tasks and per-backend audiences, and it works for backends discovered at runtime (feat: discover TES backends from the registry #202). Backends that don't accept tokens yet get a transitional per-backend Basic mode from Secrets. The user's sub travels as data in TES task tags, for accounting and audit only (feat: pass user identity to TES backends #254, on hold).
  • Target (later, with fix(chart): add probes to the API Deployment TESK#254): token exchange (RFC 8693, supported by LS Login): proTES exchanges the incoming token for one with aud = the chosen backend and act = proTES, so that each backend checks that the token is for itself and can apply per-user policies. Not scheduled; full cross-stack auth is on hold.
  • Forwarding the caller's token (former option b) is not done: it would hand user tokens to every backend, including discovered ones.

How?

  1. Decide and document how proTES authenticates downstream: proTES's own client-credentials token, plus per-backend basic (transitional) and none (see above; docs/access-control.md, "Credentials of TES instances"). Add Read the docs files. Before they were auto generated TESK#213 / fix(chart): quote secret values TESK#251 (b6b35e6).
  2. Enable bearer validation for the TES API and enforce the policy: disable_auth: False, verify_token_type, issuers, audience, optional clients, groups from userinfo, roles user/admin from group_mapping, public service info; startup checks for issuers, audience and an admin group. Dependabot: urllib3 and boto3 updates TESK#212 / docs: note where charts from 0.3.0 on are published TESK#240 (46d3bc9), on FOCA 0.17 (build!: require FOCA 0.17 and Python 3.13 #214 / feat: add a chart value for the Swagger UI TESK#245, ec95fec). The audience is the frontends' client IDs, set per deployment (cf. Demonstrator dashboard: forward the user's LS Login access token to proTES and WES backends tes-dashboard#34).
    • The check with real LS Login tokens of a test member (exact ECP_CLN entitlement values, parent values for subgroup members, FOCA's JWKS and userinfo validation; so far only tested with a fake identity provider in the smoke test) is a deployment task: chore: configure proTES for ELIXIR On-Cloud generic-issues#31.
  3. Record the authenticated sub as task owner (user_id, plus FOCA owner roles) and restrict list, get and cancel to the owner's tasks; no sharing, admins don't get access to the tasks of others (decision Q2). fix(filer): HTTP(S) uploads read outputs in text mode, so binary files fail and some text is altered TESK#215, Add missing boilerplate TESK#153 / fix(chart): quote secret values TESK#250 (9370b32), unique task identifiers feat(chart)!: derive resource names from the release TESK#248 / feat(chart): deprecate auth.clientSecret TESK#258 (e38b4de).
    • Tasks submitted by a service client (Conquest) on a user's behalf: proTES refuses to start if service clients or on_behalf_of_header are configured. Moved to fix(chart): add probes to the API Deployment TESK#254 (on hold), together with token exchange as a later step.
  4. Stop persisting downstream credentials in MongoDB: no basic_auth in task documents, none queued for the Celery worker, existing ones removed on startup (remove_stored_credentials()), Basic credentials only from environment variables (Secrets). Add Read the docs files. Before they were auto generated TESK#213 / fix(chart): quote secret values TESK#251.
  5. Restrict the middleware management endpoints to ECP_CLN:ADMIN (the role admin). The API is not served at all today, so nobody can reach it; this counts as met for M4.4. Securing the API before it is served again, and removing runtime installs from Git/PyPI/local paths, is feat: expose service-info setting in the chart TESK#217 (on hold, middleware direction undecided).
  6. Configure every backend of the production deployment with its auth mode (client_credentials, or basic until the node accepts tokens), and register proTES's client-credentials client at LS Login: moved, with the per-node checklist, to chore: configure proTES for ELIXIR On-Cloud generic-issues#31 (ELIXIR On-Cloud deployment, outside this repository).
  7. Update the Helm chart, the default service list and the docs: the chart is built on FOCA's library chart, renders only with issuers, audience and an admin group, and takes backend credentials from Secrets via extraEnv (build(chart)!: use the FOCA library chart #216 / docs: add a single-node guide with MicroK8s TESK#252, 718c3ba); no default backends (feat!: call TES backends with service tokens #251; this also covers chore: align the repo with the org's conventions TESK#229); docs/access-control.md, docs/configuration.md (backends, discovery) and docs/upgrading.md (Basic credentials, removed basic_auth) (feat(auth)!: require tokens for task operations #240, fix(chart): quote secret values TESK#250, fix(chart): quote secret values TESK#251, feat(chart): add tesk.filerHttpTimeout TESK#260).

Remaining

  • docs(chart): fix the TES backend examples: the chart's example of custom.tes.service_list still uses the old string form (- "https://tes.example.org" in deployment/values.yaml and deployment/README.md), which the config model rejects since fix(chart): quote secret values TESK#251 (it requires - url: …). Small docs fix.

Acceptance criteria

Dependencies: none left in proTES. The production configuration (elixir-cloud-aai/generic-issues#31) depends on proTES's client-credentials client at LS Login and on token support at the nodes (elixir-cloud-aai/generic-issues#35, elixir-cloud-aai/generic-issues#20, elixir-cloud-aai/generic-issues#21).

Moved to other issues


Part of the ELIXIR Compute Platform WP4 sprint (M&Ds due end of December 2026).
If you want to work on this issue:

  • Assign yourself (if someone is already assigned, ask them first or pick another one)
  • Move the issue to "In progress" on the project board
  • Start working 🚀

Sub-issues

Sub-issues

5 of 5 Issues completed
Loading 5 sub-issues

Activity

  1. added
    priority: high
    type: auth
    type: security
    workload: days
    ecp-wp4: M4.4
    on Oct 14, 2026
  2. added
    type flag: meta
    on Oct 22, 2026
  3. uniqueg commented on Oct 22, 2026

    @uniqueg
    MemberAuthor

    This issue is now the parent of the auth work in proTES, split into PR-sized child issues:

    On step 1 (downstream credentials): the ELIXIR On-Cloud auth policy decided for proTES's own service token (client credentials) towards the backends, which check that the token's client_id is proTES's, rather than forwarding the user's token (option b). That avoids expired user tokens in long-running tasks and per-backend audiences, and it also makes dynamic discovery (#202) possible without forwarding user tokens. Backends that don't accept tokens yet can get a transitional per-backend mode in elixir-cloud-aai/TESK#213.

    The per-node checklist (step 6) stays here; this issue is closed once all children are done and the production deployment is configured.

  4. self-assigned this
    on Oct 23, 2026
  5. moved this from Ready to Done in ELIXIR On-Cloudon Oct 23, 2026
  6. closed this as completedby moving to Done in ELIXIR On-Cloudon Oct 23, 2026
  7. moved this from In progress to Done in ELIXIR On-Cloudon Oct 23, 2026
  8. moved this from Done to In progress in ELIXIR On-Cloudon Oct 23, 2026
  9. moved this from Done to In progress in ELIXIR On-Cloudon Oct 23, 2026
  10. uniqueg commented on Oct 23, 2026

    @uniqueg
    MemberAuthor

    Updated to the current state of dev; the remaining deployment work moved to elixir-cloud-aai/generic-issues#31. Closing as done for proTES.

  11. moved this from In progress to Done in ELIXIR On-Cloudon Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

ecp-wp4: M4.4priority: hightype flag: metatype: authtype: securityworkload: days

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions