Whether you’re a large enterprise or a small development agency, secrets stored in code can creep up into your repositories unknowingly – it's an extremely common human error (and a costly one).
Secrets stored in code can expose your organization to data breaches that could cost millions.
The need for code secret scanning tools is larger than ever.
Code secret scanning tools help you find instances of hard coded secrets, API keys, passwords, and other sensitive account information before hackers do. Some of the tools on this list even prevent secrets from ever accidentally entering git repositories or files. When a secret is found, DevSecOps can review incidents in a dashboard, via a console application, or some scanners send email messages.
Secret scanning should be done prior to committing code to a private or public repository. Public repositories for the obvious reasons, but private repositories because the secret will live in commit history which poses a vulnerability in the event a hacker gains access as they will scan commit history.
Should your keys become compromised, they should always be revoked and new keys generated (i.e., rotate them).
Scanning tools come in several different flavors including open source, platform-specific, and others with the specific configuration options that you may want.
We’ve compiled secret scanners to help you decide which one is right for your business and software development lifecycle.
GitLeaks is an open source scanner that runs on Homebrew, Docker, or Go. The development team for GitLeaks also has binaries available for Linux and Windows operating systems. It’s a lightweight tool, so DevSecOps and developers don’t need to perform hefty lifting of their current software development lifecycle (SDLC). GitLeaks hooks to commit actions and scans prior to code being uploaded to a repository, so scans are done automatically and stops developers from mistakenly disclosing sensitive information in their source code. The output displays JSON results for each disclosed secret or password so that DevSecOps can parse and display information to a console or custom security application.
- Open source and free software with very little overhead for your DevSecOps team.
- Hooks directly into commits with simple integration and lightweight actions, making it less cumbersome than many other enterprise code scanners.
- Simplistic command line tool output makes it difficult to parse for humans.
- Requires custom coding if you want a nice user interface for developers to monitor exposed secrets.
- Custom coding will be required to create an intuitive user interface, otherwise developers must go through each incident in their command line tool.
Soteri is the go-to tool for developers and enterprises using Bitbucket and other Atlassian products such as Confluence and Jira to detect hard coded secrets (and prevent committing secrets).
Not many code secret scanning tools support Bitbucket, but Security for Bitbucket (Soteri's Bitbucket App) natively runs in Data Center.
Once installed, it's best practice to first perform deep scans of all repositories finding hard coded secrets and secondly to enable the pre-commit hook to reject new secrets from getting committed.
- Built specifically for SDLC environments using Jira and Bitbucket, and it’s easily installed directly from the Atlassian Marketplace.
- Good for small or large projects, and everyone in the DevSecOps can review results in an intuitive user interface with extensive reporting capabilities and the ability to export results.
- It’s easy to manage and deploy, so Soteri makes integration of secret scanning easy for everyone involved in the security of your repositories.
- Recent performance upgrades allow DevSecOps to quickly scan repositories so that deployments don't suffer from speed degradation.
- Ability to hide false positives so secret scanning results don't continue alerting you.
- REST API for scripting and automation (e.g., for your CI/CD pipeline)
- Built-in security scanning rules for common API keys and tokens, financial information, and other secrets which can be found in the docs.
- Customizable scanning rules so you can add secret detection formats customized to your unique needs.
- Soteri is dedicated to Bitbucket repositories, so it does not work with other environments.
- DevSecOps must install it from the Atlassian Marketplace, so code is not open source and can’t be downloaded directly.
- A lightweight open source solution, and it targets configuration files mostly. Configuration files are often used to store secrets and accidentally uploaded to public repositories.
- If your company has several larger applications with secrets stored across multiple static files, Whisper identifies passwords and secrets before developers commit files to repositories.
- Whisper must be combined with another scanning tool to have effective DevSecOps implementation. Limitations in its functionality and file format support make Whisper a good secondary secrets scanner, but it is not comparable to the other comprehensive secret scanning solutions on this list – especially in an enterprise environment.
Developers using GitHub will often rely solely on GitHub’s integrated code scanner, which is somewhat effective but should not be the only form of DevSecOps implementation. After developers commit their code to their GitHub repository, the automated scanner searches for any potential secrets in code and sends an email to the repository owner. Private repositories and GitHub Enterprise Cloud customers must request an additional GitHub Advanced Security license.
- No setup required, and GitHub’s service automatically scans all public repositories.
- It’s free with GitHub public projects, so it’s good for small open source projects, startups, and hobbyists.
- The security scan is automatic, so no configuration or installation is needed.
- Not thorough and only catches secrets in code after developers commit to GitHub.
- The tool is more reactionary than proactive in stopping secrets stored in code, so it’s better as a failsafe rather than the first offensive measure against sensitive data disclosure.
Many Git scanning solutions are built with small projects in mind, but SpectralOps is built for enterprise projects. It’s language agnostic, which makes it more effective for large environments compared to other lightweight options. SpectralOps scans every repository, binary, static files, and code for a wide range of secrets. Real-time scans give DevSecOps staff immediate and continuous monitoring of source code.
- Integrations into CI/CD pipeline for any language makes SpectralOps a total solution that can be used in any environment and any repository application.
- Artificial intelligence (AI) includes over 2000 signals to detect a wide range of secrets or sensitive data stored in source code or configuration files.
- DevSecOps can customize signals and configure the solution to search specific assets or scan for specific sensitive information.
- SpectralOps might have a large range of solutions, but it’s expensive for smaller projects and too overwhelming to implement on smaller environments.
- Integration into Git or Bitbucket requires more overhead compared to other solutions, and it can become cumbersome for development agencies working with several customer repositories.
Snyk is another enterprise solution used to scan a multitude of languages and platforms. It works with both Github and Bitbucket, and it can integrate with your CI/CD pipeline for containers and infrastructure deployments. Snyk scans for other security issues, and it will automatically remediate some incidents without any intervention. The AI integration continuously optimizes Snyk’s scanning capabilities to find unique instances of software vulnerabilities.
- Scans repositories for several types of vulnerabilities including secrets stored in code, so developers get coverage for a wide range of security incidents.
- Dashboards and metrics give everyone in DevSecOps a clear picture of source code security health.
- Automatic remediation reduces overhead and speeds up development time with security integrated into deployments. The Snyk guidance module helps developers determine the best path to remediation.
- Customers complain that Snyk is difficult to use, and performance of scans is less than stellar.
- Snyk runs in the cloud, and customers report that downtime happens too often. When the scanning tool service goes offline, scans fail without reporting useful information.
- Snyk is also one of the more expensive options, so it’s mainly affordable to enterprise clients only.
Gittyleaks is a very basic tool, but basic is sufficient for many small business or personal projects. It searches for phrases (e.g., variable names) such as “username” or “password” and displays alerts to the user running the scanning tool. Developers can clone a repository and scan it to avoid affecting production, and run a quick scan on a project.
- For small business developers or hobbyist projects, Gittyleaks is a quick and easy way to perform a source code scan without expensive tools or hours of installation and configurations required from other scanners.
- Gittyleaks runs in the command line, and output shows every instance of discovered secrets.
- Large projects need more comprehensive tools, and Gittyleaks is not designed to find secrets with more nuanced variable naming conventions.
- It’s a lightweight tool meant for quick and dirty scans, but it’s not an enterprise solution.
- Even medium-sized projects should use a secondary secrets scanning tool for more in-depth searches.
Most code secret scanning tools focus on small or large projects, but GitGuardian is a secret scanning tool for mid-sized projects. It can also work with small and large projects, but its pricing is tiered from free to enterprise pricing. GitGuardian works a bit differently than the others and sends an email to repository owners. It’s a SaaS application that runs in the cloud, so it’s easily configurable GitHub, GitLab, Bitbucket, and Azure repos.
- For large enterprises, the real-time monitoring of Git repositories gives DevSecOps immediate alerts to remediate an issue as quickly as possible before PII or sensitive data disclosure.
- The SaaS environment makes configurations easy to manage, and it lowers maintenance overhead for DevSecOps.
- Analytics are available to any repository owner or stakeholder so that they can understand the way GitGuardian is helping with security of their SDLC.
- Customers report that the user interface could be more intuitive, and scan times are a bit slower than other git scanning technologies.
- Reports are basic, which can be difficult in an enterprise environment where several repositories are maintained.
- Several developers working within an environment are unable to determine the source of stored secrets in code from reports and must take time to find the developer responsible for data disclosure.
Using heuristics to discover secrets in code is what makes detect-secrets unique from the others. Developers of detect-secrets built the secrets scanning tool to allow DevSecOps to separate concerns between current data disclosure incidents and blocking data disclosure from continuing or accumulating into additional security incidents.
- Comparing heuristic repository commits with a current commit reduces the chance for developers to perform the same security incidents more than once.
- The heuristic comparisons lower chances for new developers to commit secrets that were removed previously.
- DevSecOps can run a simple scan in their consoles to find the number of security incidents in source code.
- The detect-secrets scanner is not a full solution, and it’s mainly supplemental to detect recurring security incidents in code.
- If variable names are obscure and not immediately obviously a secret or password, detect-secrets might not identify them during a scan.
Which Solution Should You Choose?
With so many options, you’re probably asking yourself which one is the best code scanner for your development team.
- The first step is to ask developers and DevSecOps for features necessary to secure their SDLC.
- Next, audit the languages and frameworks used in your SDLC environment, and filter solutions that work with your business programming languages.
- Finally determine the level of coverage that you need – do you need basic scans or enterprise scans with reports for stakeholders and layered configurations for a larger team?
If your business uses Bitbucket or Jira, check out Soteri. Soteri is an easily configurable code scanning tool that fully integrates with your SDLC and offers effective hooks to your commits. You can also directly download Soteri from the Atlassian Marketplace.