Skip to content

SC-60373 Use WIF to authenticate SonarQube Cloud scans in build actions - #363

Draft
aurelien-poscia-sonarsource wants to merge 4 commits into
masterfrom
feature/ap/SC-60373-wif-sonarqube-cloud-scans
Draft

aurelien-poscia-sonarsource wants to merge 4 commits into
masterfrom
feature/ap/SC-60373-wif-sonarqube-cloud-scans

Conversation

@aurelien-poscia-sonarsource

@aurelien-poscia-sonarsource aurelien-poscia-sonarsource commented Oct 22, 2026 •

Copy link
Copy Markdown

Summary

SC-60373, part of SC-50795.

build-gradle, build-maven, build-npm, build-poetry and build-yarn now authenticate to SonarQube Cloud (sqc-eu, sqc-us) with the GitHub OIDC token of the job, through sonarqube-auth-action, instead of the shared sonarcloud and sonarqube-us Vault tokens. SonarQube Next still reads its token from Vault.

This is a breaking change, to be released as 3.0.0. There is no fallback to Vault: upgrading means WIF.

Changes

  • shared/sonar-auth (new, internal) and build-*/action.yml: each build action calls shared/sonar-auth right before the build step. It runs two sonarqube-auth-action steps (EU and US), only for the analyzed platforms, with export-env: false and no continue-on-error. SQC_EU_* and SQC_US_* come from its outputs. The SHA pin and the conditions live in one place. The four Vault lines for sonarcloud and sonarqube-us are removed, and the next secrets are only fetched when next is analyzed.
  • shared/common-functions.sh, build-*/build.sh: the check that required all six NEXT_* and SQC_* variables is replaced by require_sonar_env, which only requires the variables of the platforms that are analyzed. Without it, sonar-platform: sqc-eu or sqc-us would fail because the other platform is skipped.
  • README.md: new "SonarQube Cloud authentication" section, linked from each build-* section.

Requirements for consumers

  • id-token: write on the job (already needed for Vault).
  • The repository is bound to a SonarQube Cloud project on each analyzed platform, and trusted scanning is enabled in the organization.
  • sonar.projectKey and sonar.organization match the bound project.
  • The build, the tests and the analysis complete within 30 minutes: the token is requested right before the build and lasts 30 minutes. On recent successful runs of 120 repositories (1,869 builds), the build-* step has a median of 2.4 minutes and a p99 of 18.7 minutes. The sonarqube repository is the only one above 30 minutes, and its build is being shortened separately.

Merge prerequisites

Merging changes @master only: @v1 (283 usages), @v2 (146) and SHA-pinned (36) consumers are unaffected until a new tag is cut. Six repositories call build-*@master and will switch to WIF on merge, with no fallback to Vault. They are the sonar-dummy test repositories, one per build action:

Repository Action
sonar-dummy build-maven
sonar-dummy-maven-enterprise build-maven
sonar-dummy-gradle-oss build-gradle
sonar-dummy-js build-npm
sonar-dummy-yarn build-yarn
sonar-dummy-python-oss build-poetry

Before merging, each one needs id-token: write on its jobs, a binding to a SonarQube Cloud project on every platform it scans (EU and US for shadow scans), trusted scanning enabled in the organization, and sonar.projectKey / sonar.organization matching the bound project.

Test plan

  • ShellSpec: 204 examples pass for the five build specs and the shared functions. 8 new cases cover require_sonar_env, and they fail when the helper requires every platform.
  • ShellCheck, yamllint and markdownlint pass, and the five action.yml files validate against the GitHub Actions schema.
  • Full suite: the only failure is update-release-channel_spec.sh, which fails the same way on master (check-jsonschema missing locally).
  • Pilot, Gradle sqc-eu single-platform: sonar-scanner-integration-tester#95
  • Pilot, Maven shadow scans on EU, US and Next: sonar-dummy#657
  • Pilot npm, yarn and poetry, and one build that runs longer than 10 minutes.
  • Check the six @master repositories above.
  • Cut a stable sonarqube-auth-action release and update the pinned SHA (currently the commit v1 points to).
  • Release 3.0.0.

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@hashicorp-vault-sonar-prod

