GitHub OIDC Identity Provider
You set up a github oidc identity provider by linking your cloud account to GitHub Actions. Your workflow then trades a signed token for a short cloud role session. Teams use this setup to drop static secret keys from build pipelines. Still, broad trust rules often let any branch assume high cloud permissions. A wide role lets a bad workflow run risky commands against production data. How a github oidc identity provider works in pipelines OpenID Connect lets two systems trust each other witho
Identity Provider Integration + GitHub Actions Security: the complete guide
Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.
You set up a github oidc identity provider by linking your cloud account to GitHub Actions. Your workflow then trades a signed token for a short cloud role session. Teams use this setup to drop static secret keys from build pipelines. Still, broad trust rules often let any branch assume high cloud permissions. A wide role lets a bad workflow run risky commands against production data.
How a github oidc identity provider works in pipelines
OpenID Connect lets two systems trust each other without sharing static passwords. During a workflow run, GitHub creates a signed JSON web token for that job. This token holds facts like the repo name, branch name, and runner details.
Your cloud platform checks the token signature against public keys from GitHub. Next, the cloud platform reads the claims inside the token payload. It matches those claims against the trust policy on your target cloud role. If the repo and branch match your rules, the cloud grants a token.
The workflow job uses this short session to talk to cloud services. When the job ends, the token expires on its own. Engineers do not need to rotate keys or store passwords in repo settings.
Scoping trust rules and claim checks
A safe setup depends on strict claim checks in your cloud role policy. Many teams start by checking only the repo name in the trust rule. That choice creates a risk when external users open pull requests.
A pull request workflow from a fork could match a loose repo rule. You must lock the role to a specific branch, tag, or job stage. Good trust rules check the exact repo, the target branch, and the workflow file.
You should also make separate roles for test builds and production deploys. Test roles should only read test state and write to staging buckets. Production roles should only accept tokens from protected release branches.
Identity Provider Integration + GitHub Actions Security: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
What native OIDC solves and what it misses
Native OpenID Connect removes long-lived cloud keys from your code host. Attackers do not receive unmasked static secrets from build logs or repo settings anymore. It also ties every cloud session back to a specific workflow run.
Still, the identity check only happens at the start of the session. Once the workflow gets a cloud role, it holds full role permissions. The identity provider does not watch the actual queries or commands in flight.
A deployment job often needs broad rights to update tables or run scripts. If a bad script enters the build, the cloud role allows the action. Native role checks cannot block a destructive database query inside an approved session.
They also cannot rewrite sensitive fields like emails or card numbers in results. If a build script queries production tables, raw phone numbers can enter build logs. Teams need command controls and data masking after the login step finishes.
Govern statements and responses across databases and APIs
Good config and scoped roles are needed setup. They do not check single queries in flight or mask sensitive fields in returned rows. Across Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, and internal HTTP endpoints, hoop.dev runs beside each supported service as an open-source proxy, a sidecar for your database or API.
First, hoop.dev guardrails block banned queries before they run. Then hoop.dev data masking rewrites matched sensitive values in responses in memory. The audit trail records every statement and verdict per resource. Furthermore, hoop.dev holds SOC 2 Type II and is open source on GitHub.
Frequently asked questions
Why use OIDC instead of static secret keys in GitHub?
Static keys stay valid until an engineer rotates them by hand. OIDC tokens expire right after the job ends, which shrinks your risk window.
How do I stop pull requests from using production roles?
Add a claim condition to your cloud role trust policy. Require the token subject to match your main branch or a protected deploy stage.
Does OIDC control what SQL queries a migration job can run?
No, OIDC only checks the workflow identity at login time. Once logged in, the job can run any query allowed by the database user.
Related guides
In this post