Skip to content

Own LS Login client for automated smoke tests #135

Open
3 of 4 issues completed
Open

Description

@uniqueg

Goal

Routine test, development and deployment checks against our services (Poiesis on Rahti and at CERIT, TESK FI and
CZ, later proTES) need an access token. Today a maintainer pastes a fresh token for each check. We register a
dedicated LS Login client, "ELIXIR On-Cloud smoke tests", with the client credentials grant only, so that automation
gets its own short-lived tokens, and give that client narrow rights in the services.

Non-goals

Design

  • LS Login: confidential client, client credentials grant only, no redirect URIs, no scopes beyond what the form
    requires, no refresh tokens, shortest token lifetime LS Login allows. Its tokens (per the LS Login operators, LS Login: register the proTES client #47):
    JWT typ at+jwt, client_id = sub = the client ID, no entitlements.
  • Recognition: services recognise the client by identity (iss + client_id + sub = client ID), never by
    entitlements. No user token can match, since user tokens carry the user's sub.
  • Poiesis (code change upstream, Accept service clients per issuer (client credentials) JaeAeich/poiesis#208): per issuer, a list of service clients matched by client ID, with
    their own audiences; they skip userinfo and the issuer's requiredClaim; humans keep today's rules exactly
    (requiredClaim stays set). The decision service still decides.
  • tes-authz: a new, optional service_clients key in the policy data: per client the services it may use and a
    ceiling for its tasks (images, explicit CPU/RAM/disk limits, input/output URL prefixes, executor count). Listed
    clients may create tasks within the ceiling, and list, get and cancel their own tasks; never all, never admin,
    never with an actor or an API key. Without the key, decisions are unchanged.
  • TESK (tokenClients: audiences per client TESK#336 (+ Service clients: audiences per client tesk-api#215)): auth.tokenClients.clients becomes a map client ID -> settings with audiences, so each
    client (proTES' and this one) is accepted only at its own audiences. tesk-api's built-in model then lets the client
    create, list, get and cancel its own tasks only.
  • proTES (Opt-in service client role for production smoke tests protes#514, later, low priority): an opt-in service client role for production end-to-end smoke tests
    (own tasks, only backends we operate, forwarding its own token) replaces the startup refusal.
  • Token exchange: RFC 8693 (a token per backend audience) is the long-term fix for gateways forwarding tokens.
  • Helper: eoc-token.fish mints a token into a mode-600 curl header file and prints only token type, audience and
    expiry; the secret stays in a mode-600 file that only curl reads.

Tasks

Acceptance criteria

  • A token of the client has typ at+jwt, client_id = sub = the client ID, no entitlements, and lives as short
    as LS Login allows (recorded).
  • With that token, on each Poiesis instance: create a small task within the ceiling, list it, get it and cancel it
    (200); a task over the ceiling or with another image is refused (403); ListTasks on all tasks and another
    user's task are refused (403/404).
  • On each TESK instance: create, list, get and cancel own tasks work; other users' tasks aren't visible; the
    client's token isn't accepted at an audience listed only for proTES' client.
  • A user without EOC-Compute/ADMIN is still refused everywhere, and members' and admins' results are unchanged
    (existing smoke tests pass).
  • The client secret exists only in LS Login and in one mode-600 file of the maintainer; it is in no repo, values
    file, log or Kubernetes Secret.
  • Docs published.

Sub-issues

Sub-issues

3 of 4 Issues completed
Loading 4 sub-issues
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ecp-wp4: M4.4priority: mediumstatus: triagetype: authworkload: days

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions