CI: OIDC
ermite is an OpenID Connect provider for its jobs, like GitHub. A job exchanges a short-lived ID token for cloud or Vault credentials instead of storing a long-lived secret.
permissions:
id-token: write
Works with core.getIDToken(), aws-actions/configure-aws-credentials, hashicorp/vault-action (method: jwt).
Requirements
- A trusted run (see CI trust). Agent runs get no token.
id-token: writeinpermissions:.ERMITE_SECRETS_KEYset on the server.
Otherwise the action fails as on GitHub without the permission.
Endpoints
| Issuer | <ERMITE_PUBLIC_URL>/-/oidc |
| Discovery | /-/oidc/.well-known/openid-configuration |
| Keys | /-/oidc/.well-known/jwks |
The relying party must reach the issuer. AWS, Azure and GCP need it on the public Internet; a private server works with a relying party on the same network, such as Vault.
Token
- RS256, valid 5 minutes, GitHub's claims (
sub,repository,ref,sha,job_workflow_ref,environment, …),runner_environment: self-hosted. sub:repo:<owner>/<repo>:environment:<name>for a job with an environmentrepo:<owner>/<repo>:pull_requestforpull_requestandpull_request_targetrepo:<owner>/<repo>:ref:<ref>otherwise
- Default
aud:<ERMITE_PUBLIC_URL>/<owner>.getIDToken(audience)picks another.
Key rotation
ermite oidc rotate-key
The previous key stays in the JWKS for 24 hours.
Vault example
vault auth enable jwt
vault write auth/jwt/config \
oidc_discovery_url="https://git.example.com/-/oidc" \
bound_issuer="https://git.example.com/-/oidc"
vault write auth/jwt/role/deploy role_type=jwt user_claim=sub \
bound_audiences="https://git.example.com/owner" \
bound_claims_type=glob bound_claims='{"sub":"repo:owner/proj:ref:refs/heads/main"}' \
policies=deploy ttl=10m