← All insightsSecurity

Securing SonarQube: least privilege and safe defaults

CodeWizard Engineering · 21 October 2025 · 3 min read · Advanced

Security with SonarQube is mostly correct, boring defaults applied consistently. Here is the short list that removes most of the risk.

Safe defaults

  • Treat vulnerabilities and hotspots as gating, not advisory
  • Keep tokens scoped and rotate them

Wire it into the pipeline

Scan and fail on the Quality Gate.

yaml
- uses: sonarsource/sonarqube-scan-action@v3
  env:
    SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
    SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
- uses: sonarsource/sonarqube-quality-gate-action@v1

Reinforcing habits

  • Enforce a 'new code' Quality Gate on every PR
  • Wire coverage reports into the scan
  • Triage security hotspots, don't blanket-ignore them

Want senior help putting SonarQube to work - or a team bootcamp on it? CodeWizard runs Israel's largest DevOps community and embeds named senior engineers with a transparent hours log. Book a free consult or explore the Academy.

Like where this is going?

Get hands-on help from the engineers who write these posts.

Book a free consult