RFC: OIDC federation — keyless CI auth for codex-lb #852
DongwonTTuna
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
TL;DR
I've been prototyping IdP-agnostic OIDC federation for codex-lb: a CI/CD job presents its short-lived OIDC ID token and gets back a short-lived
sk-clb-key — no long-lived secret stored anywhere. Same model as AWS STSAssumeRoleWithWebIdentity/ GCP Workload Identity Federation, opt-in and off by default. Before taking it further, I'd like a read on whether this direction is welcome and in scope — if so, I'll build it out on my side and open a PR.The problem
Anything outside the dashboard — a GitHub Actions job, an agent, a CI pipeline — currently needs a long-lived
sk-clb-key stored as a secret. A stored credential is a standing leak surface and a rotation chore. (cf. #280 — there's already appetite for safer secret handling.)Proposal
I'd like to bring OIDC federation to codex-lb — the de-facto standard for keyless auth in the cloud world, and a clear security win. The idea: instead of storing a secret, a CI/CD job exchanges its built-in OIDC token for a short-lived
sk-clb-key, minted on demand.Why it helps
How it works
It's how GitHub Actions already authenticates to AWS and GCP without storing any cloud keys. A CI runner carries a short-lived, signed token that proves "I'm this job, in this repo." codex-lb verifies that proof, checks it against a rule you set (e.g.
repository = my-org/my-repo), and hands back ansk-clb-key that expires in minutes.Under the hood
OidcProvider(issuer + audience + JWKS) →OidcBinding(claim conditions likerepository = org/repo+ a minted-key template).POST /v1/oidc/token: verifies the JWT, matches a binding, then mints a short-livedsk-clb-through the existingcreate_key— with TTL clamp, account scope, model enforcement, and budget/usage limits.create_key/delete_key, so the credential authority is unchanged.How it compares
Among tools that gate access to LLM / API keys:
The token-exchange model itself is already industry-standard — AWS STS
AssumeRoleWithWebIdentity, GCP Workload Identity Federation, and HashiCorp Vault all work this way. This just brings it to codex-lb, free and open.The ask
If the direction's welcome, I'll build it out and open a PR.
요약
codex-lb에 IdP에 종속되지 않는 OIDC 페더레이션을 붙여보고 있습니다. CI/CD 작업이 실행할 때마다 발급받는 수명이 짧은 OIDC ID 토큰을 제시하면, 마찬가지로 수명이 짧은
sk-clb-키를 돌려받는 방식이라, 오래 보관해야 하는 시크릿이 어디에도 남지 않습니다. AWS STSAssumeRoleWithWebIdentity나 GCP Workload Identity Federation과 동일한 모델이고, 기본값은 꺼져 있어 원하는 사람만 켜서 쓰면 됩니다. 더 진행하기 전에 이 방향을 upstream에서 받아주실 만한지, 그리고 프로젝트 범위에 맞는지 먼저 여쭙고 싶습니다. 괜찮다면 제 쪽에서 구현해서 PR로 올리겠습니다.문제
지금은 대시보드 바깥에서 동작하는 모든 워크로드(GitHub Actions, 에이전트, CI 파이프라인 등)가 수명이 긴
sk-clb-키를 시크릿으로 저장해 둬야 합니다. 한번 저장된 자격증명은 그 자체로 상시 유출 위험이고, 주기적으로 교체해 줘야 하는 부담도 따릅니다. (참고로 #280처럼, 시크릿을 더 안전하게 다루고 싶다는 요구가 이미 있습니다.)제안
클라우드 업계에서 키리스(keyless) 인증의 사실상 표준이 되었고 보안 면에서도 분명히 앞서는 OIDC 페더레이션을 codex-lb에도 도입하고 싶습니다. 핵심은 이렇습니다. 시크릿을 저장해 두는 대신, CI/CD 작업이 자신의 OIDC 토큰을 그때그때 수명이 짧은
sk-clb-키와 맞바꿔 쓰는 것이죠.어떤 점이 좋아지나요
어떻게 동작하나요
GitHub Actions가 클라우드 키를 어디에도 저장하지 않고 AWS·GCP에 접속할 때 이미 쓰고 있는 바로 그 방식입니다. CI 러너는 실행될 때마다 "나는 이 저장소의 이 작업이다" 를 증명하는, 수명이 짧은 서명된 토큰을 자동으로 들고 있습니다. codex-lb 쪽에서는 그 증명을 검증하고, 미리 정해 둔 규칙(예:
repository = my-org/my-repo)에 맞는지 확인한 뒤, 몇 분이면 만료되는sk-clb-키를 내어줍니다.내부 동작
OidcProvider(issuer + audience + JWKS) →OidcBinding(repository = org/repo같은 claim 조건 + 발급할 키의 템플릿).POST /v1/oidc/token: JWT를 검증하고, 조건에 맞는 binding을 찾은 뒤, 기존create_key를 그대로 거쳐 수명이 짧은sk-clb-키를 발급합니다. 이때 TTL 상한, 계정 스코프, 허용 모델 제한, budget/usage 한도가 함께 적용됩니다.create_key/delete_key를 그대로 재사용하므로, 키를 만들고 지우는 핵심 경로에는 손대지 않습니다.비교
LLM·API 키 접근을 통제하는 도구들과 비교하면:
토큰 교환 방식 자체는 이미 업계 표준입니다. AWS STS
AssumeRoleWithWebIdentity, GCP Workload Identity Federation, HashiCorp Vault가 모두 이 방식으로 동작합니다. 이걸 codex-lb에 무료·오픈소스로 들여오는 것입니다.요청
방향만 괜찮다고 해주시면, 구현해서 PR로 올리겠습니다.
All reactions