SonarQube Quality Gate fails on "Security Hotspots Reviewed is less than 100%" but there are no vulnerabilities
BeginnerTroubleshootingSAST, SCA and secrets scanning in CI
Answer
Likely causes → Hotspots are not bugs; they are code that needs a human review (crypto use, regexes, cookies). The default "Sonar way" gate requires all new hotspots reviewed.
Diagnose → Project → Security Hotspots → filter "New code", status "To review". Or via API:
curl -su "$SONAR_TOKEN:" "$SONAR_HOST/api/hotspots/search?projectKey=myapp&status=TO_REVIEW&inNewCodePeriod=true"
Fix → Review each and mark Safe, Fixed or Acknowledged with a comment. Do not lower the gate to make it green.
Prevent → Make hotspot review part of PR review; a security champion triages hotspots weekly.
More on SAST, SCA and secrets scanning in CI
gitleaks fails the PR on `tests/fixtures/fake_rsa.pem` and `testdata/aws_creds.json`, which only contain dummy valuesBeginnergitleaks passes locally but the CI job reports 40 old leaks nobody touched in this PRIntermediate`fatal: ambiguous argument 'origin/main..HEAD': unknown revision` in the secrets-scan stepBeginnerSemgrep flags `subprocess.run(cmd, shell=True)` in a script where `cmd` is a hard-coded constantBeginnerSemgrep in CI reports findings in `node_modules/`, `vendor/` and minified `dist/*.js`BeginnerSemgrep job takes 35 minutes and gets killed with `exit code 137`Intermediate