bearer

Bearer活跃维护

静态代码安全扫描工具,通过数据流分析发现代码中的安全与隐私风险,并按严重程度过滤排序,方便 DevSecOps 流程中优先修复高危问题。

Code security scanning tool (SAST) to discover, filter and prioritize security and privacy risks.

v2.1.3发布于 2026-10-28 14:31 UTC2,787star +2 / 7 天159fork同步于 2026-11-10 17:44 UTC

怎么上手

由 README 提炼,执行前请确认
curl -sfL https://raw.githubusercontent.com/Bearer/bearer/main/contrib/install.sh | sh
bearer scan juice-shop
硬件要求按 README 说明

README 未说明硬件要求,未提及显存或 GPU;以 CLI 形式在本地或 CI 中运行。

有 Docker 镜像
下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

开源 SAST 工具,扫描源码数据流,帮你发现并优先排序安全与隐私风险

静态代码安全扫描工具,通过数据流分析发现代码中的安全与隐私风险,并按严重程度过滤排序,方便 DevSecOps 流程中优先修复高危问题。

核心能力

  • 内置覆盖 OWASP Top 10 与 CWE Top 25 的规则扫描源码
  • 追踪敏感数据流,识别 PII、PHI 及处理这些数据的组件
  • 生成隐私报告,支撑 PIA、DPIA 与 GDPR 合规记录
  • 按敏感数据流评估风险优先级,减少人工分诊
  • 支持 Go、Java、JavaScript、TypeScript、PHP、Python、Ruby

容易踩的坑

