Skip to content

build(security): harden GitHub Actions workflows#2336

Merged
kevinmessiaen merged 4 commits intomainfrom
chore/gha-hardening
Mar 26, 2026
Merged

build(security): harden GitHub Actions workflows#2336
kevinmessiaen merged 4 commits intomainfrom
chore/gha-hardening

Conversation

@Hartorn
Copy link
Copy Markdown
Member

@Hartorn Hartorn commented Mar 25, 2026

Summary

  • Add zizmor CI workflow (pedantic persona, GHAS SARIF upload) for static security analysis of GitHub Actions
  • Harden all workflows: top-level permissions: {}, per-job grants with comments, persist-credentials: false, concurrency limits, job names
  • Switch PyPI publishing to trusted publishing (OIDC) — removes PIPY_USERNAME/PIPY_PASSWORD static credentials
  • Remove RELEASE_PAT_TOKEN dependency — use GITHUB_TOKEN with explicit remote URL for git push
  • Replace softprops/action-gh-release third-party action with gh release create
  • Add environment scoping (ci for integration tests, release for releases)
  • Set 7-day dependency update cooldown (Dependabot default-days: 7 + Renovate minimumReleaseAge: "7 days")
  • Add .github/CREDENTIALS.md documenting all secrets, environments, and pending cleanup

Before merging

  • Configure PyPI trusted publisher for giskard-core, giskard-agents, giskard-checks (Owner: Giskard-AI, Repo: giskard-oss, Workflow: release.yml, Environment: release)
  • Verify ci and release GitHub environments exist with the required secrets

After merging

  • Delete RELEASE_PAT_TOKEN from org secrets
  • Delete PIPY_USERNAME / PIPY_PASSWORD after confirming trusted publishing works
  • Review unused environments (github-pages, main, test) for removal
  • Update required status checks if branch protection references old job names

Made with Cursor

- Add zizmor CI workflow for static security analysis
- Set top-level permissions: {} on all workflows, per-job grants with comments
- Add persist-credentials: false to all checkout steps
- Add concurrency limits to pr-labeler and reset-safe-for-build-label
- Add job names to all anonymous jobs
- Replace softprops/action-gh-release with gh release create
- Switch to PyPI trusted publishing (OIDC), remove static credentials
- Remove RELEASE_PAT_TOKEN usage, use GITHUB_TOKEN instead
- Add environment scoping (ci, release) for secret access
- Set 7-day dependency update cooldown (Dependabot + Renovate)
- Add .github/CREDENTIALS.md documenting secrets and environments

Made-with: Cursor
@Hartorn Hartorn requested a review from a team as a code owner March 25, 2026 19:24
@Hartorn Hartorn requested a review from kevinmessiaen March 25, 2026 19:24
@github-advanced-security
Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@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 significantly enhances the security and maintainability of the project's GitHub Actions workflows. It transitions critical operations like PyPI publishing and git pushes to more secure, credential-less methods, introduces static security analysis for workflows, and standardizes dependency update policies. The changes aim to reduce attack surface, improve compliance, and provide clearer documentation for CI/CD configurations.

