Skip to content

fix: harden GitHub Actions against supply chain attacks#2

Closed
CybotTM wants to merge 1 commit intomainfrom
fix/harden-github-actions
Closed

fix: harden GitHub Actions against supply chain attacks#2
CybotTM wants to merge 1 commit intomainfrom
fix/harden-github-actions

Conversation

@CybotTM
Copy link
Member

@CybotTM CybotTM commented Mar 20, 2026

Summary

  • Pin all GitHub Actions references to immutable commit SHAs (prevents tag/branch force-push attacks)
  • Add Dependabot configuration for automatic GitHub Actions version updates

Context

On 2026-03-19, aquasecurity/trivy-action was compromised via a tag force-push attack that exfiltrated secrets from CI runners. SHA-pinning prevents this class of attack entirely.

The netresearch org now enforces sha_pinning_required=true — workflows using tag/branch references will fail.

Ref: netresearch/ofelia#535

Test plan

  • Verify CI passes with SHA-pinned actions
  • Verify Dependabot creates PRs for action updates

This hardens the repository against supply chain attacks like the
aquasecurity/trivy-action compromise (2026-03-19).

Changes:
- Pin all GitHub Actions to immutable commit SHAs
- Add/update Dependabot configuration for github-actions ecosystem

Ref: netresearch/ofelia#535
Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
Copilot AI review requested due to automatic review settings March 20, 2026 19:21
@gemini-code-assist
Copy link

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 security of GitHub Actions workflows by pinning action references to specific commit SHAs, mitigating the risk of supply chain attacks. It also configures Dependabot for automatic action updates and enforces organizational security policies.

Highlights

  • Security Hardening: This PR pins GitHub Actions references to immutable commit SHAs to prevent against tag/branch force-push attacks, addressing a critical supply chain security concern.
  • Dependabot Configuration: It introduces a Dependabot configuration for automatic updates of GitHub Actions versions, ensuring timely security updates.
  • Organizational Policy: The changes align with the netresearch organization's policy of enforcing sha_pinning_required=true, which will cause workflows using tag/branch references to fail if not updated.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/documentation.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

@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 adds a Dependabot configuration for GitHub Actions. The configuration is a good start, but I've suggested an improvement to better manage version updates by separating major releases. More importantly, the PR description mentions pinning actions to commit SHAs, but those changes are not present. To fully address the security concerns, the action pinning changes should be included in this PR.

Comment on lines +9 to +10
patterns:
- "*"

Choose a reason for hiding this comment

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

medium

Consider specifying update-types within your group to separate major version updates from minor and patch updates. Grouping all updates together can be problematic if a breaking change in one action's major update blocks the deployment of a simple patch for another. By creating separate PRs for major updates, you can handle them with more care and review them more thoroughly.

        patterns:
          - "*"
        update-types:
          - "minor"
          - "patch"

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR hardens the repository’s GitHub Actions setup against tag/branch force-push supply chain attacks by switching to immutable action references and enabling automated upkeep via Dependabot.

Changes:

  • Pin actions/checkout in the documentation workflow to a commit SHA.
  • Add a Dependabot configuration to check for GitHub Actions updates weekly (with grouping enabled).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
.github/workflows/documentation.yml Replaces the actions/checkout@v4 tag reference with a pinned commit SHA to prevent tag force-push attacks.
.github/dependabot.yml Adds Dependabot config to automate GitHub Actions update PRs on a weekly schedule.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@CybotTM
Copy link
Member Author

CybotTM commented Mar 21, 2026

Closing: fork, not actively maintained.

@CybotTM CybotTM closed this Mar 21, 2026
@CybotTM CybotTM deleted the fix/harden-github-actions branch March 21, 2026 09:32
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