Skip to content

expose get oidc token optioin for github sia#3218

Merged
psasidhar merged 2 commits intomasterfrom
oidc-token
Mar 4, 2026
Merged

expose get oidc token optioin for github sia#3218
psasidhar merged 2 commits intomasterfrom
oidc-token

Conversation

@havetisyan
Copy link
Copy Markdown
Collaborator

@havetisyan havetisyan commented Mar 4, 2026

Description

Contribution Checklist:

  • The pull request does not introduce any breaking changes
  • I have read the contribution guidelines.
  • Create an issue and link to the pull request.

Attach Screenshots (Optional)

Signed-off-by: Henry Avetisyan <hga@yahooinc.com>
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the GitHub SIA daemon to support the retrieval of OpenID Connect (OIDC) tokens from Athenz ZTS. This enhancement allows GitHub Actions workflows to obtain and utilize OIDC tokens for authentication, improving integration with services that rely on OIDC for identity verification by exposing the token via the GITHUB_ENV.

Highlights

  • OIDC Token Retrieval Flags: New command-line flags --get-oidc-token and --oidc-token-audience were introduced to enable and configure OIDC token fetching from Athenz ZTS.
  • ZTS Request Enhancement: The ZTS instance registration request was updated to conditionally include OIDC token parameters (requesting a token and specifying its audience) based on the new command-line flags.
  • GitHub Environment Integration: Logic was added to extract the retrieved OIDC token from the ZTS response and write it to the GITHUB_ENV file, making it accessible as an environment variable within GitHub Actions workflows.
Changelog
  • provider/github/sia-actions/cmd/siad/main.go
    • Added fmt package import for string formatting.
    • Declared new variables oidcTokenAudience and getOIDCToken to manage OIDC token options.
    • Registered new command-line flags --get-oidc-token and --oidc-token-audience for user configuration.
    • Updated the PostInstanceRegisterInformation request to conditionally include OIDC token parameters when getOIDCToken is true.
    • Implemented logic to check for and write the ServiceToken (OIDC token) to the GITHUB_ENV file if getOIDCToken is enabled, ensuring it's available for subsequent workflow steps.
Activity
  • No specific activity (comments, reviews, or progress updates) was provided in the context for this pull request.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new feature to fetch an OIDC token from ZTS along with the X.509 certificate for GitHub SIA, exporting it to the GITHUB_ENV file for GitHub Actions workflows. However, it contains a high-severity environment variable injection vulnerability and a medium-severity secret leakage issue due to improper handling of the GITHUB_ENV file and lack of secret masking.

log.Fatalf("OIDC Token not found in identity response")
}
// Open GITHUB_ENV in append mode, create if it doesn't exist
f, err := os.OpenFile(os.Getenv("GITHUB_ENV"), os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor comment: if "GITHUB_ENV" is not set, the information is indirectly shown to the user when OpenFile fails, and program exits.

may be, better to do a "" check and return a more direct message?

Signed-off-by: Henry Avetisyan <hga@yahooinc.com>
@psasidhar psasidhar merged commit 90f4a8b into master Mar 4, 2026
8 checks passed
@psasidhar psasidhar deleted the oidc-token branch March 4, 2026 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants