From da2d07eeb7fceaf2bc143c90d0a3a21593b40b1a Mon Sep 17 00:00:00 2001 From: PrimeBuild-pc Date: Mon, 23 Nov 2026 18:23:57 +0100 Subject: [PATCH 1/4] Integrate SignPath into Windows releases --- .github/workflows/check-release-secrets.yml | 28 +++ .github/workflows/release.yml | 214 +++++++++++++++++--- Installer/setup.iss | 2 + 3 files changed, 212 insertions(+), 32 deletions(-) diff --git a/.github/workflows/check-release-secrets.yml b/.github/workflows/check-release-secrets.yml index 32ce5a6..7056e1e 100644 --- a/.github/workflows/check-release-secrets.yml +++ b/.github/workflows/check-release-secrets.yml @@ -43,6 +43,34 @@ jobs: exit $missing + signing: + name: SignPath repository configuration + runs-on: ubuntu-latest + steps: + - name: Check the SignPath token and production policy + shell: bash + env: + SIGNPATH_API_TOKEN: ${{ secrets.SIGNPATH_API_TOKEN }} + SIGNPATH_SIGNING_POLICY_SLUG: ${{ vars.SIGNPATH_SIGNING_POLICY_SLUG }} + run: | + missing=0 + { + echo "## SignPath repository configuration" + if [ -n "$SIGNPATH_API_TOKEN" ]; then + echo "- SIGNPATH_API_TOKEN: present" + else + echo "- SIGNPATH_API_TOKEN: MISSING" + missing=1 + fi + if [ -n "$SIGNPATH_SIGNING_POLICY_SLUG" ] && [ "${SIGNPATH_SIGNING_POLICY_SLUG,,}" != "test-signing" ]; then + echo "- SIGNPATH_SIGNING_POLICY_SLUG: configured" + else + echo "- SIGNPATH_SIGNING_POLICY_SLUG: production policy required" + missing=1 + fi + } >> "$GITHUB_STEP_SUMMARY" + exit "$missing" + repository-secrets: name: Repository-level copies (MISSING once deleted) runs-on: ubuntu-latest diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d601275..36a5389 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,7 +7,7 @@ on: workflow_dispatch: inputs: dry_run_publish: - description: "Build and validate without publishing a GitHub release or WinGet update" + description: "Sign with the test certificate without publishing to GitHub, WinGet, or Chocolatey" required: false default: "true" type: choice @@ -27,6 +27,10 @@ jobs: build: # Match the Windows 11-era APIs exercised by the native integration tests. runs-on: windows-2025 + timeout-minutes: 90 + permissions: + actions: read + contents: read outputs: version: ${{ steps.version.outputs.version }} tag: ${{ steps.version.outputs.tag }} @@ -69,6 +73,27 @@ jobs: "version=$version" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append "tag=$tag" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append + - name: Resolve SignPath policy + id: signing + shell: pwsh + env: + TEST_SIGNING: ${{ github.event_name == 'workflow_dispatch' && inputs.dry_run_publish == 'true' }} + RELEASE_POLICY: ${{ vars.SIGNPATH_SIGNING_POLICY_SLUG }} + SIGNPATH_API_TOKEN: ${{ secrets.SIGNPATH_API_TOKEN }} + run: | + if ([string]::IsNullOrWhiteSpace($env:SIGNPATH_API_TOKEN)) { + throw "The SIGNPATH_API_TOKEN repository secret is required." + } + + $policy = $env:RELEASE_POLICY + if ($env:TEST_SIGNING -eq 'true') { + $policy = 'test-signing' + } elseif ([string]::IsNullOrWhiteSpace($policy) -or $policy -eq 'test-signing') { + throw "Set SIGNPATH_SIGNING_POLICY_SLUG to the approved production policy before publishing." + } + + "policy=$policy" >> $env:GITHUB_OUTPUT + - name: Restore run: dotnet restore "ThreadPilot_1.sln" @@ -79,10 +104,66 @@ jobs: run: dotnet test "Tests/ThreadPilot.Core.Tests/ThreadPilot.Core.Tests.csproj" --configuration Release --no-restore --verbosity normal --collect:"XPlat Code Coverage" --settings "Tests/ThreadPilot.Core.Tests/coverlet.runsettings" --results-directory TestResults - name: Publish self-contained single-file - run: dotnet publish "ThreadPilot.csproj" --configuration Release -p:PublishProfile=WinX64-SingleFile + env: + VERSION: ${{ steps.version.outputs.version }} + run: dotnet publish "ThreadPilot.csproj" --configuration Release -p:PublishProfile=WinX64-SingleFile "-p:InformationalVersion=$env:VERSION" -p:IncludeSourceRevisionInInformationalVersion=false - name: Publish ReadyToRun - run: dotnet publish "ThreadPilot.csproj" --configuration Release -p:PublishProfile=WinX64-ReadyToRun + env: + VERSION: ${{ steps.version.outputs.version }} + run: dotnet publish "ThreadPilot.csproj" --configuration Release -p:PublishProfile=WinX64-ReadyToRun "-p:InformationalVersion=$env:VERSION" -p:IncludeSourceRevisionInInformationalVersion=false + + - name: Package application binaries for signing + shell: pwsh + run: | + $staging = Join-Path $env:RUNNER_TEMP 'signpath' + New-Item -ItemType Directory -Force -Path "$staging/unsigned" | Out-Null + foreach ($profile in 'singlefile', 'readytorun') { + New-Item -ItemType Directory -Path "$staging/apps/$profile" -Force | Out-Null + Copy-Item -LiteralPath "artifacts/release/$profile/ThreadPilot.exe" -Destination "$staging/apps/$profile/" + } + Compress-Archive -Path "$staging/apps/*" -DestinationPath "$staging/unsigned/threadpilot-apps.zip" + + - name: Upload unsigned application binaries ZIP + id: unsigned-apps + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 + with: + path: ${{ runner.temp }}/signpath/unsigned/threadpilot-apps.zip + archive: false + if-no-files-found: error + + - name: Sign application binaries with SignPath + id: signed-apps + uses: signpath/github-action-submit-signing-request@a2c5b60d9c75f073142b653c354b632eedce097b # v3.2 + with: + api-token: ${{ secrets.SIGNPATH_API_TOKEN }} + organization-id: 5481e6eb-6003-4432-8c51-98f28c9d5c20 + project-slug: ThreadPilot + signing-policy-slug: ${{ steps.signing.outputs.policy }} + artifact-configuration-slug: windows-apps + github-artifact-id: ${{ steps.unsigned-apps.outputs.artifact-id }} + wait-for-completion: true + wait-for-completion-timeout-in-seconds: 1800 + output-artifact-directory: ${{ runner.temp }}/signpath/downloads/apps + skip-decompress: true + parameters: | + version: ${{ toJSON(steps.version.outputs.version) }} + + - name: Use signed application binaries + shell: pwsh + run: | + $staging = Join-Path $env:RUNNER_TEMP 'signpath' + New-Item -ItemType Directory -Force -Path "$staging/signed" | Out-Null + $archive = @(Get-ChildItem -LiteralPath "$staging/downloads/apps" -File -Filter '*.zip') + if ($archive.Count -ne 1) { + throw "Expected one signed apps ZIP, got $($archive.Count)." + } + $signedZip = "$staging/signed/threadpilot-apps.zip" + Copy-Item -LiteralPath $archive[0].FullName -Destination $signedZip + Expand-Archive -LiteralPath $signedZip -DestinationPath "$staging/signed-apps" + foreach ($profile in 'singlefile', 'readytorun') { + Copy-Item -LiteralPath "$staging/signed-apps/$profile/ThreadPilot.exe" -Destination "artifacts/release/$profile/" -Force + } - name: Install Inno Setup shell: pwsh @@ -97,46 +178,115 @@ jobs: & iscc.exe "/DMyAppVersion=$version" "/DMyAppSourceDir=$sourceDir" "Installer/setup.iss" - - name: Prepare signing certificate (optional) + - name: Package the installer for signing shell: pwsh + env: + TAG: ${{ steps.version.outputs.tag }} run: | - $ErrorActionPreference = "Stop" - if ([string]::IsNullOrWhiteSpace($env:WINDOWS_SIGNING_CERT_BASE64) -or [string]::IsNullOrWhiteSpace($env:WINDOWS_SIGNING_CERT_PASSWORD)) - { - Write-Host "Signing secrets not provided via environment variables. Skipping certificate preparation." - exit 0 - } + $staging = Join-Path $env:RUNNER_TEMP 'signpath' + Compress-Archive -LiteralPath "artifacts/release/installer/ThreadPilot_${env:TAG}_Setup.exe" -DestinationPath "$staging/unsigned/threadpilot-installer.zip" - $certPath = Join-Path $env:RUNNER_TEMP "threadpilot-signing.pfx" - [System.IO.File]::WriteAllBytes($certPath, [System.Convert]::FromBase64String($env:WINDOWS_SIGNING_CERT_BASE64)) - "THREADPILOT_SIGN_CERT_PATH=$certPath" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + - name: Upload unsigned installer ZIP + id: unsigned-installer + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 + with: + path: ${{ runner.temp }}/signpath/unsigned/threadpilot-installer.zip + archive: false + if-no-files-found: error - - name: Sign binaries and packages (optional) + - name: Sign installer with SignPath + id: signed-installer + uses: signpath/github-action-submit-signing-request@a2c5b60d9c75f073142b653c354b632eedce097b # v3.2 + with: + api-token: ${{ secrets.SIGNPATH_API_TOKEN }} + organization-id: 5481e6eb-6003-4432-8c51-98f28c9d5c20 + project-slug: ThreadPilot + signing-policy-slug: ${{ steps.signing.outputs.policy }} + artifact-configuration-slug: windows-installer + github-artifact-id: ${{ steps.unsigned-installer.outputs.artifact-id }} + wait-for-completion: true + wait-for-completion-timeout-in-seconds: 1800 + output-artifact-directory: ${{ runner.temp }}/signpath/downloads/installer + skip-decompress: true + parameters: | + version: ${{ toJSON(steps.version.outputs.version) }} + + - name: Use the signed installer and verify Authenticode shell: pwsh + env: + TAG: ${{ steps.version.outputs.tag }} + POLICY: ${{ steps.signing.outputs.policy }} + APPS_REQUEST: ${{ steps.signed-apps.outputs.signing-request-web-url }} + INSTALLER_REQUEST: ${{ steps.signed-installer.outputs.signing-request-web-url }} run: | - $ErrorActionPreference = "Stop" - if ([string]::IsNullOrWhiteSpace($env:THREADPILOT_SIGN_CERT_PATH) -or -not (Test-Path $env:THREADPILOT_SIGN_CERT_PATH)) - { - Write-Host "No signing certificate prepared. Skipping signing step." - exit 0 + $staging = Join-Path $env:RUNNER_TEMP 'signpath' + $archive = @(Get-ChildItem -LiteralPath "$staging/downloads/installer" -File -Filter '*.zip') + if ($archive.Count -ne 1) { + throw "Expected one signed installer ZIP, got $($archive.Count)." } + $signedZip = "$staging/signed/threadpilot-installer.zip" + Copy-Item -LiteralPath $archive[0].FullName -Destination $signedZip + Expand-Archive -LiteralPath $signedZip -DestinationPath "$staging/signed-installer" + $installer = "ThreadPilot_${env:TAG}_Setup.exe" + Copy-Item -LiteralPath "$staging/signed-installer/$installer" -Destination "artifacts/release/installer/" -Force + + $files = @( + 'artifacts/release/singlefile/ThreadPilot.exe' + 'artifacts/release/readytorun/ThreadPilot.exe' + "artifacts/release/installer/$installer" + ) - if (-not (Get-Command signtool.exe -ErrorAction SilentlyContinue)) - { - throw "signtool.exe not found on runner; install Windows SDK or disable signing." + # Trust only the pinned self-signed certificate for this verification step. + $store = $null + $addedCertificate = $null + try { + if ($env:POLICY -eq 'test-signing') { + $testThumbprint = '78B778434A5DAE1F58BE91AE237444AC55EF26BC' + $testCertificate = (Get-AuthenticodeSignature -LiteralPath $files[0]).SignerCertificate + if ($testCertificate.Thumbprint -ne $testThumbprint) { + throw "The application was not signed by the expected SignPath test certificate." + } + $store = [System.Security.Cryptography.X509Certificates.X509Store]::new('Root', 'CurrentUser') + $store.Open('ReadWrite') + if (-not ($store.Certificates | Where-Object Thumbprint -eq $testThumbprint)) { + $store.Add($testCertificate) + $addedCertificate = $testCertificate + } + } + + foreach ($file in $files) { + $signature = Get-AuthenticodeSignature -LiteralPath $file + if ($signature.Status -ne 'Valid') { + throw "Invalid Authenticode signature on ${file}: $($signature.StatusMessage)" + } + if ($env:POLICY -eq 'test-signing' -and $signature.SignerCertificate.Thumbprint -ne $testThumbprint) { + throw "Unexpected test certificate on $file." + } + if ($env:POLICY -ne 'test-signing' -and $signature.SignerCertificate.Subject -eq $signature.SignerCertificate.Issuer) { + throw "A self-signed certificate cannot be used for the public release: $file." + } + "- Verified $file ($($signature.SignerCertificate.Subject))" >> $env:GITHUB_STEP_SUMMARY + } + } finally { + if ($null -ne $addedCertificate) { + $store.Remove($addedCertificate) + } + if ($null -ne $store) { + $store.Dispose() + } } - $timestampUrl = "http://timestamp.digicert.com" - $password = $env:WINDOWS_SIGNING_CERT_PASSWORD - $targets = @() - $targets += Get-ChildItem "artifacts/release/singlefile" -Recurse -File -Include *.exe -ErrorAction SilentlyContinue - $targets += Get-ChildItem "artifacts/release/readytorun" -Recurse -File -Include *.exe -ErrorAction SilentlyContinue - $targets += Get-ChildItem "artifacts/release/installer" -Recurse -File -Include *.exe -ErrorAction SilentlyContinue + "- [Application signing request]($env:APPS_REQUEST)" >> $env:GITHUB_STEP_SUMMARY + "- [Installer signing request]($env:INSTALLER_REQUEST)" >> $env:GITHUB_STEP_SUMMARY - foreach ($target in $targets) - { - signtool.exe sign /fd SHA256 /tr $timestampUrl /td SHA256 /f "$env:THREADPILOT_SIGN_CERT_PATH" /p $password "$($target.FullName)" - } + - name: Upload signed ZIPs for test review + if: github.event_name == 'workflow_dispatch' && inputs.dry_run_publish == 'true' + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 + with: + name: signpath-signed-zips + path: ${{ runner.temp }}/signpath/signed/*.zip + if-no-files-found: error + compression-level: 0 - name: Create release packages shell: pwsh diff --git a/Installer/setup.iss b/Installer/setup.iss index e612544..ecdb0f8 100644 --- a/Installer/setup.iss +++ b/Installer/setup.iss @@ -22,6 +22,8 @@ AppId={{E8F7A3B2-5C4D-4E6F-8A9B-1C2D3E4F5A6B} AppName={#MyAppName} AppVersion={#MyAppVersion} +VersionInfoProductName={#MyAppName} +VersionInfoProductTextVersion={#MyAppVersion} AppVerName={#MyAppName} AppPublisher={#MyAppPublisher} AppPublisherURL={#MyAppURL} From 55735b06b192fde9a948f9812a0d7bd585087e2c Mon Sep 17 00:00:00 2001 From: PrimeBuild-pc Date: Mon, 23 Nov 2026 19:32:13 +0100 Subject: [PATCH 2/4] Normalize Inno Setup product metadata before signing --- .github/workflows/release.yml | 14 +++- build/normalize-installer-metadata.py | 101 ++++++++++++++++++++++++++ 2 files changed, 113 insertions(+), 2 deletions(-) create mode 100644 build/normalize-installer-metadata.py diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 36a5389..4cdd0bd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -184,7 +184,16 @@ jobs: TAG: ${{ steps.version.outputs.tag }} run: | $staging = Join-Path $env:RUNNER_TEMP 'signpath' - Compress-Archive -LiteralPath "artifacts/release/installer/ThreadPilot_${env:TAG}_Setup.exe" -DestinationPath "$staging/unsigned/threadpilot-installer.zip" + $installer = "artifacts/release/installer/ThreadPilot_${env:TAG}_Setup.exe" + python build/normalize-installer-metadata.py $installer $env:TAG.Substring(1) + if ($LASTEXITCODE -ne 0) { + throw "Could not normalize the installer metadata." + } + $versionInfo = (Get-Item -LiteralPath $installer).VersionInfo + if ($versionInfo.ProductName -cne 'ThreadPilot' -or $versionInfo.ProductVersion -cne $env:TAG.Substring(1)) { + throw "Unexpected product metadata on $installer." + } + Compress-Archive -LiteralPath $installer -DestinationPath "$staging/unsigned/threadpilot-installer.zip" - name: Upload unsigned installer ZIP id: unsigned-installer @@ -212,6 +221,7 @@ jobs: version: ${{ toJSON(steps.version.outputs.version) }} - name: Use the signed installer and verify Authenticode + timeout-minutes: 5 shell: pwsh env: TAG: ${{ steps.version.outputs.tag }} @@ -246,7 +256,7 @@ jobs: if ($testCertificate.Thumbprint -ne $testThumbprint) { throw "The application was not signed by the expected SignPath test certificate." } - $store = [System.Security.Cryptography.X509Certificates.X509Store]::new('Root', 'CurrentUser') + $store = [System.Security.Cryptography.X509Certificates.X509Store]::new('Root', 'LocalMachine') $store.Open('ReadWrite') if (-not ($store.Certificates | Where-Object Thumbprint -eq $testThumbprint)) { $store.Add($testCertificate) diff --git a/build/normalize-installer-metadata.py b/build/normalize-installer-metadata.py new file mode 100644 index 0000000..b66cbbd --- /dev/null +++ b/build/normalize-installer-metadata.py @@ -0,0 +1,101 @@ +"""Remove Inno Setup's space padding from the two PE strings SignPath checks.""" + +import argparse +import ctypes +from ctypes import wintypes +import mmap +from pathlib import Path +import struct + + +def find_resource_section(image): + pe_offset, = struct.unpack_from(" Date: Mon, 23 Nov 2026 21:16:17 +0100 Subject: [PATCH 3/4] Document the ThreadPilot code signing policy --- .github/workflows/release.yml | 2 ++ README.md | 4 ++-- docs/CODE_SIGNING_POLICY.md | 26 ++++++++++++++---------- docs/RELEASE_SIGNING.md | 38 +++++++++++++++-------------------- 4 files changed, 35 insertions(+), 35 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4cdd0bd..1627cde 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -584,6 +584,8 @@ jobs: git-cliff --config cliff.toml --latest > release-notes.md fi + printf '\n\n[Code signing policy](https://github.com/PrimeBuild-pc/ThreadPilot/blob/main/docs/CODE_SIGNING_POLICY.md)\n' >> release-notes.md + { echo "content<_Portable.zip -Algorithm SHA256 Compare the result with `SHA256SUMS.txt` from the same release. +See the [Code signing policy](docs/CODE_SIGNING_POLICY.md) for the signing provider, maintainer approvals, and how to verify signatures. + ## 🖼️ Screenshots Real captures of ThreadPilot v1.7.9 (see [`assets/screenshots/README.md`](assets/screenshots/README.md)). They show the interface, not benchmarks. Click a thumbnail for the full-size image. @@ -252,8 +254,6 @@ Build release artifacts with the project script: - CI validates build, formatting, analyzers, vulnerability checks, and secret scanning. - Security disclosures are handled through private GitHub advisories. See [`docs/SECURITY.md`](docs/SECURITY.md). - ThreadPilot has no analytics or telemetry. See [`docs/PRIVACY.md`](docs/PRIVACY.md). -- Release signing scope and controls are documented in [`docs/CODE_SIGNING_POLICY.md`](docs/CODE_SIGNING_POLICY.md). -- Free code signing provided by [SignPath.io](https://signpath.io), certificate by [SignPath Foundation](https://signpath.org), once the pending application is approved; current artifacts are unsigned. - Change history is tracked in [`docs/CHANGELOG.md`](docs/CHANGELOG.md). - Coverage focuses on business/application code and excludes generated build artifacts. diff --git a/docs/CODE_SIGNING_POLICY.md b/docs/CODE_SIGNING_POLICY.md index 3770320..db6c9d8 100644 --- a/docs/CODE_SIGNING_POLICY.md +++ b/docs/CODE_SIGNING_POLICY.md @@ -1,30 +1,30 @@ -# Code-Signing Policy +# Code signing policy Free code signing provided by [SignPath.io](https://signpath.io), certificate by [SignPath Foundation](https://signpath.org). -ThreadPilot releases remain unsigned until the SignPath Foundation application is approved and the integration is enabled. +Published ThreadPilot releases are currently unsigned. The GitHub Actions integration has been tested with a self-signed SignPath certificate. Production signing starts after SignPath Foundation issues the release certificate and the integration is enabled. ## Scope -Only official ThreadPilot release executables and installers produced from the public GitHub repository may be signed. Pull-request builds, local builds, forks, scripts, and third-party binaries are not signed by the project. +Production signing covers the ThreadPilot Windows executable and Inno Setup installer built from the official public GitHub repository. The portable ZIP contains the signed executable. Third-party binaries and scripts are outside the signing configuration. ## Authorized releases -- A signed build must originate from a protected release tag in the official repository. +- A production release must originate from a protected release tag in the official repository. - The commit must pass the repository's required build, test, analyzer, and packaging checks. - Signing requests must be created by the GitHub release workflow through the approved SignPath integration. -- Maintainer or SignPath approval is required wherever configured by the signing policy. +- A maintainer manually approves each production signing request. - Checksums are generated only after signing and are published with the release. ## Team roles and approval -The current repository team consists of one maintainer: +The following roles apply to production release signing: -- **Authors:** `@PrimeBuild-pc` may contribute directly to the official repository. -- **Reviewers:** `@PrimeBuild-pc` reviews contributions from people who are not Authors. -- **Approvers:** `@PrimeBuild-pc` manually approves or rejects every SignPath signing request. +- **Authors:** [PrimeBuild-pc](https://github.com/PrimeBuild-pc) maintains the release source and build workflow. +- **Reviewers:** [PrimeBuild-pc](https://github.com/PrimeBuild-pc) reviews changes proposed by other contributors. +- **Approvers:** [PrimeBuild-pc](https://github.com/PrimeBuild-pc) approves or rejects production signing requests in SignPath. -No signing request is auto-approved. If another maintainer is added, this section and `.github/CODEOWNERS` must be updated before granting repository or SignPath access. A person must not approve an unreviewed artifact whose source they cannot trace to the approved release commit. +Production requests require manual approval. The separate test policy uses a self-signed certificate for workflow validation. A person must not approve an artifact whose source they cannot trace to the approved release commit. ## Account security @@ -32,7 +32,11 @@ Every Author, Reviewer, and Approver must enable multi-factor authentication on ## Key protection -ThreadPilot maintainers do not download, export, or commit the signing private key. SignPath controls the signing key. Integration credentials are restricted to a protected GitHub environment and are never exposed to pull requests from forks. +SignPath holds the signing key. GitHub Actions stores the token for the SignPath CI user as a repository secret. Signing requests use GitHub's trusted build integration to verify the artifact's origin. + +## Privacy + +See the [ThreadPilot privacy policy](PRIVACY.md) for what is stored locally and how update requests reach GitHub. ## Verification and transparency diff --git a/docs/RELEASE_SIGNING.md b/docs/RELEASE_SIGNING.md index 6d79ed5..c790bb2 100644 --- a/docs/RELEASE_SIGNING.md +++ b/docs/RELEASE_SIGNING.md @@ -1,33 +1,27 @@ -# Release Signing Guide +# Release signing guide -ThreadPilot releases are currently unsigned. An application for SignPath Foundation code signing is pending; the release workflow remains fully automated and unchanged until the project is approved. +ThreadPilot's public releases are currently unsigned. The SignPath integration has passed a `workflow_dispatch` run with the self-signed test certificate. The production certificate is pending SignPath Foundation review. -## Intended signing model +## Validate test signing -- Sign the published executable and installer with Authenticode through SignPath. -- Use the publisher identity assigned by SignPath Foundation. -- Submit signing requests only from the protected GitHub release workflow. -- Keep SignPath project identifiers and organization secrets in GitHub environment secrets. -- Require an explicit SignPath approval when the selected policy requires it. +1. Dispatch the GitHub **Release** workflow with `dry_run_publish=true`. +2. Check the two SignPath requests for the application binaries and Inno Setup installer. The workflow packages the signed executable into the installer and portable ZIP, then calculates the published SHA-256 checksums. +3. Check Authenticode verification and the smoke test in the run summary. The `signpath-signed-zips` Actions artifact contains the two ZIPs returned by SignPath. -Signing will be inserted between artifact creation and checksum generation. Builds, tests, packaging, GitHub Release creation, and artifact upload remain automated; no private certificate or PFX will be stored in the repository or on a GitHub runner. +The workflow uses the `SIGNPATH_API_TOKEN` repository secret for the SignPath CI user. Test mode skips GitHub and WinGet publication. Chocolatey uses its own workflow. -## Status and rollout +## Enable production signing -1. Complete the SignPath Foundation application. -2. Wait for approval and the SignPath organization/project invitation. -3. Configure the SignPath project and trusted build policy. -4. Add the identifiers and token supplied by SignPath as protected GitHub secrets. -5. Integrate signing on a separate change and test it with a prerelease tag. -6. Verify the Authenticode publisher, timestamp, checksums, and installer before publishing a stable release. +1. After SignPath Foundation activates the release certificate, set the GitHub Actions repository variable `SIGNPATH_SIGNING_POLICY_SLUG` to `release-signing`. The production workflow requires this configuration and verifies the signatures before publication. +2. Use the repository's verified merge and release process to prepare the release tag. +3. Review and approve the application and installer requests in SignPath as they appear. The installer uses the signed application from the first request. +4. Approve publishing through the protected GitHub `release` environment after verifying the release tag and artifacts. -Until those steps are complete, release artifacts must be described as unsigned. Do not enable the legacy PFX signing path without a separately acquired certificate and a reviewed secret-storage procedure. - -## Verification +## Verify a published artifact ```powershell -Get-AuthenticodeSignature .\ThreadPilot.exe -Get-FileHash .\ThreadPilot.exe -Algorithm SHA256 +Get-AuthenticodeSignature .\ThreadPilot_v1.2.3_Setup.exe +Get-FileHash .\ThreadPilot_v1.2.3_Setup.exe -Algorithm SHA256 ``` -See the public [code-signing policy](CODE_SIGNING_POLICY.md) for scope, approvals, and incident handling. +Compare the hash with `SHA256SUMS.txt` from the same release. See the [Code signing policy](CODE_SIGNING_POLICY.md) for the signing scope and team roles. From d4fc7d2a5d4b07f1d6fc88322d868cb39a2a7de8 Mon Sep 17 00:00:00 2001 From: PrimeBuild Date: Sat, 28 Nov 2026 13:59:45 +0100 Subject: [PATCH 4/4] docs: separate public signing policy from workflow activation --- README.md | 4 ++-- docs/CODE_SIGNING_POLICY.md | 26 +++++++++++-------------- docs/RELEASE_SIGNING.md | 38 +++++++++++++++++++++---------------- 3 files changed, 35 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index 4453c0c..4075ff1 100644 --- a/README.md +++ b/README.md @@ -160,8 +160,6 @@ Cleanup retains shared data when it detects another distribution. It also retain Compare the result with `SHA256SUMS.txt` from the same release. -See the [Code signing policy](docs/CODE_SIGNING_POLICY.md) for the signing provider, maintainer approvals, and how to verify signatures. - ## 🖼️ Screenshots Real captures of ThreadPilot v1.7.9 (see [`assets/screenshots/README.md`](assets/screenshots/README.md)). They show the interface, not benchmarks. Click a thumbnail for the full-size image. @@ -285,6 +283,8 @@ Build release artifacts with the project script: - CI validates build, formatting, analyzers, vulnerability checks, and secret scanning. - Security disclosures are handled through private GitHub advisories. See [`docs/SECURITY.md`](docs/SECURITY.md). - ThreadPilot has no analytics or telemetry. See [`docs/PRIVACY.md`](docs/PRIVACY.md). +- Release signing scope and controls are documented in [`docs/CODE_SIGNING_POLICY.md`](docs/CODE_SIGNING_POLICY.md). +- Free code signing provided by [SignPath.io](https://signpath.io), certificate by [SignPath Foundation](https://signpath.org), once the pending application is approved; current artifacts are unsigned. - Change history is tracked in [`docs/CHANGELOG.md`](docs/CHANGELOG.md). - Coverage focuses on business/application code and excludes generated build artifacts. diff --git a/docs/CODE_SIGNING_POLICY.md b/docs/CODE_SIGNING_POLICY.md index db6c9d8..3770320 100644 --- a/docs/CODE_SIGNING_POLICY.md +++ b/docs/CODE_SIGNING_POLICY.md @@ -1,30 +1,30 @@ -# Code signing policy +# Code-Signing Policy Free code signing provided by [SignPath.io](https://signpath.io), certificate by [SignPath Foundation](https://signpath.org). -Published ThreadPilot releases are currently unsigned. The GitHub Actions integration has been tested with a self-signed SignPath certificate. Production signing starts after SignPath Foundation issues the release certificate and the integration is enabled. +ThreadPilot releases remain unsigned until the SignPath Foundation application is approved and the integration is enabled. ## Scope -Production signing covers the ThreadPilot Windows executable and Inno Setup installer built from the official public GitHub repository. The portable ZIP contains the signed executable. Third-party binaries and scripts are outside the signing configuration. +Only official ThreadPilot release executables and installers produced from the public GitHub repository may be signed. Pull-request builds, local builds, forks, scripts, and third-party binaries are not signed by the project. ## Authorized releases -- A production release must originate from a protected release tag in the official repository. +- A signed build must originate from a protected release tag in the official repository. - The commit must pass the repository's required build, test, analyzer, and packaging checks. - Signing requests must be created by the GitHub release workflow through the approved SignPath integration. -- A maintainer manually approves each production signing request. +- Maintainer or SignPath approval is required wherever configured by the signing policy. - Checksums are generated only after signing and are published with the release. ## Team roles and approval -The following roles apply to production release signing: +The current repository team consists of one maintainer: -- **Authors:** [PrimeBuild-pc](https://github.com/PrimeBuild-pc) maintains the release source and build workflow. -- **Reviewers:** [PrimeBuild-pc](https://github.com/PrimeBuild-pc) reviews changes proposed by other contributors. -- **Approvers:** [PrimeBuild-pc](https://github.com/PrimeBuild-pc) approves or rejects production signing requests in SignPath. +- **Authors:** `@PrimeBuild-pc` may contribute directly to the official repository. +- **Reviewers:** `@PrimeBuild-pc` reviews contributions from people who are not Authors. +- **Approvers:** `@PrimeBuild-pc` manually approves or rejects every SignPath signing request. -Production requests require manual approval. The separate test policy uses a self-signed certificate for workflow validation. A person must not approve an artifact whose source they cannot trace to the approved release commit. +No signing request is auto-approved. If another maintainer is added, this section and `.github/CODEOWNERS` must be updated before granting repository or SignPath access. A person must not approve an unreviewed artifact whose source they cannot trace to the approved release commit. ## Account security @@ -32,11 +32,7 @@ Every Author, Reviewer, and Approver must enable multi-factor authentication on ## Key protection -SignPath holds the signing key. GitHub Actions stores the token for the SignPath CI user as a repository secret. Signing requests use GitHub's trusted build integration to verify the artifact's origin. - -## Privacy - -See the [ThreadPilot privacy policy](PRIVACY.md) for what is stored locally and how update requests reach GitHub. +ThreadPilot maintainers do not download, export, or commit the signing private key. SignPath controls the signing key. Integration credentials are restricted to a protected GitHub environment and are never exposed to pull requests from forks. ## Verification and transparency diff --git a/docs/RELEASE_SIGNING.md b/docs/RELEASE_SIGNING.md index c790bb2..6d79ed5 100644 --- a/docs/RELEASE_SIGNING.md +++ b/docs/RELEASE_SIGNING.md @@ -1,27 +1,33 @@ -# Release signing guide +# Release Signing Guide -ThreadPilot's public releases are currently unsigned. The SignPath integration has passed a `workflow_dispatch` run with the self-signed test certificate. The production certificate is pending SignPath Foundation review. +ThreadPilot releases are currently unsigned. An application for SignPath Foundation code signing is pending; the release workflow remains fully automated and unchanged until the project is approved. -## Validate test signing +## Intended signing model -1. Dispatch the GitHub **Release** workflow with `dry_run_publish=true`. -2. Check the two SignPath requests for the application binaries and Inno Setup installer. The workflow packages the signed executable into the installer and portable ZIP, then calculates the published SHA-256 checksums. -3. Check Authenticode verification and the smoke test in the run summary. The `signpath-signed-zips` Actions artifact contains the two ZIPs returned by SignPath. +- Sign the published executable and installer with Authenticode through SignPath. +- Use the publisher identity assigned by SignPath Foundation. +- Submit signing requests only from the protected GitHub release workflow. +- Keep SignPath project identifiers and organization secrets in GitHub environment secrets. +- Require an explicit SignPath approval when the selected policy requires it. -The workflow uses the `SIGNPATH_API_TOKEN` repository secret for the SignPath CI user. Test mode skips GitHub and WinGet publication. Chocolatey uses its own workflow. +Signing will be inserted between artifact creation and checksum generation. Builds, tests, packaging, GitHub Release creation, and artifact upload remain automated; no private certificate or PFX will be stored in the repository or on a GitHub runner. -## Enable production signing +## Status and rollout -1. After SignPath Foundation activates the release certificate, set the GitHub Actions repository variable `SIGNPATH_SIGNING_POLICY_SLUG` to `release-signing`. The production workflow requires this configuration and verifies the signatures before publication. -2. Use the repository's verified merge and release process to prepare the release tag. -3. Review and approve the application and installer requests in SignPath as they appear. The installer uses the signed application from the first request. -4. Approve publishing through the protected GitHub `release` environment after verifying the release tag and artifacts. +1. Complete the SignPath Foundation application. +2. Wait for approval and the SignPath organization/project invitation. +3. Configure the SignPath project and trusted build policy. +4. Add the identifiers and token supplied by SignPath as protected GitHub secrets. +5. Integrate signing on a separate change and test it with a prerelease tag. +6. Verify the Authenticode publisher, timestamp, checksums, and installer before publishing a stable release. -## Verify a published artifact +Until those steps are complete, release artifacts must be described as unsigned. Do not enable the legacy PFX signing path without a separately acquired certificate and a reviewed secret-storage procedure. + +## Verification ```powershell -Get-AuthenticodeSignature .\ThreadPilot_v1.2.3_Setup.exe -Get-FileHash .\ThreadPilot_v1.2.3_Setup.exe -Algorithm SHA256 +Get-AuthenticodeSignature .\ThreadPilot.exe +Get-FileHash .\ThreadPilot.exe -Algorithm SHA256 ``` -Compare the hash with `SHA256SUMS.txt` from the same release. See the [Code signing policy](CODE_SIGNING_POLICY.md) for the signing scope and team roles. +See the public [code-signing policy](CODE_SIGNING_POLICY.md) for scope, approvals, and incident handling.