feat: external OIDC tokens for self-hosted instances

Offen
#5,090 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
48/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
typescript

Rechercherichtung

Start by tracing getExternalOidcController() and the ExternalOidcPlugin interface, then review the /api/v1/auth/oidc/token route and the existing token claims. Check how the isCloud() gate, OIDC_ISSUER_URL, and run-token setting control minting. Done means self-hosted instances can mint tokens under the stated conditions, the documented claims include the requested identifiers, and tests cover the behavior.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Is your feature request related to a problem? Please describe.

v4.8.3 added auth.getOIDCToken() and @trigger.dev/sdk/oidc/aws, but only Trigger.dev Cloud can mint the tokens. getExternalOidcController() returns null unless isCloud() is true, and the minter is loaded from the closed @triggerdotdev/plugins/oidc module. On a self-hosted instance POST /api/v1/auth/oidc/token returns 503. The open-source repo already has the rest: the OIDC_ISSUER_URL issuer, the /.well-known/jwks.json and discovery routes, the signing key service, run-token verification and the ExternalOidcPlugin interface.

Self-hosted operators are often the ones with the strictest security requirements (FedRAMP, ITAR, HIPAA). A task can only get its credentials from the environment's variables. Every run in an environment receives the same static secrets: database and API admin credentials, cloud keys and vendor tokens. Any task, or any dependency bundled into the image, can read all of them. OIDC would let a task exchange a short-lived token, valid only for one audience, for credentials scoped to that task: AWS roles through STS, token exchange with Keycloak or another IdP, Vault, or GCP and Azure workload identity. The static secrets could then leave the environment.

Describe the solution you'd like to see
  • Enable external OIDC on self-hosted instances when OIDC_ISSUER_URL is set and run tokens are on, with an open-source minter. A self-hosted operator can already provide that minter through the existing plugin interface if only the isCloud() gate is removed.
  • Document the token's claim set. Include run_id, task_id, attempt and deployment_id alongside sub, so a verifier can authorize per task and attribute activity to a run.
  • Optionally, let operators add claims, such as AWS session tags (https://aws.amazon.com/tags). That would let a multi-tenant application drive attribute-based access control from data recorded when the run was triggered.
Describe alternate solutions
  • Workload identity on run pods (IRSA, EKS Pod Identity): the identity belongs to the worker group's service account, so every task in the environment gets the same role. It is AWS-only, and it doesn't identify the run or task.
  • Sending the internal run token (run+jwt) to our own exchange service: its signing keys aren't published, and its audience is trigger:api with admin scope. The receiving service ends up holding a Trigger API credential for the whole environment.
  • Shipping our own @triggerdotdev/plugins/oidc module: the isCloud() check still blocks it.
Additional information

Related: #1851 (OIDC on Cloud runners). I'm happy to help with a PR.

Vorherrschende Sprache
TypeScript
Sterne
16.5k
Forks
1.5k
Ø Merge
1 T. 15 Std.
Gemergte PRs (30 T.)
17

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus triggerdotdev/trigger.dev

Alle Issues in triggerdotdev/trigger.dev

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.