安装脚本默认装到 ./bin 目录,需自行加入 PATH;Docker 镜像标注为 linux/amd64,其他架构需另选安装方式;默认 scan 使用 SAST 扫描器,隐私报告等其他扫描器需另行指定。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v2.1.3
  1. v2.1.3最新正式版2026-10-28 · 2026-10-28 14:31 UTC

    Changelog

    • 183fe9a2 chore(deps): bump Apple-Actions/import-codesign-certs from 7.0.0 to 7.1.0 (#2048)
    • 678e5c7f chore(deps): bump actions/setup-node from 7.0.0 to 7.1.0 (#2047)
    • 7d337bf5 chore(deps): bump github.com/open-policy-agent/opa from 1.21.1 to 1.21.3 (#2060)
    • 4f82485a chore(deps): bump github.com/rodaine/table from 1.4.0 to 1.4.1 (#2061)
    • 3aa19b88 chore(deps): bump golang.org/x/mod from 0.41.0 to 0.42.0 (#2056)
    • 668f5df0 chore(deps): bump golang.org/x/net from 0.60.0 to 0.61.0 (#2057)
    • c1fe1c2b chore(deps-dev): bump follow-redirects from 1.16.0 to 1.16.1 in /docs (#2058)
    • 05c627eb chore(deps-dev): bump markdown-it from 14.3.2 to 14.3.3 in /docs (#2059)
  2. v2.1.22026-10-13 · 2026-10-13 07:45 UTC
    查看更新说明

    Changelog

    • ce7d41bb chore(deps): bump actions/deploy-pages from 5.0.0 to 5.0.1 (#2031)
    • 97d987c0 chore(deps): bump github.com/bits-and-blooms/bitset from 1.25.0 to 1.26.0 (#2049)
    • eb43ae12 chore(deps): bump github.com/dustin/go-humanize from 1.0.1 to 1.1.0 (#2039)
    • a62776de chore(deps): bump github.com/open-policy-agent/opa from 1.19.1 to 1.20.2 (#2032)
    • d76fc47b chore(deps): bump github.com/open-policy-agent/opa from 1.20.2 to 1.21.1 (#2046)
    • 2dd0d483 chore(deps): bump github.com/rodaine/table from 1.3.1 to 1.4.0 (#2040)
    • 8771368c chore(deps): bump golang.org/x/mod from 0.40.0 to 0.41.0 (#2036)
    • 8362f40f chore(deps): bump golang.org/x/net from 0.58.0 to 0.59.0 (#2034)
    • 30ba68f2 chore(deps): bump golang.org/x/net from 0.59.0 to 0.60.0 (#2050)
    • 288b827a chore(deps): bump golang.org/x/oauth2 from 0.36.0 to 0.37.0 (#2035)
    • dcbb02f3 chore(deps): bump source-map-js from 1.2.1 to 1.2.2 in /docs (#2051)
    • 0d073996 chore(deps-dev): bump axios from 1.18.0 to 1.20.0 in /docs (#2045)
    • 51bb93d8 chore(deps-dev): bump brace-expansion from 1.1.12 to 1.1.21 in /docs (#2030)
    • ed225bf0 chore(deps-dev): bump js-yaml from 4.3.0 to 5.4.1 in /docs (#2033)
    • b7e77c0f chore(deps-dev): bump liquidjs from 10.27.0 to 10.30.0 in /docs (#2052)
    • e3753de6 chore(deps-dev): bump markdown-it from 14.2.0 to 14.3.2 in /docs (#2044)
    • 95a80d8a chore: update to go 1.26.9 (#2053)
  3. v2.1.12026-08-24 · 2026-08-24 09:59 UTC
    查看更新说明

    Changelog

    • b48e2f0c chore(deps): bump github.com/bits-and-blooms/bitset from 1.24.6 to 1.25.0 (#2022)
    • 70eaf331 chore(deps): bump github.com/open-policy-agent/opa from 1.19.0 to 1.19.1 (#2026)
    • 600e551c chore(deps): bump github.com/stretchr/testify from 1.11.1 to 1.12.1 (#2025)
    • 1fa92ade chore(deps): bump golang.org/x/mod from 0.38.0 to 0.40.0 (#2021)
    • 00e4c6bd chore(deps): bump golang.org/x/net from 0.57.0 to 0.58.0 (#2023)
    • 67f3569c chore: update to go 26 (#2024)
  4. v2.1.02026-08-03 · 2026-08-03 14:55 UTC
    查看更新说明

    Changelog

    • 0cf7f26a chore(deps): bump actions/checkout from 6.0.2 to 6.0.3 (#1970)
    • 8f85ede0 chore(deps): bump actions/checkout from 6.0.3 to 7.0.1 (#2003)
    • 7c49f986 chore(deps): bump github.com/bits-and-blooms/bitset from 1.24.4 to 1.24.5 (#1971)
    • 4f9d741e chore(deps): bump github.com/bits-and-blooms/bitset from 1.24.5 to 1.24.6 (#1999)
    • b350626e chore(deps): bump github.com/go-enry/go-enry/v2 to 2.9.6 (#1969)
    • cc77c72a chore(deps): bump github.com/open-policy-agent/opa from 1.16.1 to 1.16.2 (#1962)
    • b325fa18 chore(deps): bump github.com/open-policy-agent/opa from 1.16.2 to 1.17.0 (#1968)
    • 1f012547 chore(deps): bump github.com/open-policy-agent/opa from 1.17.0 to 1.17.1 (#1973)
    • b1bf31f1 chore(deps): bump github.com/open-policy-agent/opa from 1.17.1 to 1.18.2 (#1995)
    • 814948ec chore(deps): bump github.com/open-policy-agent/opa from 1.18.2 to 1.19.0 (#2019)
    • 5ff9819b chore(deps): bump github.com/schollz/progressbar/v3 from 3.19.0 to 3.19.1 (#1994)
    • 0fe95a71 chore(deps): bump github.com/ulikunitz/xz from 0.5.12 to 0.5.14 (#2018)
    • 35e5e34a chore(deps): bump golang.org/x/mod from 0.36.0 to 0.37.0 (#1974)
    • af482e29 chore(deps): bump golang.org/x/mod from 0.37.0 to 0.38.0 (#1998)
    • 73d35343 chore(deps): bump golang.org/x/net from 0.54.0 to 0.55.0 (#1965)
    • 41827a0a chore(deps): bump golang.org/x/net from 0.55.0 to 0.56.0 (#1975)
    • 57494412 chore(deps): bump golang.org/x/net from 0.56.0 to 0.57.0 (#1997)
    • b5caa733 chore(deps): bump golangci/golangci-lint-action from 9.2.0 to 9.2.1 (#1963)
    • f2f7401d chore(deps): bump passing go and CI updates (#2014)
    • c9073f36 chore(deps-dev): bump axios, js-yaml, tar, form-data, liquidjs in /docs (#1983)
    • b9a94df9 chore(deps-dev): bump js-yaml from 4.3.0 to 5.2.2 in /docs (#2006)
    • 95ff53b8 chore(deps-dev): upgrade eleventy 2->3 and markdown-it 13->14 in /docs (#1984)
    • 3cc566b9 chore: bump docs js deps and setup-node action (#2013)
    • 884b4245 chore: update gitleaks (#2016)
    • 75d1c5cc feat: language management (#2012)
    • c9bd6092 feat: refactor ignore logic (#1985)
    • e9021180 fix: use %w for error wrapping in scan command (#2007)
  5. v2.0.22026-05-18 · 2026-05-18 10:30 UTC
    查看更新说明

    Changelog

    • def42dc6 chore(deps): bump Apple-Actions/import-codesign-certs from 6.0.0 to 6.1.0 (#1924)
    • f18ddeff chore(deps): bump aquasecurity/trivy-action from 0.34.1 to 0.35.0 (#1913)
    • 1736e7ae chore(deps): bump github.com/fatih/color from 1.18.0 to 1.19.0 (#1925)
    • f2ade55b chore(deps): bump github.com/open-policy-agent/opa from 1.13.2 to 1.14.0 (#1907)
    • 8ba818dd chore(deps): bump github.com/open-policy-agent/opa from 1.14.0 to 1.14.1 (#1921)
    • b3df5401 chore(deps): bump github.com/open-policy-agent/opa from 1.14.1 to 1.15.2 (#1941)
    • 5f3108ed chore(deps): bump github.com/open-policy-agent/opa from 1.15.2 to 1.16.1 (#1956)
    • 235f37f0 chore(deps): bump github.com/pelletier/go-toml/v2 from 2.2.4 to 2.3.0 (#1930)
    • 1f34f4ea chore(deps): bump github.com/pelletier/go-toml/v2 from 2.3.0 to 2.3.1 (#1957)
    • 05eadac4 chore(deps): bump github.com/rodaine/table from 1.3.0 to 1.3.1 (#1920)
    • 1c2c0579 chore(deps): bump github.com/rs/zerolog from 1.34.0 to 1.35.1 (#1951)
    • 2c38759a chore(deps): bump github.com/weppos/publicsuffix-go from 0.50.2 to 0.50.3 (#1916)
    • 660ce07d chore(deps): bump go.opentelemetry.io/otel/sdk from 1.39.0 to 1.40.0 (#1906)
    • 4c0b39a6 chore(deps): bump golang.org/x/mod from 0.33.0 to 0.34.0 (#1918)
    • 7e130c79 chore(deps): bump golang.org/x/mod from 0.34.0 to 0.35.0 (#1940)
    • 9debe4e9 chore(deps): bump golang.org/x/mod from 0.35.0 to 0.36.0 (#1959)
    • 28103db4 chore(deps): bump golang.org/x/net from 0.50.0 to 0.51.0 (#1909)
    • 84524fbc chore(deps): bump golang.org/x/net from 0.51.0 to 0.52.0 (#1919)
    • 8e0e58fa chore(deps): bump golang.org/x/net from 0.52.0 to 0.53.0 (#1939)
    • 041637f8 chore(deps): bump golang.org/x/net from 0.53.0 to 0.54.0 (#1960)
    • b72a2827 chore(deps): bump golang.org/x/oauth2 from 0.35.0 to 0.36.0 (#1915)
    • 9ea516f8 chore(deps): bump picomatch from 2.3.1 to 2.3.2 in /docs (#1927)
    • dff54d28 chore(deps): updated various js and build deps (#1955)
    • ce675c65 chore(deps-dev): bump flatted from 3.2.7 to 3.4.2 in /docs (#1923)
    • de831a1a chore(deps-dev): bump handlebars from 4.7.7 to 4.7.9 in /docs (#1928)
    • c39c92f0 chore(deps-dev): bump liquidjs from 10.8.4 to 10.25.0 in /docs (#1917)
    • d834b457 chore(deps-dev): bump minimatch from 3.1.2 to 3.1.5 in /docs (#1911)
    • f46503fc chore(deps-dev): bump tar from 7.5.9 to 7.5.10 in /docs (#1912)
    • 255b3d72 feat: add option to use field name support (#1961)
    • f20f78b9 fix: segfault on M5 chips (#1952)

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    Getting Started - FAQ - Documentation - Report a Bug

    GitHub Release Test Contributor Covenant

    Language Support

    Bearer CLI (Open Source): Go • Java • JavaScript • TypeScript • PHP • Python • Ruby

    Bearer Pro by Cycode: All Bearer CLI languages plus:

    • Advanced Cross-file Analysis: Java • Python • C# • Go
    • Additional Languages: C# • Kotlin • Elixir • VB.Net • Rust • Swift

    Learn more about language support

    Developer friendly static code analysis for security and privacy

    https://user-images.githubusercontent.com/1649672/230438696-9bb0fd35-2aa9-4273-9970-733189d01ff1.mp4

    Bearer CLI scans your source code for:

    • Security risks and vulnerabilities using built-in rules covering the OWASP Top 10 and CWE Top 25, such as:

      • A01: Access control (e.g. Path Traversal, Open Redirect, Exposure of Sensitive Information).
      • A02: Cryptographic Failures (e.g. Weak Algorithm, Insecure Communication).
      • A03: Injection (e.g. SQL Injection, Input Validation, XSS, XPath).
      • A04: Design (e.g. Missing Encryption of Sensitive Data, Persistent Cookies Containing Sensitive Information).
      • A05: Security Misconfiguration (e.g. Cleartext Storage of Sensitive Information in a Cookie or JWT).
      • A07: Identification and Authentication Failures (e.g. Use of Hard-coded Password, Improper Certificate Validation).
      • A08: Data Integrity Failures (e.g. Deserialization of Untrusted Data).
      • A09: Security Logging and Monitoring Failures (e.g. Insertion of Sensitive Information into Log File).
      • A10: Server-Side Request Forgery (SSRF).

      Note: all the rules and their code patterns are accessible through the documentation.

    • Privacy risks with the ability to detect sensitive data flow such as the use of PII, PHI in your app, and components processing sensitive data (e.g. databases like pgSQL, third-party APIs such as OpenAI, Sentry, etc.). This helps generate a privacy report relevant for:

      • Privacy Impact Assessment (PIA).
      • Data Protection Impact Assessment (DPIA).
      • Records of Processing Activities (RoPA) input for GDPR compliance reporting.

    :rocket: Getting started

    Discover your most critical security risks and vulnerabilities in only a few minutes. In this guide, you will install Bearer CLI, run a security scan on a local project, and view the results. Let's get started!

    Install Bearer CLI

    The quickest way to install Bearer CLI is with the install script. It will auto-select the best build for your architecture. Defaults installation to ./bin and to the latest release version:

    curl -sfL https://raw.githubusercontent.com/Bearer/bearer/main/contrib/install.sh | sh
    
    Other install options

    Using Bearer CLI's official Homebrew tap:

    brew install bearer/tap/bearer
    

    Update an existing installation with the following:

    brew update && brew upgrade bearer/tap/bearer
    
    sudo apt-get update && sudo apt-get install ca-certificates -y && sudo update-ca-certificates
    sudo apt-get install apt-transport-https
    echo -e "Types: deb\nURIs: https://apt.fury.io/bearer/\nSuites: /\nTrusted: yes" | sudo tee /etc/apt/sources.list.d/fury.sources
    sudo apt-get update
    sudo apt-get install bearer
    

    Update an existing installation with the following:

    sudo apt-get update
    sudo apt-get install bearer
    

    Add repository setting:

    $ sudo vim /etc/yum.repos.d/fury.repo
    [fury]
    name=Gemfury Private Repo
    baseurl=https://yum.fury.io/bearer/
    enabled=1
    gpgcheck=0
    

    Then install with yum:

      sudo yum -y update
      sudo yum -y install bearer
    

    Update an existing installation with the following:

    sudo yum -y update bearer
    

    Bearer CLI is also available as a Docker image on Docker Hub and ghcr.io.

    With docker installed, you can run the following command with the appropriate paths in place of the examples.

    docker run --rm -v /path/to/repo:/tmp/scan bearer/bearer:latest-amd64 scan /tmp/scan
    

    Additionally, you can use docker compose. Add the following to your docker-compose.yml file and replace the volumes with the appropriate paths for your project:

    version: "3"
    services:
      bearer:
        platform: linux/amd64
        image: bearer/bearer:latest-amd64
        volumes:
          - /path/to/repo:/tmp/scan
    

    Then, run the docker compose run command to run Bearer CLI with any specified flags:

    docker compose run bearer scan /tmp/scan --debug
    

    The Docker configurations above will always use the latest release.

    Download the archive file for your operating system/architecture from here.

    Unpack the archive, and put the binary somewhere in your $PATH (on UNIX-y systems, /usr/local/bin or the like). Make sure it has permission to execute.

    To update Bearer CLI when using the binary, download the latest release and overwrite your existing installation location.

    Scan your project

    The easiest way to try out Bearer CLI is with the OWASP Juice Shop example project. It simulates a realistic JavaScript application with common security flaws. Clone or download it to a convenient location to get started.

    git clone https://github.com/juice-shop/juice-shop.git
    

    Now, run the scan command with bearer scan on the project directory:

    bearer scan juice-shop
    

    A progress bar will display the status of the scan.

    Once the scan is complete, Bearer CLI will output, by default, a security report with details of any rule findings, as well as where in the codebase the infractions happened and why.

    By default the scan command use the SAST scanner, other scanner types are available.

    Analyze the report

    The security report is an easily digestible view of the security issues detected by Bearer CLI. A report is made up of:

    • The list of rules run against your code.
    • Each detected finding, containing the file location and lines that triggered the rule finding.
    • A stat section with a summary of rules checks, findings and warnings.

    The OWASP Juice Shop example application will trigger rule findings and output a full report. Here's a section of the output:

    ...
    HIGH: Sensitive data stored in HTML local storage detected. [CWE-312]
    https://docs.bearer.com/reference/rules/javascript_lang_session
    To skip this rule, use the flag --skip-rule=javascript_lang_session
    
    File: juice-shop/frontend/src/app/login/login.component.ts:102
    
     102       localStorage.setItem('email', this.user.email)
    
    
    =====================================
    
    59 checks, 40 findings
    
    CRITICAL: 0
    HIGH: 16 (CWE-22, CWE-312, CWE-798, CWE-89)
    MEDIUM: 24 (CWE-327, CWE-548, CWE-79)
    LOW: 0
    WARNING: 0
    

    In addition of the security report, you can also run a privacy report.

    Ready for the next step? Additional options for using and configuring the scan command can be found in configuring the scan command.

    For more guides and usage tips, view the docs.

    :question: FAQs

    What makes Bearer CLI different from any other SAST tools?

    SAST tools are known to bury security teams and developers under hundreds of issues with little context and no sense of priority, often requiring security analysts to triage issues manually.

    The most vulnerable asset today is sensitive data, so we start there and prioritize findings by assessing sensitive data flows to highlight what is more critical, and what is not. This unique ability allows us to provide you with a privacy scanner too.

    We believe that by linking security issues with a clear business impact and risk of a data breach, or data leak, we can build better and more robust software, at no extra cost.

    In addition, by being Free and Open, extendable by design, and built with a great developer UX in mind, we bet you will see the difference for yourself.

    What is the privacy scanner?

    In addition of detecting security flaws in your code, Bearer CLI allows you to automate the evidence gathering process needed to generate a privacy report for your compliance team.

    When you run Bearer CLI on your codebase, it discovers and classifies data by identifying patterns in the source code. Specifically, it looks for data types and matches against them. Most importantly, it never views the actual values—it just can’t—but only the code itself. If you want to learn more, here is the longer explanation.

    Bearer CLI is able to identify over 120+ data types from sensitive data categories such as Personal Data (PD), Sensitive PD, Personally identifiable information (PII), and Personal Health Information (PHI). You can view the full list in the supported data types documentation.

    Finally, Bearer CLI also lets you detect components storing and processing sensitive data such as databases, internal APIs, and third-party APIs. See the recipe list for a complete list of components.

    Supported Language

    Learn more about language support.

    How long does it take to scan my code? Is it fast?

    It depends on the size of your applications. It can take as little as 20 seconds, up to a few minutes for an extremely large code base.

    As a rule of thumb, Bearer CLI should never take more time than running your test suite.

    In the case of CI integration, we provide a diff scan solution to make it even faster. Learn more.

    What about false positives?

    If you’re familiar with SAST tools, false positives are always a possibility.

    By using the most modern static code analysis techniques and providing a native filtering and prioritizing solution on the most important issues, we believe we have dramatically improved the overall SAST experience.

    We strive to provide the best possible experience for our users. Learn more about how we achieve this.

    When and where to use Bearer CLI?

    We recommend running Bearer CLI in your CI to check new PRs automatically for security issues, so your development team has a direct feedback loop to fix issues immediately.

    You can also integrate Bearer CLI in your CD, though we recommend setting it to only fail on high criticality issues, as the impact for your organization might be important.

    In addition, running Bearer CLI as a scheduled job is a great way to keep track of your security posture and make sure new security issues are found even in projects with low activity.

    Make sure to read our integration strategy guide for more information.

    Do you support interprocedural and inter-file analysis?

    Yes, Bearer Pro supports interprocedural and inter-file analysis, currently with full capabilities for Java, Python, C#, and Go, and actively being extended to other major supported languages. This advanced analysis allows Bearer Pro to trace data flow and control flow across function and file boundaries within an entire codebase. This is crucial for accurately identifying complex vulnerabilities that depend on the interaction of different code components, significantly reducing false positives compared to analyses limited to individual functions or files.

    Bearer Pro's interprocedural and inter-file analysis for Java has demonstrated strong results on the OWASP Java Benchmark, achieving a score of 76% with a reported false positive rate of less than 2%.

    :raised_hand: Get in touch

    Thanks for using Bearer CLI. Still have questions?

    :handshake: Contributing

    Interested in contributing? We're here for it! For details on how to contribute, setting up your development environment, and our processes, review the contribution guide.

    :rotating_light: Code of conduct

    Everyone interacting with this project is expected to follow the guidelines of our code of conduct.

    :shield: Security

    To report a vulnerability or suspected vulnerability, see our security policy. For any questions, concerns or other security matters, feel free to open an issue.

    :mortar_board: License

    Bearer CLI code is licensed under the terms of the Elastic License 2.0 (ELv2), which means you can use it freely inside your organization to protect your applications without any commercial requirements.

    You are not allowed to provide Bearer CLI to third parties as a hosted or managed service without the explicit approval of Bearer Inc.