oss-scanner README

README проекта с github.com/anthropics/oss-scanner. Одним файлом markdown: 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), a report_guidelines.md and a patch_guidelines.md (saying how you would like reports and patches to look).

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
# report_guidelines: .oss-scanner/report_guidelines.md  # optional; the same
# patch_guidelines: .oss-scanner/patch_guidelines.md    # optional; the same

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 email reports encrypted, add your armored OpenPGP public key. They 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-----

To choose where reports go, set the lowest severity each channel receives: low, medium, high, critical, or none to turn the channel off. A channel you leave out uses the default shown here, and a report at or above both minimums goes to both channels. pgp only applies to email, so GitHub reports are not encrypted to your key:

output_format:
  email:
    min_severity: low
  github_security_advisory:          # GitHub private vulnerability reporting
    min_severity: none

To turn on GitHub reports, first enable private vulnerability reporting on your repository and add oss-scanner as a trusted reporter. Anthropic operates the oss-scanner account, which our reports come from; without this, GitHub limits how many it can send you. We ask you to confirm it on your pull request before we merge.

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. So do the report guidelines and the patch guidelines, with the report_guidelines and patch_guidelines fields.)

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, or anything else you think important or useful.

Two more files (optional but strongly recommended) let you say how you would like our reports and patches to look:

Start from templates/report_guidelines.md and templates/patch_guidelines.md. Both are plain text of at most 16 KiB.

These files only change how reports and patches are written; what is in scope and how you rate severity belong in threat_model.md. Each file is checked automatically before it is used. One that tries to change more than that, for example to leave findings out or to run unrelated commands, is ignored as a whole.

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)

Ищем в базе…

Что это?OSS Scanner — сервис от Anthropic, который сканирует подключённые open-source репозитории на уязвимости безопасности: каждый проект собирается в изолированной VM, а мейнтейнеру на почту приходит воспроизводимый пример и предложенный патч ко всему найденному.
Это инструмент, который я запускаю сам, или я просто подключаю свой проект к Anthropic?Это ни локальное приложение, ни запускаемая библиотека — вы подключаете проект, открыв pull request в этот репозиторий, после чего собственная инфраструктура Anthropic собирает и сканирует его.
Как подключить свой проект к сканеру?Откройте PR, добавляющий каталог projects/<name>/ с project.yaml (на основе templates/project.yaml), где указаны ваш репозиторий и primarycontact, плюс Dockerfile, собирающий ваш проект, и опционально threatmodel.md.
Что нужно локально, чтобы проверить своё подключение до открытия PR?tools/validate.py и tools/check требуют git, Docker и Python 3 с установленным PyYAML; вариант с --qemu требует Linux на x86-64 с QEMU вместо Docker.
Проверяет ли человек отчёты об уязвимостях до того, как я их увижу?Нет — отчёты генерируются моделью и человеком не проверяются; поэтому Anthropic не применяет к ним 90-дневное окно раскрытия и не публикует результаты.
Есть ли у сканера доступ в интернет, пока он изучает мой код?Только во время первичной сборки — проект собирается онлайн в изолированной VM, затем эту VM переносят в сеть без доступа в интернет и лишь после этого запускают само сканирование на уязвимости.
Какую роль Claude Code играет в процессе сканирования?tools/check устанавливает Claude Code в образ сборки точно так же, как это делает боевой сканер, поскольку Claude Code — движок, который анализирует офлайн-сборку и готовит предложенный патч.
Можно хранить мой Dockerfile в собственном репозитории проекта, а не в этом?Да, и это предпочтительный вариант — просто укажите в dockerfile: путь к нему в своём репозитории, чтобы обновлять сборку, вообще не открывая PR здесь.
Как перестать получать отчёты от сканера?Поставьте disabled: true в project.yaml, чтобы приостановить отчёты, или удалите свою папку projects/<name>/ целиком, чтобы вывести проект из сервиса.
Автор
anthropics
Размер
3.5 MB
Звёзды
1.8K
Обновлён
КоммитNov 18
Возраст
1 мес
Коммиты · 90 дней