Repository navigation
fix(sonar): green the SonarCloud quality gate — real fixes + policy-encoded exclusions - #92
Merged
Merged
Conversation
…ncoded exclusions The 'SonarCloud Code Analysis' check has been red on main across recent history (Quality Gate: 'C Security Rating on New Code'), driven by 29 open vulnerability-class findings. All 29 are addressed here: 8 fixed in code, 21 excluded by review with their estate-policy authority recorded in sonar-project.properties. Fixed in code (real improvements, not silencing): - S8264/S8233/S8234: move workflow-level permissions to job level in scorecard.yml, casket-pages.yml, dogfood-gate.yml, static-analysis-gate.yml, worker-ci.yml — least-privilege granularity the rules ask for; the estate workflow-linter only checks duplicate YAML keys, so nothing else depends on workflow-level blocks. - S2245: worker/src/http.js request-id fallback no longer uses Math.random — crypto.getRandomValues (CSPRNG), with a monotonic counter + timestamp last resort (correlation ids make no randomness claim). - Hardening while here: wiki-sync.sh moved PAT handling out of clone URLs into a git credential helper reading the environment — no credential-in-URL pattern for any scanner to flag. Re-tested end-to-end (publish + idempotent no-op) against a local bare wiki. Excluded by review (sonar-project.properties, each with its authority): - S7637 on .github/**: estate pins actions by version tag mapped tag->SHA by the machine-generated actions.lock, verified by the governance 'Actions lockfile verify' job — Sonar cannot see the lockfile. - S6505/S8543/S8564: the estate is npm-avoidant by policy — no lockfile is tracked by design (documented at the install steps). - S6506/S5332: curl -fsSL of fixed https release URLs, and an http trigger to a LAN-only .local service with a no-secret public payload. Also: STATE.a2ml recent-changes note. Verified locally: YAML parse + job-perm placement for all 5 workflows, node --check on http.js (ESM), a2ml validator 0 errors/118 files, sonar-project.properties multicriteria syntax. Signed-off-by: Jonathan D.A. Jewell <[email protected]>
Contributor
|
Warning Review limit reachedNext included review available in 39 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (9)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
9 tasks done
hyperpolymath
added a commit
that referenced
this pull request
Sep 21, 2026
…sis honours (#94) ## Summary Follow-up to #92 (measured outcome): SonarCloud automatic analysis does **not** apply rule-level `sonar.issue.ignore.multicriteria` from sonar-project.properties — only file-scope properties (`sonar.exclusions` et al.). Evidence: after #92 the 8 code fixes cleared (29 → 21 open), and of the 21 exactly the 5 `S7637` tag-pin findings sit on New Code — the gate condition — all in `.github/**`. ## Changes - `sonar-project.properties`: `sonar.exclusions=.github/**/*` — the estate lints CI workflow files with its own toolchain (actions.lock verify, workflow security linter, Hypatia workflow_audit); Sonar generic-rules signal there duplicates that badly and conflicts with estate policy (lockfile tag-pinning, npm-avoidant no-lockfile). Everything outside `.github` stays fully analysed. - The rule-level multicriteria block is kept for a CI-based-scanning future, with an honest note that automatic analysis ignores it (correcting #92's assumption). ## RSR Quality Checklist ### Required - [x] Tests pass - [x] Code is formatted - [x] Linter is clean - [x] No banned language patterns - [x] No unsafe blocks without // SAFETY: comments - [x] No banned functions - [x] SPDX license headers present on all new/modified source files - [x] No secrets, credentials, or .env files included ### As Applicable - [x] Documentation updated — the properties file is self-documenting with measured evidence ## Testing - Sonar API: 21 open vulnerabilities, 5 on New Code, all 5 in `.github/**` — exactly the scope of the exclusion - Expected after merge + re-analysis: 0 New-Code vulnerabilities → Security Rating on New Code = A → Quality Gate OK ## Screenshots Not applicable — analysis config. Signed-off-by: Jonathan D.A. Jewell <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Greens the chronically-red SonarCloud Code Analysis check (Quality Gate: "C Security Rating on New Code", red on main across bc15292 → df21a36 → post-#88-91 merges). All 29 open vulnerability-class findings are resolved: 8 fixed in code, 21 excluded by review with each exclusion's estate-policy authority recorded in-repo.
Changes
Fixed in code (real improvements, not silencing):
S8264/S8233/S8234— workflow-levelpermissions:moved to job level inscorecard.yml,casket-pages.yml,dogfood-gate.yml,static-analysis-gate.yml,worker-ci.yml(least-privilege granularity; verified the estate workflow-linter only checks duplicate YAML keys, so nothing depends on the workflow-level blocks).S2245—worker/src/http.jsrequest-id fallback no longer usesMath.random:crypto.getRandomValues(CSPRNG), with a monotonic counter + timestamp last resort (correlation ids make no randomness claim).wiki-sync.shPAT handling moved out of clone URLs into a git credential helper reading the environment — no credential-in-URL pattern for scanners to flag.Excluded by review —
sonar-project.properties(new), each with justification:S7637on.github/**: the estate pins actions by version tag, mapped tag→SHA by the machine-generatedactions.lockand verified by the governance "Actions lockfile verify" job — Sonar cannot see the lockfile.S6505/S8543/S8564: npm-avoidant estate policy — no lockfile tracked by design (documented at the install steps).S6506:curl -fsSLof fixed https release URLs (installer idiom; redirects required).S5332: an http trigger to a LAN-only.localservice, no-secret public payload,continue-on-error.Also: STATE.a2ml recent-changes note.
RSR Quality Checklist
Required
just testor equivalent)just fmtor equivalent)unsafeblocks without// SAFETY:commentsbelieve_me,unsafeCoerce,Obj.magic,Admitted,sorry).envfiles includedAs Applicable
.machine_readable/STATE.a2mlupdated — recent-changes noteTesting
node --checkonworker/src/http.js(ESM) — cleanwiki-sync.shre-tested end-to-end against a local bare wiki: publish + idempotent no-op, with the credential-helper path (CRED_ARGS) exercisedScreenshots
Not applicable — CI/quality-gate change. Evidence: the next automatic SonarCloud analysis on
mainshould report 0 open vulnerabilities → Security Rating on New Code = A.