hashicorp-vault-sonar-prod Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

SC-60373

Comment thread shared/common-functions.sh Resolved
Comment thread README.md Resolved
Comment thread build-poetry/action.yml Outdated
Comment on lines +142 to +153
- uses: SonarSource/sonarqube-auth-action@0c409727662aa45022382faba75676ae449788ad # v1
id: sqc-eu-auth
if: inputs.run-shadow-scans == 'true' || inputs.sonar-platform == 'sqc-eu'
with:
sonar-host-url: https://sonarcloud.io
export-env: 'false'
- uses: SonarSource/sonarqube-auth-action@0c409727662aa45022382faba75676ae449788ad # v1
id: sqc-us-auth
if: inputs.run-shadow-scans == 'true' || inputs.sonar-platform == 'sqc-us'
with:
sonar-host-url: https://sonarqube.us
export-env: 'false'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Cross-Repo: sonar-dummy-python-oss on build-poetry@master switches to WIF on merge

Fix here and in SonarSource/sonar-dummy-python-oss

Breaks in: SonarSource/sonar-dummy-python-oss - .github/workflows/build.yml - Build job (SonarSource/ci-github-actions/build-poetry@master, sonar-platform: sqc-eu)

SonarSource/sonar-dummy-python-oss calls SonarSource/ci-github-actions/build-poetry@master in two workflows: .github/workflows/build.yml with sonar-platform: sqc-eu, and unified-dogfooding.yml with run-shadow-scans: true. Once this PR merges to master, those jobs stop reading the sonarcloud and sonarqube-us Vault tokens. They run sonarqube-auth-action for EU, and for shadow scans for US as well, and there is no Vault fallback. The 3.0.0 versioning does not protect these jobs, because they pin @master. Each job then fails at the token exchange unless the repository is bound to a SonarQube Cloud project on every analyzed platform (both EU and US for the shadow-scan workflow) with trusted scanning enabled, and the analysis finishes within the 30-minute token life. The break is intended. The consumer has to be ready before merge.

Here: Before merging to master, confirm that the dogfood repositories on @master (including sonar-dummy-python-oss) are bound and have trusted scanning enabled on sqc-eu and sqc-us. Alternatively, ship the change on a beta/3.x branch first, as the test plan suggests, and add a migration note for @master consumers.

There: In SonarSource/sonar-dummy-python-oss, bind the repository to SonarQube Cloud projects on both sqc-eu and sqc-us (shadow scans need both), enable trusted scanning, and keep id-token: write on the build.yml and unified-dogfooding.yml jobs. Also check that sonar.organization/sonar.projectKey match the bound projects.

Was this helpful? React with 👍 / 👎

The two sonarqube-auth-action steps were duplicated in the five build-*
actions. They now live in shared/sonar-auth, so the SHA pin and the
conditions are maintained in one place.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@datadog-sonarsource

datadog-sonarsource Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Pipelines

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 0991c9f | Docs | Give us feedback!

Use the shared platform list in the poetry shadow scan loop, and state in
the README that check-sca still reads the SonarQube Cloud Vault secrets.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Comment thread build-maven/action.yml
development/kv/data/sign key | SIGN_KEY;
development/kv/data/sign passphrase | PGP_PASSPHRASE;
# yamllint enable rule:line-length
# The SonarQube Cloud tokens expire after 30 minutes: keep this step right before the build step.

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.

Is it enough for long-running builds? Is the token used at the beginning and/or at the end of the Maven build?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

The token fetch happens before the maven build is started, by design. The goal of modifying this action is to be able to dogfood the public sonarqube-auth-action at scale.

So we have two options:

  1. We have a custom implem here to fetch the token differently and not use the sonarqube-auth-action
  2. On the adopters of this action, only sonarqube build exceeded 30 minutes twice out of the recorded 25 runs.

I would rather adopt a specific solution for sonarqube, and let all other projects use the public sonarqube-auth-action

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

IMO this is a major design flaw of those shared actions (and to be honest, of our Maven/Gradle scanners). We should have isolated the Sonar analysis from the build of the project.
This is what I am trying to do on some projects, like here:
https://github.com/SonarSource/sonar-scanner-engine/actions/runs/39807148955

