Purpose
Bearer CLI is an open-source static code security analysis tool (SAST) whose goal is to discover, filter, and prioritize security and privacy risks in code. Unlike traditional SAST tools that merely list a large number of issues, Bearer CLI is centered on sensitive data and determines which issues are more critical by evaluating sensitive data flows, thereby reducing the burden of manual triage.
Main Capabilities
Security Risk Detection
Bearer CLI uses built-in rules to scan source code, with rules covering the OWASP Top 10 and CWE Top 25, such as:
- A01 Access Control (such as path traversal, open redirection, sensitive information exposure)
- A02 Cryptographic Failures (such as weak algorithms, insecure communication)
- A03 Injection (such as SQL injection, input validation, XSS, XPath)
- A04 Design (such as lack of encryption for sensitive data, persistent cookies containing sensitive information)
- A05 Security Misconfiguration (such as sensitive information stored in plaintext in cookies or JWTs)
- A07 Identification and Authentication Failures (such as hardcoded passwords, improper certificate verification)
- A08 Data Integrity Failures (such as deserialization of untrusted data)
- A09 Security Logging and Monitoring Failures (such as inserting sensitive information into log files)
- A10 Server-Side Request Forgery (SSRF) All rules and their code patterns can be viewed in the documentation.
Privacy Risk Detection
Bearer CLI can detect sensitive data flows, identify PII, PHI, and other personal information in applications, as well as components that process sensitive data (such as databases like pgSQL, and third-party APIs like OpenAI and Sentry). This helps generate the Records of Processing Activities (RoPA) input required for Privacy Impact Assessments (PIA), Data Protection Impact Assessments (DPIA), and GDPR compliance reports. It can identify more than 120 data types under sensitive data categories such as Personal Data (PD), Sensitive PD, PII, and PHI. During scanning, it only analyzes source code patterns and does not look at actual data values.
Language Support
The open-source version of Bearer CLI supports Go, Java, JavaScript, TypeScript, PHP, Python, and Ruby. Bearer Pro by Cycode adds advanced cross-file analysis (Java, Python, C#, Go) as well as C#, Kotlin, Elixir, VB.Net, Rust, Swift, and other languages.
Scan Speed and False Positives
Scan time depends on application size and may be as short as 20 seconds; large codebases may take a few minutes; usually it will not exceed the time to run the test suite. When integrated with CI, diff scanning is provided to improve speed. Bearer CLI uses modern static code analysis techniques and provides native filtering and prioritization; Bearer Pro's interprocedural, cross-file analysis achieved a score of 76% on the OWASP Java Benchmark and reports a false positive rate below 2%.
How to Use
Installation
- Install script: automatically selects the build version suitable for the architecture, installs to ./bin by default, and fetches the latest release.
- Official Homebrew tap: brew can be used to install and update.
- Docker: Docker Hub and ghcr.io images are provided, and it can also be used via docker compose.
- Binary package: download the compressed package for the corresponding operating system/architecture from the releases page, extract it, place the binary in $PATH (such as /usr/local/bin), and ensure executable permissions; when updating, download the latest version and overwrite the original location.
Running a Scan
Run in the project directory bearer scan command. By default, the SAST scanner is used, but other scanner types can also be used. After the scan is complete, a security report is output by default, including a list of rules, the file location and triggering line for each finding, and a statistical summary of rule checks/findings/warnings. In addition, a privacy report can also be run.
Integration recommendations
The official recommendation is to run Bearer CLI in CI to automatically check new PRs for security issues, providing immediate feedback; it can also be integrated into CD, but it is recommended to fail only on high-severity issues; it can also be run as a scheduled task to continuously track the security posture.
Use cases
- Development teams automatically check code security and privacy risks locally or in CI/CD.
- Privacy and compliance teams that need to prepare PIA, DPIA, and RoPA materials for GDPR compliance.
- Application projects that use sensitive data and need to track data flows and processing components.
Limitations
The open source version of Bearer CLI does not support interprocedural and cross-file analysis; this capability belongs to Bearer Pro.
- The open source version has a limited language support scope; C#, Kotlin, Elixir, VB.Net, Rust, Swift, etc. are only available in the Pro version.
- The code uses the Elastic License 2.0 (ELv2) and can be used for free within an organization, but without explicit approval from Bearer Inc., Bearer CLI must not be provided to third parties as a hosted or managed service.
- Specific fees, pricing, and platform information are not currently provided.