Urgent.News

What's breaking now, across thousands of outlets.

Tech

Make GitHub Actions OIDC trust depend on the claims you can enforce

Make GitHub Actions OIDC trust depend on the claims you can enforce GitHub Actions can obtain a short-lived OpenID Connect token and exchange it for cloud access without storing a long-lived cloud secret in the repository. The convenience shifts the security question to the trust policy outside GitHub. That policy must decide which token subjects and audiences are allowed to assume which role.…

GitHub Actions can leverage OpenID Connect (OIDC) tokens to obtain cloud access without storing long-lived secrets in repositories. The security relies on a trust policy determined outside GitHub, which specifies which token subjects and audiences are authorized to assume particular roles. The subject claim in an OIDC token can identify the repository and context, and organizations can customize this to require specific claims.

Different types of workflows, such as pull request, branch, environment jobs, and reusable workflows, can generate varying context for the subject claim. It is crucial to thoroughly review the actual claim for each trusted path.

GitHub provides an OIDC debugger action to visualize claims before integrating a cloud provider. A weak trust policy that relies on broad patterns may inadvertently include workflows the role owner did not intend. When testing the trust policy, it is essential to use a non-production role and evaluate the actual claim for each trusted path. The cloud trust policy should encompass the issuer, audience, subject, and any provider-specific conditions that distinguish the intended workflow.

To enhance security, the cloud trust policy should combine the issuer, audience, subject, and any provider-specific conditions. It is advisable to use repository owners and identities rather than just human-readable names, especially when immutable repository identifiers are supported. Incorporating environment protection rules when a workflow utilizes an environment can provide stronger trust conditions.

Separate deployment roles by environment and purpose, ensuring that a production deployment role is not assumable by every branch or pull request workflow. Similarly, a read-only inventory job should not receive a role with infrastructure-changing capabilities.

The cloud provider's session policy can further narrow the token exchange. As workflows may change, it is vital to review actions receiving the OIDC token and treat such changes as security-sensitive. Ensure actions are pinned to reviewed versions, limit workflow permissions, and avoid passing unnecessary tokens to steps that do not require them.

Although the OIDC token is short-lived, the resulting cloud session could outlive the job, making it essential to log the assumed role and the token claims accepted by the provider. Avoid logging the token itself and set up alerts for new subjects assuming sensitive roles, unexpected audiences, or roles assumed from typically non-cloud-access workflows.

Rigorous testing should be conducted to ensure that attempts from untrusted branches, workflows lacking required environments, different reusable workflows, and tokens with incorrect audiences all fail. Subsequently, confirm that the intended workflow results in a cloud session with only the necessary permissions.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Collect leads in a Google Sheet with a free Apps Script webhook (no Zapier)

Zapier and Make are fine tools, but paying a monthly fee to move a form submission into a spreadsheet stings when you have ten leads a month.

  • Use Google Apps Script to create free HTTPS endpoint for lead submissions
  • Script checks SECRET token, validates email before appending row to Google Sheet
  • Deploy script as web app, configure form to post data to endpoint URL

Scotch Game for Beginners: Recapture With the Knight

By ChessStep editorial team If Black takes your d-pawn in the Scotch Game, your knight can take it back. Your queen can also reach that square, but 4. Qxd4?

  • White moves d-pawn to d4, challenging Black s e5 pawn
  • Black captures d-pawn with e-pawn, moving e-pawn to d4
  • Knight recapture recommended over queen recapture

👻 Ghost Terminal: A Ghost Living Inside Your Terminal

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine What I Built What if your terminal wasn't just a place where you execute commands, but a place where a…

  • Ghost Terminal is a Halloween-themed AI companion for terminal commands
  • Observes and responds to user commands with spooky, humorous commentary
  • Open-source, built with Python, Ollama, and Rich library

More from Saturday 31 October →