This is especially true if the build takes longer than 30 min, we should extract it, run tests in parallel jobs, and only run the SQ analysis in a downstream job.

next) : "${NEXT_URL:?}" "${NEXT_TOKEN:?}" ;;
sqc-us) : "${SQC_US_URL:?}" "${SQC_US_TOKEN:?}" ;;
sqc-eu) : "${SQC_EU_URL:?}" "${SQC_EU_TOKEN:?}" ;;
*) ;;

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.

require_sonar_env ignores unknown platforms (silent no-op)
A typo like sonar-platform: sqc_eu would run no auth step and no check, so it would only fail later. The old code had the same weakness, so it's optional and also fine as it is.

sonarqube-auth-action replaced the sonar-host-url input and output with
sonar-region. The shared sonar-auth action now only provides the tokens,
and the build actions read the SonarQube Cloud URLs from Vault again.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

Comment thread README.md
The `build-*` actions authenticate to SonarQube Cloud (`sonar-platform: sqc-eu` or `sqc-us`, and the matching platforms of
`run-shadow-scans`) with the GitHub OIDC token of the job, through
[`sonarqube-auth-action`](https://github.com/SonarSource/sonarqube-auth-action), instead of with tokens stored in Vault.
The SonarQube Cloud URLs, and the URL and token of the `next` platform, are still read from Vault.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Quality: README still says build-* no longer read the SQC Vault secrets

This commit makes every build-* action read development/kv/data/sonarcloud url and development/kv/data/sonarqube-us url from Vault again, for example in build-gradle/action.yml:147-148. Line 100 of the README was updated to say so. Lines 115-116 were left unchanged and still say the build-* actions "do not read the secrets development/kv/data/sonarcloud and development/kv/data/sonarqube-us anymore" and that only check-sca still uses them. An operator who follows that paragraph could conclude that these secrets can be revoked once check-sca migrates. Doing that would leave SQC_EU_URL/SQC_US_URL empty and break every SQC scan in the build actions. Fix: reword lines 115-116 to say that only the token fields of those secrets are no longer read by build-*, and that the url fields are still required.

Clarify that only the token fields stopped being read:

The `build-*` actions do not read the `token` fields of the secrets `development/kv/data/sonarcloud` and
`development/kv/data/sonarqube-us` anymore, but still read their `url` fields. The tokens are still used by
[`check-sca`](#check-sca), so these secrets must not be revoked yet.
  • Apply fix

Check the box to apply the fix or reply for a change | Was this helpful? React with 👍 / 👎

Comment thread build-gradle/action.yml
Comment on lines 147 to 148
${{ (inputs.sonar-platform != 'none' || inputs.run-shadow-scans == 'true') && 'development/kv/data/sonarqube-us url | SQC_US_URL;' || '' }}
${{ (inputs.sonar-platform != 'none' || inputs.run-shadow-scans == 'true') && 'development/kv/data/sonarqube-us token | SQC_US_TOKEN;' || '' }}
${{ (inputs.sonar-platform != 'none' || inputs.run-shadow-scans == 'true') && 'development/kv/data/sonarcloud url | SQC_EU_URL;' || '' }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Cross-Repo: sonar-dummy-gradle-oss shadow scans on @master will need WIF on EU and US

Fix here and in SonarSource/sonar-dummy-gradle-oss

Breaks in: SonarSource/sonar-dummy-gradle-oss - .github/workflows/unified-dogfooding.yml - Build and run shadow scans job (build-gradle@master, run-shadow-scans: true)

SonarSource/sonar-dummy-gradle-oss calls SonarSource/ci-github-actions/build-gradle@master with run-shadow-scans: true in .github/workflows/unified-dogfooding.yml (the "Build and run shadow scans" job). After this PR, build-gradle/action.yml reads only the SonarQube Cloud URLs from Vault (lines 147-148). The SQC_EU_TOKEN/SQC_US_TOKEN values come only from shared/sonar-auth, which runs sonarqube-auth-action for both EU and US whenever shadow scans are on, and there is no Vault fallback. The job pins @master, so the 3.0.0 versioning does not shield it. Once this merges, the job fails at the token exchange unless three things hold: the repository is bound to SonarQube Cloud projects on both sqc-eu and sqc-us with trusted scanning enabled, the job has id-token: write, and the build plus analysis finishes within the 30-minute token lifetime. The PR intends this break, so the consumer has to be ready before merge.

Here: Before merging to master, confirm that sonar-dummy-gradle-oss (and the other @master dogfood repos) is bound and has trusted scanning enabled on both sqc-eu and sqc-us. Otherwise, ship this on a 3.x/beta branch first and add a migration note in the README for @master consumers.

There: In SonarSource/sonar-dummy-gradle-oss, bind the repository to SonarQube Cloud projects on sqc-eu and sqc-us and enable trusted scanning. Add id-token: write to the shadow-scan job in .github/workflows/unified-dogfooding.yml, and make sure sonar.organization/sonar.projectKey match the bound projects.

In SonarSource/sonar-dummy-gradle-oss - .github/workflows/unified-dogfooding.yml:

permissions:
  id-token: write
  contents: write

Was this helpful? React with 👍 / 👎

@gitar-bot

gitar-bot Bot commented Oct 26, 2026

Copy link
Copy Markdown
Code Review ⚠️ Changes requested 2 closed / 5 findings

🔴 High risk · Replacing Vault tokens with OIDC-based SonarQube Cloud authentication across five build actions could misauthorize project scans or block analysis when bindings are misconfigured.

Switches build-gradle, build-maven, build-npm, build-poetry and build-yarn to WIF authentication for SonarQube Cloud, removing the shared Vault tokens with no fallback, which is a breaking change for @master consumers. Changes requested: sonar-dummy-python-oss and sonar-dummy-gradle-oss (unified-dogfooding.yml) need trusted scanning, SonarQube Cloud bindings on sqc-eu and sqc-us, and id-token: write before merge. Also, the README still states the build actions do not read the SQC Vault secrets, which could lead operators to revoke the url fields those actions still need. Two resolved items were addressed: the hardcoded platform list in build-poetry and the README claim about check-sca Vault reads.

⚠️ Cross-Repo: sonar-dummy-gradle-oss shadow scans on @master will need WIF on EU and US

📄 build-gradle/action.yml:147-148 📄 build-gradle/action.yml:189 📄 build-gradle/action.yml:191 📄 shared/sonar-auth/action.yml:26-36

Fix here and in SonarSource/sonar-dummy-gradle-oss

Breaks in: SonarSource/sonar-dummy-gradle-oss - .github/workflows/unified-dogfooding.yml - Build and run shadow scans job (build-gradle@master, run-shadow-scans: true)

SonarSource/sonar-dummy-gradle-oss calls SonarSource/ci-github-actions/build-gradle@master with run-shadow-scans: true in .github/workflows/unified-dogfooding.yml (the "Build and run shadow scans" job). After this PR, build-gradle/action.yml reads only the SonarQube Cloud URLs from Vault (lines 147-148). The SQC_EU_TOKEN/SQC_US_TOKEN values come only from shared/sonar-auth, which runs sonarqube-auth-action for both EU and US whenever shadow scans are on, and there is no Vault fallback. The job pins @master, so the 3.0.0 versioning does not shield it. Once this merges, the job fails at the token exchange unless three things hold: the repository is bound to SonarQube Cloud projects on both sqc-eu and sqc-us with trusted scanning enabled, the job has id-token: write, and the build plus analysis finishes within the 30-minute token lifetime. The PR intends this break, so the consumer has to be ready before merge.

Here: Before merging to master, confirm that sonar-dummy-gradle-oss (and the other @master dogfood repos) is bound and has trusted scanning enabled on both sqc-eu and sqc-us. Otherwise, ship this on a 3.x/beta branch first and add a migration note in the README for @master consumers.

There: In SonarSource/sonar-dummy-gradle-oss, bind the repository to SonarQube Cloud projects on sqc-eu and sqc-us and enable trusted scanning. Add id-token: write to the shadow-scan job in .github/workflows/unified-dogfooding.yml, and make sure sonar.organization/sonar.projectKey match the bound projects.

In SonarSource/sonar-dummy-gradle-oss - .github/workflows/unified-dogfooding.yml:

permissions:
  id-token: write
  contents: write
💡 Cross-Repo: sonar-dummy-python-oss on build-poetry@master switches to WIF on merge

📄 build-poetry/action.yml:142-153

Fix here and in SonarSource/sonar-dummy-python-oss

Breaks in: SonarSource/sonar-dummy-python-oss - .github/workflows/build.yml - Build job (SonarSource/ci-github-actions/build-poetry@master, sonar-platform: sqc-eu)

SonarSource/sonar-dummy-python-oss calls SonarSource/ci-github-actions/build-poetry@master in two workflows: .github/workflows/build.yml with sonar-platform: sqc-eu, and unified-dogfooding.yml with run-shadow-scans: true. Once this PR merges to master, those jobs stop reading the sonarcloud and sonarqube-us Vault tokens. They run sonarqube-auth-action for EU, and for shadow scans for US as well, and there is no Vault fallback. The 3.0.0 versioning does not protect these jobs, because they pin @master. Each job then fails at the token exchange unless the repository is bound to a SonarQube Cloud project on every analyzed platform (both EU and US for the shadow-scan workflow) with trusted scanning enabled, and the analysis finishes within the 30-minute token life. The break is intended. The consumer has to be ready before merge.

Here: Before merging to master, confirm that the dogfood repositories on @master (including sonar-dummy-python-oss) are bound and have trusted scanning enabled on sqc-eu and sqc-us. Alternatively, ship the change on a beta/3.x branch first, as the test plan suggests, and add a migration note for @master consumers.

There: In SonarSource/sonar-dummy-python-oss, bind the repository to SonarQube Cloud projects on both sqc-eu and sqc-us (shadow scans need both), enable trusted scanning, and keep id-token: write on the build.yml and unified-dogfooding.yml jobs. Also check that sonar.organization/sonar.projectKey match the bound projects.

💡 Quality: README still says build-* no longer read the SQC Vault secrets

📄 README.md:100 📄 README.md:115-116 📄 build-gradle/action.yml:147-148 📄 build-gradle/action.yml:189 📄 build-gradle/action.yml:191

This commit makes every build-* action read development/kv/data/sonarcloud url and development/kv/data/sonarqube-us url from Vault again, for example in build-gradle/action.yml:147-148. Line 100 of the README was updated to say so. Lines 115-116 were left unchanged and still say the build-* actions "do not read the secrets development/kv/data/sonarcloud and development/kv/data/sonarqube-us anymore" and that only check-sca still uses them. An operator who follows that paragraph could conclude that these secrets can be revoked once check-sca migrates. Doing that would leave SQC_EU_URL/SQC_US_URL empty and break every SQC scan in the build actions. Fix: reword lines 115-116 to say that only the token fields of those secrets are no longer read by build-*, and that the url fields are still required.

Clarify that only the token fields stopped being read
The `build-*` actions do not read the `token` fields of the secrets `development/kv/data/sonarcloud` and
`development/kv/data/sonarqube-us` anymore, but still read their `url` fields. The tokens are still used by
[`check-sca`](#check-sca), so these secrets must not be revoked yet.
✅ 2 closed
✅ Quality: build-poetry orchestrator still hardcodes the platform list

📄 build-poetry/build.sh:131 📄 shared/common-functions.sh:48 📄 shared/common-functions.sh:54 📄 shared/common-functions.sh:88
This PR adds SONAR_PLATFORMS in shared/common-functions.sh and uses it in two places: the shared orchestrator and require_sonar_env, which decides which credentials must be set during a shadow scan. build-poetry/build.sh:131 has its own shadow-scan loop, and it still hardcodes ("next" "sqc-us" "sqc-eu"). The lists match today. If someone edits SONAR_PLATFORMS later, Poetry would scan one set of platforms while require_sonar_env checks credentials for another. Fix: use "${SONAR_PLATFORMS[@]}" in the Poetry loop as well.

✅ Quality: README says SQC Vault secrets are unused, but check-sca still reads them

📄 README.md:115 📄 README.md:1814-1815
The new README section says without qualification: "The secrets development/kv/data/sonarcloud and development/kv/data/sonarqube-us are not read anymore." check-sca still reads both paths from Vault (check-sca/action.yml:76-79), and the README's own check-sca section still lists them as Vault dependencies (README.md:1814-1815). An operator who trusts the new statement might revoke or stop rotating those secrets, and that would break check-sca. Fix: limit the sentence to the build-* actions.

🤖 Prompt for agents
Code Review: Switches `build-gradle`, `build-maven`, `build-npm`, `build-poetry` and `build-yarn` to WIF authentication for SonarQube Cloud, removing the shared Vault tokens with no fallback, which is a breaking change for `@master` consumers. Changes requested: `sonar-dummy-python-oss` and `sonar-dummy-gradle-oss` (`unified-dogfooding.yml`) need trusted scanning, SonarQube Cloud bindings on sqc-eu and sqc-us, and `id-token: write` before merge. Also, the README still states the build actions do not read the SQC Vault secrets, which could lead operators to revoke the `url` fields those actions still need. Two resolved items were addressed: the hardcoded platform list in `build-poetry` and the README claim about `check-sca` Vault reads.

1. 💡 Cross-Repo: sonar-dummy-python-oss on build-poetry@master switches to WIF on merge
   Files: build-poetry/action.yml:142-153

   **Fix here and in [`SonarSource/sonar-dummy-python-oss`](https://github.com/SonarSource/sonar-dummy-python-oss)**
   
   **Breaks in:** [`SonarSource/sonar-dummy-python-oss`](https://github.com/SonarSource/sonar-dummy-python-oss) - [`.github/workflows/build.yml`](https://github.com/SonarSource/sonar-dummy-python-oss/blob/HEAD/.github/workflows/build.yml) - `Build job (SonarSource/ci-github-actions/build-poetry@master, sonar-platform: sqc-eu)`
   
   SonarSource/sonar-dummy-python-oss calls `SonarSource/ci-github-actions/build-poetry@master` in two workflows: `.github/workflows/build.yml` with `sonar-platform: sqc-eu`, and `unified-dogfooding.yml` with `run-shadow-scans: true`. Once this PR merges to master, those jobs stop reading the `sonarcloud` and `sonarqube-us` Vault tokens. They run `sonarqube-auth-action` for EU, and for shadow scans for US as well, and there is no Vault fallback. The 3.0.0 versioning does not protect these jobs, because they pin `@master`. Each job then fails at the token exchange unless the repository is bound to a SonarQube Cloud project on every analyzed platform (both EU and US for the shadow-scan workflow) with trusted scanning enabled, and the analysis finishes within the 30-minute token life. The break is intended. The consumer has to be ready before merge.
   
   **Here:** Before merging to master, confirm that the dogfood repositories on `@master` (including sonar-dummy-python-oss) are bound and have trusted scanning enabled on sqc-eu and sqc-us. Alternatively, ship the change on a beta/3.x branch first, as the test plan suggests, and add a migration note for `@master` consumers.
   
   **There:** In SonarSource/sonar-dummy-python-oss, bind the repository to SonarQube Cloud projects on both sqc-eu and sqc-us (shadow scans need both), enable trusted scanning, and keep `id-token: write` on the `build.yml` and `unified-dogfooding.yml` jobs. Also check that `sonar.organization`/`sonar.projectKey` match the bound projects.

2. 💡 Quality: README still says build-* no longer read the SQC Vault secrets
   Files: README.md:100, README.md:115-116, build-gradle/action.yml:147-148, build-gradle/action.yml:189, build-gradle/action.yml:191

   This commit makes every `build-*` action read `development/kv/data/sonarcloud url` and `development/kv/data/sonarqube-us url` from Vault again, for example in `build-gradle/action.yml:147-148`. Line 100 of the README was updated to say so. Lines 115-116 were left unchanged and still say the `build-*` actions "do not read the secrets `development/kv/data/sonarcloud` and `development/kv/data/sonarqube-us` anymore" and that only `check-sca` still uses them. An operator who follows that paragraph could conclude that these secrets can be revoked once `check-sca` migrates. Doing that would leave `SQC_EU_URL`/`SQC_US_URL` empty and break every SQC scan in the build actions. Fix: reword lines 115-116 to say that only the `token` fields of those secrets are no longer read by `build-*`, and that the `url` fields are still required.

   Fix (Clarify that only the token fields stopped being read):
   The `build-*` actions do not read the `token` fields of the secrets `development/kv/data/sonarcloud` and
   `development/kv/data/sonarqube-us` anymore, but still read their `url` fields. The tokens are still used by
   [`check-sca`](#check-sca), so these secrets must not be revoked yet.

3. ⚠️ Cross-Repo: sonar-dummy-gradle-oss shadow scans on @master will need WIF on EU and US
   Files: build-gradle/action.yml:147-148, build-gradle/action.yml:189, build-gradle/action.yml:191, shared/sonar-auth/action.yml:26-36

   **Fix here and in [`SonarSource/sonar-dummy-gradle-oss`](https://github.com/SonarSource/sonar-dummy-gradle-oss)**
   
   **Breaks in:** [`SonarSource/sonar-dummy-gradle-oss`](https://github.com/SonarSource/sonar-dummy-gradle-oss) - [`.github/workflows/unified-dogfooding.yml`](https://github.com/SonarSource/sonar-dummy-gradle-oss/blob/HEAD/.github/workflows/unified-dogfooding.yml) - `Build and run shadow scans job (build-gradle@master, run-shadow-scans: true)`
   
   SonarSource/sonar-dummy-gradle-oss calls `SonarSource/ci-github-actions/build-gradle@master` with `run-shadow-scans: true` in `.github/workflows/unified-dogfooding.yml` (the "Build and run shadow scans" job). After this PR, `build-gradle/action.yml` reads only the SonarQube Cloud URLs from Vault (lines 147-148). The `SQC_EU_TOKEN`/`SQC_US_TOKEN` values come only from `shared/sonar-auth`, which runs `sonarqube-auth-action` for both EU and US whenever shadow scans are on, and there is no Vault fallback. The job pins `@master`, so the 3.0.0 versioning does not shield it. Once this merges, the job fails at the token exchange unless three things hold: the repository is bound to SonarQube Cloud projects on both sqc-eu and sqc-us with trusted scanning enabled, the job has `id-token: write`, and the build plus analysis finishes within the 30-minute token lifetime. The PR intends this break, so the consumer has to be ready before merge.
   
   **Here:** Before merging to master, confirm that sonar-dummy-gradle-oss (and the other @master dogfood repos) is bound and has trusted scanning enabled on both sqc-eu and sqc-us. Otherwise, ship this on a 3.x/beta branch first and add a migration note in the README for @master consumers.
   
   **There:** In SonarSource/sonar-dummy-gradle-oss, bind the repository to SonarQube Cloud projects on sqc-eu and sqc-us and enable trusted scanning. Add `id-token: write` to the shadow-scan job in `.github/workflows/unified-dogfooding.yml`, and make sure `sonar.organization`/`sonar.projectKey` match the bound projects.
   
   In SonarSource/sonar-dummy-gradle-oss - `.github/workflows/unified-dogfooding.yml`:
   
   ````
   permissions:
     id-token: write
     contents: write
   ````

Verification Rules 3/3 met Repos 2 inspected

Functional validation No results

Rules 3 passed

✅ Approved GitHub Actions runners
✅ Internal artifact registries
✅ Repository license compliance

Broader impact Repos 2 inspected
Cross-repo 2 repositories inspected 2 open impacts

SonarSource/sonar-dummy-python-oss Inspected
SonarSource/sonar-dummy-gradle-oss Inspected

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing compact verification results.
Unblock → Override a blocking verdict and allow merging.

Comment with these commands to change the behavior for this request:

Auto-apply Compact Unblock
gitar auto-apply:on         
gitar display:verbose         
gitar unblock         

Was this helpful? React with 👍 / 👎 | Gitar

This branch has not been deployed

No deployments
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.

3 participants