Highlights

  • Zizmor CI Workflow: Added a Zizmor CI workflow for static security analysis of GitHub Actions, including a pedantic persona and GHAS SARIF upload.
  • Workflow Hardening: Hardened all existing workflows by implementing top-level permissions: {}, per-job grants with comments, persist-credentials: false, concurrency limits, and standardized job names.
  • PyPI Trusted Publishing: Switched PyPI publishing to use trusted publishing (OIDC), eliminating the need for static PIPY_USERNAME/PIPY_PASSWORD credentials.
  • PAT Token Removal: Removed the dependency on RELEASE_PAT_TOKEN by utilizing GITHUB_TOKEN with an explicit remote URL for git push operations.
  • Release Action Replacement: Replaced the third-party softprops/action-gh-release action with the native gh release create command.
  • Environment Scoping: Introduced environment scoping, using ci for integration tests and release for releases.
  • Dependency Update Cooldown: Set a 7-day dependency update cooldown for both Dependabot (default-days: 7) and Renovate (minimumReleaseAge: "7 days").
  • Credentials Documentation: Added a .github/CREDENTIALS.md file to document all secrets, environments, and pending cleanup tasks.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Ignored Files
  • Ignored by pattern: .github/workflows/** (6)
    • .github/workflows/ci.yml
    • .github/workflows/integration-tests.yml
    • .github/workflows/pr-labeler.yml
    • .github/workflows/release.yml
    • .github/workflows/reset-safe-for-build-label.yml
    • .github/workflows/zizmor.yml
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.

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.

@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 significantly enhances the security posture and maintainability of the project's GitHub Actions workflows. It transitions credential management to more secure methods like OIDC and GITHUB_TOKEN, enforces stricter permissions, and introduces clearer documentation for secrets and environments. These changes aim to reduce reliance on static credentials, improve workflow robustness, and provide better visibility into CI/CD configurations.

Highlights

  • GitHub Actions Security Hardening: Implemented comprehensive security measures across all GitHub Actions workflows, including top-level permissions: {}, per-job grants, persist-credentials: false, concurrency limits, and explicit job naming.
  • Credential Management Overhaul: Transitioned PyPI publishing to trusted publishing (OIDC), eliminating static PIPY_USERNAME/PIPY_PASSWORD credentials. The RELEASE_PAT_TOKEN dependency was removed, with GITHUB_TOKEN now used for git pushes.
  • Workflow Tooling Updates: Replaced the softprops/action-gh-release third-party action with the native gh release create command for release management.
  • Environment Scoping: Introduced ci and release GitHub environments to provide better control and isolation for integration tests and package releases, respectively.
  • Dependency Update Cooldown: Configured a 7-day cooldown period for dependency updates in both Dependabot and Renovate to manage update frequency.
  • Documentation of Credentials: Added a new .github/CREDENTIALS.md file to centralize documentation of all secrets, environments, and pending cleanup tasks related to GitHub Actions.
  • Static Security Analysis Workflow: Introduced a new zizmor CI workflow for static security analysis of GitHub Actions configurations.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Ignored Files
  • Ignored by pattern: .github/workflows/** (6)
    • .github/workflows/ci.yml
    • .github/workflows/integration-tests.yml
    • .github/workflows/pr-labeler.yml
    • .github/workflows/release.yml
    • .github/workflows/reset-safe-for-build-label.yml
    • .github/workflows/zizmor.yml
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.

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 CREDENTIALS.md file to document GitHub Actions secrets, environments, and PyPI trusted publishing. It also configures a 7-day dependency update cooldown for both Dependabot and Renovate, and adds an empty zizmor.yml file. A review comment suggests improving consistency in the CREDENTIALS.md file by changing the 'CI' environment name to lowercase 'ci'.


| Environment | Purpose | Used by |
|---|---|---|
| `CI` | Integration/functional tests | `integration-tests.yml` |
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.

medium

For consistency with other environment names (release, github-pages, main, test) which are lowercase, consider changing CI to ci. This improves readability and adheres to a consistent naming convention within the documentation.

Suggested change
| `CI` | Integration/functional tests | `integration-tests.yml` |
| `ci` | Integration/functional tests | `integration-tests.yml` |

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 CREDENTIALS.md file documenting secrets and environments, configures a 7-day dependency update cooldown for Dependabot and Renovate, and adds a zizmor.yml file for static security analysis. The review points out a potential case sensitivity inconsistency for the CI environment name in CREDENTIALS.md and raises a concern about the effectiveness of the empty rules: {} block in zizmor.yml for security analysis.


| Environment | Purpose | Used by |
|---|---|---|
| `CI` | Integration/functional tests | `integration-tests.yml` |
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.

medium

The environment name CI is capitalized here, but the pull request description mentions ci (lowercase) for integration tests. GitHub Actions environment names are case-sensitive. Please ensure consistency between the documentation and the actual environment name configured in GitHub to avoid confusion or potential misconfigurations.

@@ -0,0 +1 @@
rules: {}
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.

medium

The zizmor.yml file is added for static security analysis, but it contains an empty rules: {} block. If zizmor requires explicit rules to perform meaningful security analysis, this configuration might not be effectively contributing to the workflow hardening objective as described in the PR title. Please ensure that the necessary rules are defined or clarify if rules: {} is intended to use default analysis rules.

@kevinmessiaen kevinmessiaen merged commit cad817a into main Mar 26, 2026
13 of 17 checks passed
@kevinmessiaen kevinmessiaen deleted the chore/gha-hardening branch March 26, 2026 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants