oss-scanner README

The project's README from github.com/anthropics/oss-scanner. As one markdown file: README.md.

OSS Scanner

OSS Scanner is a service by Anthropic to scan critical open-source repositories for security vulnerabilities. Learn more about the service at red.anthropic.com/oss-scanner.

Note, use of this tool is subject to the terms and conditions outlined in the OSS Scanner terms.

How to sign up

Enroll an open-source project by opening a pull request that adds one directory:

projects/<name>

Our security scanner builds your project in an isolated VM, then analyses it with no Internet access and emails what it finds to primary_contact (and any CCs), each with a reproducer and a proposed patch where available. Reports are model-generated and are not reviewed by a human. Because of this we do not place a 90-day disclosure period on these findings and will not make them public. Project owners should provide project.yaml (to configure the scanner), a Dockerfile (stating how to build the project), and optionally a threat_model.md (providing project-specific threat modeling).

project.yaml

Start from templates/project.yaml:

repo: https://github.com/example/project    # required: the git repository to scan; add #branch to pin one
primary_contact: [email protected]       # required: reports and build problems go here (one address)
auto_ccs:                                   # optional: more addresses on every mail
  - [email protected]
homepage: https://example.org               # optional
disabled: false                             # optional: true pauses reports without removing the enrolment
dockerfile: .oss-scanner/Dockerfile         # required unless a Dockerfile sits in this repo next to your project.yaml
threat_model: .oss-scanner/threat_model.md  # optional; also supports placing the file in this repository

repo and primary_contact are always required. dockerfile is required unless you keep your Dockerfile next to project.yaml (see below). Others are optional.

The email addresses in project.yaml are public. Use addresses you are happy to see published, such as a security alias.

To receive reports encrypted, add your armored OpenPGP public key. Reports then go to primary_contact only; pgp cannot be combined with auto_ccs:

pgp: |
  -----BEGIN PGP PUBLIC KEY BLOCK-----
  mQINBF...
  -----END PGP PUBLIC KEY BLOCK-----

You must provide a Dockerfile, in exactly one of two places:

(The threat model works the same way. Set the threat_model field for its location in your repository, or place it here at projects/<name>/threat_model.md.)

The purpose of the Dockerfile is to set up your environment, install every dependency, and build the project. Initial project setup runs with network access enabled, but the security audit after it runs without Internet access. Anything the build or the tests need must be fetched during the initial Dockerfile setup. We recommend checking that your tests pass inside the built image.

The threat_model.md (optional but strongly recommended) file allows you to provide the scanner with documentation on your intended security goals. We have found it is most useful to provide guidance for how you rate the severity of reports (e.g., do you consider post-auth SQLi high or critical? are buffer overflows without demonstrated exploits capped at high? when is stored XSS medium, high, and critical?) This file can also state what the project does, where untrusted input enters, which components matter and which are out of scope, how you would like reports and patches to look, or anything else you think important or useful.

We suggest you run two commands before opening a pull request:

These tools need your host to have installed git, Docker, and Python 3 with PyYAML (pip install pyyaml); --qemu needs Linux on x86-64 with QEMU instead of Docker.

What happens after the merge

  1. The scanner imports the project, builds it online in an isolated VM, then moves the VM to a network with no Internet access for scanning. If the build fails, we will email primary_contact with an error message.
  2. We scan the project for vulnerabilities.
  3. Findings are emailed to primary_contact and any additional CCs with reproduction steps and a proposed patch where available.

You can edit your project at any time with a PR. To unenroll your project, set the disabled field to true to pause reports or remove projects/\<name\>/ to withdraw the project entirely.

Security considerations

Learn more

Please visit red.anthropic.com/oss-scanner.


Maintenance status: this repository is actively maintained by Anthropic. We review and merge enrollment pull requests (changes under projects/<name>/) only; we do not accept other contributions, including changes to tools/ or templates/. See CONTRIBUTING.md for how to enroll, SECURITY.md to report a vulnerability in this repository, and CODE_OF_CONDUCT.md.

oss-scanner (anthropics/oss-scanner)

Searching Database…

这是什么?OSS Scanner 是 Anthropic 运营的一项服务,为注册进来的开源仓库扫描安全漏洞,在隔离的虚拟机里构建每个项目,并通过邮件把复现程序和建议补丁发给维护者。
这是要我自己运行的工具,还是只要把项目注册给 Anthropic 就行?两者都不是——它不是本地应用,也不是你运行的库;你通过向本仓库发起 pull request 来注册项目,之后由 Anthropic 自己的基础设施来构建并扫描它。
怎么把我的项目注册进扫描服务?发起一个 PR,添加一个 projects/ / 目录,里面放一个 project.yaml(以 templates/project.yaml 为模板,填入你的仓库和 primarycontact),再加一个能构建你项目的 Dockerfile,可选地附上 threatmodel.md。
发起 PR 之前,本地需要什么来测试我的注册配置?tools/validate.py 和 tools/check 需要 git、Docker,以及装好 PyYAML 的 Python 3;--qemu 变体则需要 x86-64 的 Linux,用 QEMU 代替 Docker。
漏洞报告在我看到之前会有人工审核吗?不会——报告由模型生成、没有人工审核,这也是 Anthropic 不对它们执行 90 天披露期限、也不公开发现结果的原因。
扫描器在检查我的代码时能上互联网吗?只有在初始构建阶段可以——项目先在隔离虚拟机里联网构建,然后这台虚拟机被移到没有互联网的网络里,才开始真正的漏洞扫描。
Claude Code 在扫描流程里起什么作用?tools/check 会完全按照线上扫描器的做法把 Claude Code 装进构建镜像,因为 Claude Code 正是分析离线构建成果并起草建议补丁的引擎。
我可以把 Dockerfile 放在我自己的项目仓库里,而不是这个仓库吗?可以,而且这是推荐做法——只要把 dockerfile: 指向你自家仓库里的路径,以后更新构建就不用在这个仓库发 PR 了。
怎么停止接收扫描器的报告?在你的 project.yaml 里设置 disabled: true 即可暂停报告,或者干脆删掉你的 projects/ / 文件夹,把项目从这项服务里撤下。
Creator
anthropics
Size
1.2 MB
Stars
1.1K
Updated
CommitOct 18
Age
10d
Commits · 90 Days