Skip to content

sonarcloud-audit.sh cleanup closes audit issues in repos excluded from the current run's selection #1409

Closed

Description

@don-petry

The repository selection limits finding collection but does not limit cleanup. Cleanup interprets missing findings from excluded repositories as resolved and closes their audit issues using organization credentials.

Location: scripts/sonarcloud-audit.sh:418
Severity: low · Rule: CWE-863 · Reachability: external
Subsystem: Organization administration and standards deployment

Evidence

  • Source/control: The supported target_repo workflow_dispatch input, forwarded as TARGET_REPO.
  • Sink/decision: gh issue close with a false resolution comment in close_resolved().
  • Missing mitigation: Cleanup does not require the repository to belong to the selected, successfully scanned set before treating absent findings as resolved.
Reachability call stack
  1. .github/workflows/sonarcloud-audit.yml:20 — target_repo dispatch input
  2. .github/workflows/sonarcloud-audit.yml:56 — forward TARGET_REPO to the audit script
  3. scripts/sonarcloud-audit.sh:473 — main calls scan
  4. scripts/sonarcloud-audit.sh:212 — omit findings from other repositories
  5. scripts/sonarcloud-audit.sh:482 — independently list organization repositories
  6. scripts/sonarcloud-audit.sh:481 — call close_resolved for each listed repository
  7. scripts/sonarcloud-audit.sh:411 — excluded repository has no current families
  8. scripts/sonarcloud-audit.sh:418 — close its audit issue [sink]

Related: #1197 item 1 (truncation can also close issues as resolved; separate root cause).


Filed from a CodeRabbit security scan (scan 2d23b5ee-606a-403f-b407-81ddebdb0115, revision 1ea9ee1fbecc). Finding IDs: 03357458-44bd-4fd0-a0ff-57e61b91646f. CodeRabbit notes that findings relying on its stated assumptions are capped at medium severity; dismiss if an assumption does not hold.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    in-progressAn agent is actively working this issuesecuritySecurity-related PRs and issues

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions