Secure code scanning for developers

Catch secrets before the commit

SonarQube catches exposed secrets—like passwords and access tokens—the moment they are written. With actionable code intelligence, developers can remediate immediately, ensuring code security and code health are maintained at the speed of development.

Advanced detection covers even more secrets patterns and cloud services

secure

The risk of hardcoded secrets

Hardcoded secrets are high-value credentials that, when exposed, compromise your entire security posture and private data. SonarQube provides the "trust and verify" framework needed to identify these risks early—from API keys to database tokens. This proactive approach prevents the costly, complex remediation and developer toil associated with repository leaks, ensuring code security and code health stay prioritized throughout your workflow.

warning

Why prevention is better than remediation

Once secrets are committed to a repository, they are compromised. Remediation requires rotating credentials and cleaning history—a process that creates significant developer toil and operational friction. Preventing secrets is more effective than post-commit remediation. SonarQube for IDE intercepts these risks as you write, providing  actionable intelligence needed to ensure code security and code health. This proactive approach protects your private data sources and eliminates the need for security fixes.

warning

Why prevention is better than remediation

Once secrets are committed to a repository, they are compromised. Remediation requires rotating credentials and cleaning history—a process that creates significant developer toil and operational friction. Preventing secrets is more effective than post-commit remediation. SonarQube for IDE intercepts these risks as you write, providing  actionable intelligence needed to ensure code security and code health. This proactive approach protects your private data sources and eliminates the need for security fixes.

Image

How does secrets detection work?

Sonar’s secrets detection is…

code

POWERFUL

Sonar leverages the power of both RegEx and Semantic Analysis

  • Now with 340+ rules that cover 400+ secrets patterns
  • Detects secrets/tokens used in 248 cloud services
  • Semantic analysis checks covering 19 languages, including Java, C#, PHP, Python, and XML
  • Only Sonar covers 1000+ APIs with password or token arguments
  • Coverage of Infrastructure as Code (IaC) languages and files
  • Complete scanning of all file types in the repository
building

Keep your company-specific secrets from leaking in CI/CD

Publicly known secrets cover most of your secrets, but a good portion are company-specific secrets with a structure or format only your company knows. Create custom rules with SonarQube Server Enterprise Edition and Data Center Edition to detect your company’s private secret patterns and deliver the best secrets detection coverage, up to 100% of all your secrets.

pull request failed
developer

Secrets detection: Comprehensive protection from IDE to CI/CD

SonarQube goes above and beyond by educating developers within‑IDE guidance and code scanning that pinpoints which code contains secrets in your CI/CD pipeline. Each secrets detection rule includes clear remediation content explaining why the found code segment is a secret and the security risk impact, supporting DevSecOps best practices and compliance. Now developers know how not to include secrets in their code with actionable, audit‑ready guidance and quality gates that prevent leaks before merge.

code report shows some issues with security and reliability