SQSCANGHA-140 Add OpenPGP signature verification for scanner downloads#235
Conversation
8e8e609 to
0105a37
Compare
SummaryThis PR adds OpenPGP signature verification for downloaded Sonar Scanner CLI binaries, enabling supply chain security validation. When a binary is downloaded, the action now automatically fetches and validates its detached signature ( Key behavior:
The implementation handles cross-platform specifics (Windows path conversion for GPG), creates isolated temporary GPG home directories, and cleans up properly. Tests cover both happy path and error scenarios with comprehensive mocking. What reviewers should knowStart here: Review Flow to follow:
Important details:
Dependencies:
|
SonarQube Remediation AgentSonarQube found 1 issue in this PR that the agent can fix for you. Est. time saved: ~5 min 1 issue found
|
cde6998 to
4964834
Compare
4964834 to
3ea526d
Compare
Implemented OpenPGP signature verification to ensure the integrity and authenticity of downloaded SonarQube scanner packages. This security enhancement protects against supply chain attacks. Key implementation decisions: - GPG verification runs by default for all scanner downloads, with an optional skipSignatureVerification flag for environments where GPG is unavailable - Dual keyserver strategy: attempts primary keyserver (keyserver.ubuntu.com) with automatic fallback to keys.openpgp.org if the primary fails, improving reliability across different network environments - Platform-specific path handling: converts Windows paths to Unix-style format for GPG compatibility, as GPG from Git for Windows expects Unix-style paths even on Windows systems - Isolated verification: uses temporary GPG home directories to avoid polluting user keyring, with guaranteed cleanup in finally blocks to prevent temp file leakage even on verification failures - Security-first error handling: throws clear errors when GPG is absent or signatures fail, preventing silent security bypasses Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>"
ed2a160 to
e1c6b57
Compare
|
There was a problem hiding this comment.
Clean implementation overall. The security model — isolated ephemeral keyring, import by full 40-char fingerprint, then verify — is correct and well-suited for CI use. The cross-platform path handling, keyserver fallback, and cleanup-on-failure are all handled properly. One test maintenance issue worth fixing.
|
@claire-villard-sonarsource This is a breaking change if the runner does not have |
|
Yes, this is a breaking change. Please revert and consider to add on 8.0.0? |
|
suggestion: set default for |
…avoid breaking change Address SonarSource#235 (comment)
…(#8) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [SonarSource/sonarqube-scan-action](https://github.com/SonarSource/sonarqube-scan-action) | action | minor | `v7.1.0` → `v7.2` | --- ### Release Notes <details> <summary>SonarSource/sonarqube-scan-action (SonarSource/sonarqube-scan-action)</summary> ### [`v7.2`](SonarSource/sonarqube-scan-action@v7.2.0...v7.2.0) [Compare Source](SonarSource/sonarqube-scan-action@v7.2.0...v7.2.0) ### [`v7.2.0`](https://github.com/SonarSource/sonarqube-scan-action/releases/tag/v7.2.0) [Compare Source](SonarSource/sonarqube-scan-action@v7.1.0...v7.2.0) #### What's Changed - SQSCANGHA-133 Upgrade the Node version used in UTs + contribution guide by [@​claire-villard-sonarsource](https://github.com/claire-villard-sonarsource) in [#​226](SonarSource/sonarqube-scan-action#226) - SC-45750 Migrate to dateless license headers by [@​claire-villard-sonarsource](https://github.com/claire-villard-sonarsource) in [#​229](SonarSource/sonarqube-scan-action#229) - SQSCANGHA-134 Upgrade the libraries to latest version by [@​claire-villard-sonarsource](https://github.com/claire-villard-sonarsource) in [#​227](SonarSource/sonarqube-scan-action#227) - SQSCANGHA-138 Update dist and add ci test by [@​antoine-vinot-sonarsource](https://github.com/antoine-vinot-sonarsource) in [#​233](SonarSource/sonarqube-scan-action#233) - SQSCANGHA-140 Add OpenPGP signature verification for scanner downloads by [@​claire-villard-sonarsource](https://github.com/claire-villard-sonarsource) in [#​235](SonarSource/sonarqube-scan-action#235) **Full Changelog**: <SonarSource/sonarqube-scan-action@v7...v7.2.0> </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xNTAuMCIsInVwZGF0ZWRJblZlciI6IjQzLjE1MC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJ0eXBlL2RlcGVuZGVuY2llcyJdfQ==--> Reviewed-on: https://git.tainton.uk/repos/epage-go/pulls/8 Co-authored-by: renovate[bot] <renovate-bot@git.tainton.uk> Co-committed-by: renovate[bot] <renovate-bot@git.tainton.uk>
…(#440) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [SonarSource/sonarqube-scan-action](https://github.com/SonarSource/sonarqube-scan-action) | action | minor | `v7.1.0` → `v7.2` | --- ### Release Notes <details> <summary>SonarSource/sonarqube-scan-action (SonarSource/sonarqube-scan-action)</summary> ### [`v7.2`](SonarSource/sonarqube-scan-action@v7.2.0...v7.2.0) [Compare Source](SonarSource/sonarqube-scan-action@v7.2.0...v7.2.0) ### [`v7.2.0`](https://github.com/SonarSource/sonarqube-scan-action/releases/tag/v7.2.0) [Compare Source](SonarSource/sonarqube-scan-action@v7.1.0...v7.2.0) #### What's Changed - SQSCANGHA-133 Upgrade the Node version used in UTs + contribution guide by [@​claire-villard-sonarsource](https://github.com/claire-villard-sonarsource) in [#​226](SonarSource/sonarqube-scan-action#226) - SC-45750 Migrate to dateless license headers by [@​claire-villard-sonarsource](https://github.com/claire-villard-sonarsource) in [#​229](SonarSource/sonarqube-scan-action#229) - SQSCANGHA-134 Upgrade the libraries to latest version by [@​claire-villard-sonarsource](https://github.com/claire-villard-sonarsource) in [#​227](SonarSource/sonarqube-scan-action#227) - SQSCANGHA-138 Update dist and add ci test by [@​antoine-vinot-sonarsource](https://github.com/antoine-vinot-sonarsource) in [#​233](SonarSource/sonarqube-scan-action#233) - SQSCANGHA-140 Add OpenPGP signature verification for scanner downloads by [@​claire-villard-sonarsource](https://github.com/claire-villard-sonarsource) in [#​235](SonarSource/sonarqube-scan-action#235) **Full Changelog**: <SonarSource/sonarqube-scan-action@v7...v7.2.0> </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xNTAuMCIsInVwZGF0ZWRJblZlciI6IjQzLjE1MC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJ0eXBlL2RlcGVuZGVuY2llcyJdfQ==--> Reviewed-on: https://git.tainton.uk/repos/pypilot/pulls/440 Co-authored-by: renovate[bot] <renovate-bot@git.tainton.uk> Co-committed-by: renovate[bot] <renovate-bot@git.tainton.uk>
…(#445) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [SonarSource/sonarqube-scan-action](https://github.com/SonarSource/sonarqube-scan-action) | action | minor | `v7.1.0` → `v7.2` | --- ### Release Notes <details> <summary>SonarSource/sonarqube-scan-action (SonarSource/sonarqube-scan-action)</summary> ### [`v7.2`](SonarSource/sonarqube-scan-action@v7.2.0...v7.2.0) [Compare Source](SonarSource/sonarqube-scan-action@v7.2.0...v7.2.0) ### [`v7.2.0`](https://github.com/SonarSource/sonarqube-scan-action/releases/tag/v7.2.0) [Compare Source](SonarSource/sonarqube-scan-action@v7.1.0...v7.2.0) #### What's Changed - SQSCANGHA-133 Upgrade the Node version used in UTs + contribution guide by [@​claire-villard-sonarsource](https://github.com/claire-villard-sonarsource) in [#​226](SonarSource/sonarqube-scan-action#226) - SC-45750 Migrate to dateless license headers by [@​claire-villard-sonarsource](https://github.com/claire-villard-sonarsource) in [#​229](SonarSource/sonarqube-scan-action#229) - SQSCANGHA-134 Upgrade the libraries to latest version by [@​claire-villard-sonarsource](https://github.com/claire-villard-sonarsource) in [#​227](SonarSource/sonarqube-scan-action#227) - SQSCANGHA-138 Update dist and add ci test by [@​antoine-vinot-sonarsource](https://github.com/antoine-vinot-sonarsource) in [#​233](SonarSource/sonarqube-scan-action#233) - SQSCANGHA-140 Add OpenPGP signature verification for scanner downloads by [@​claire-villard-sonarsource](https://github.com/claire-villard-sonarsource) in [#​235](SonarSource/sonarqube-scan-action#235) **Full Changelog**: <SonarSource/sonarqube-scan-action@v7...v7.2.0> </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xNTAuMCIsInVwZGF0ZWRJblZlciI6IjQzLjE1MC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJ0eXBlL2RlcGVuZGVuY2llcyJdfQ==--> Reviewed-on: https://git.tainton.uk/repos/roboluke/pulls/445 Co-authored-by: renovate[bot] <renovate-bot@git.tainton.uk> Co-committed-by: renovate[bot] <renovate-bot@git.tainton.uk>
|
Thanks you all for pointing this out, and all my apologies for the disruption! We will fix that on a patch version really soon. |



Summary
Implements OpenPGP signature verification for Sonar Scanner CLI downloads to ensure supply chain security. Downloaded binaries are now verified against SonarSource's public key before extraction.
Security Implementation
679F1EE92B19609DE816FDE81DB198F93525EC1Ahkps://keyserver.ubuntu.comandhkps://keys.openpgp.orgTests
References