Skip to content

SLSA fix #468

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

SLSA fix #468

wants to merge 1 commit into from

Conversation

amilcarlucas
Copy link
Collaborator

This pull request updates the .github/workflows/windows_build.yml file to enhance build provenance generation, improve debugging, and update dependencies. It introduces new steps for handling SLSA provenance files, adds debugging for GitHub token and permissions, and upgrades the SLSA verifier version. Additionally, it includes fallback mechanisms for provenance generation and verification to improve reliability.

Enhancements to Build Provenance and Verification:

  • Added a step to generate SLSA provenance using the actions/attest-build-provenance@v2.3.0 action, ensuring provenance is created for the build artifacts ([.github/workflows/windows_build.ymlR107-R116](https://github.com/ArduPilot/MethodicConfigurator/pull/468/files#diff-4f99d7a5ccc527af64c0d4fca4d4065b5400c04c60f188181d532fcbc0a5af8eR107-R116)).
  • Implemented fallback logic to create a custom SLSA provenance file if the generator action fails, ensuring builds are not blocked ([.github/workflows/windows_build.ymlL106-R441](https://github.com/ArduPilot/MethodicConfigurator/pull/468/files#diff-4f99d7a5ccc527af64c0d4fca4d4065b5400c04c60f188181d532fcbc0a5af8eL106-R441)).
  • Enhanced the SLSA verification step with improved error handling, fallback to basic hash verification, and debugging for provenance file content ([.github/workflows/windows_build.ymlL106-R441](https://github.com/ArduPilot/MethodicConfigurator/pull/468/files#diff-4f99d7a5ccc527af64c0d4fca4d4065b5400c04c60f188181d532fcbc0a5af8eL106-R441)).

Debugging and Permissions:

  • Added a step to debug GitHub token and permissions, including checks for token availability and repository context (e.g., forked repositories) ([.github/workflows/windows_build.ymlR84-R98](https://github.com/ArduPilot/MethodicConfigurator/pull/468/files#diff-4f99d7a5ccc527af64c0d4fca4d4065b5400c04c60f188181d532fcbc0a5af8eR84-R98)).

Dependency Updates:

  • Updated the SLSA verifier version from v2.5.1 to v2.7.0 and added verification for successful downloads ([.github/workflows/windows_build.ymlL106-R441](https://github.com/ArduPilot/MethodicConfigurator/pull/468/files#diff-4f99d7a5ccc527af64c0d4fca4d4065b5400c04c60f188181d532fcbc0a5af8eL106-R441)).

Reliability Improvements:

  • Replaced direct echo commands with Out-File to ensure consistent file encoding and appending behavior ([.github/workflows/windows_build.ymlL106-R441](https://github.com/ArduPilot/MethodicConfigurator/pull/468/files#diff-4f99d7a5ccc527af64c0d4fca4d4065b5400c04c60f188181d532fcbc0a5af8eL106-R441)).

These changes collectively improve the security, reliability, and maintainability of the Windows build workflow.

@Copilot Copilot AI review requested due to automatic review settings May 5, 2025 12:07
Copy link
Contributor

@Copilot 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 improves the Windows build workflow by enhancing build provenance generation, debugging, and SLSA verification reliability.

  • Added new permissions and debug steps for GitHub token and repository context
  • Upgraded the SLSA verifier version and introduced fallback logic for provenance generation and verification

$fileHash = (Get-FileHash -Algorithm SHA256 $_.FullName).Hash.ToLower()
Write-Host "File hash: $fileHash"

if (-not $useBasicVerification) {
Copy link
Preview

Copilot AI May 5, 2025

Choose a reason for hiding this comment

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

Consider initializing $useBasicVerification to false before its usage (e.g., before the try block) to improve code clarity and avoid potential ambiguity in the verification logic.

Copilot uses AI. Check for mistakes.

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.

1 participant