# anthropics/oss-scanner architecture

> Architecture diagram of the GitHub repository anthropics/oss-scanner, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/anthropics/oss-scanner
- Repository: https://github.com/anthropics/oss-scanner

## Overview

OSS Scanner is a hosted service for scanning enrolled open-source projects; this repository primarily contains enrollment records and local validation/build-check tools, not the hosted scanning service itself. Maintainers add a project configuration and build instructions, which can be validated and locally checked. The documented hosted workflow then builds in an isolated VM, scans offline, and emails findings with reproduction steps and proposed patches where available. The hosted scan internals are not present in the sampled source, so that flow is represented only at the documented boundary.

Main entry points: [`projects`](https://github.com/anthropics/oss-scanner/tree/main/projects) (Project enrollment), [`tools/validate.py`](https://github.com/anthropics/oss-scanner/blob/main/tools/validate.py) (Enrollment validator), [`tools/check_build.py`](https://github.com/anthropics/oss-scanner/blob/main/tools/check_build.py) (Build and shell check), [`tools/check_qemu.py`](https://github.com/anthropics/oss-scanner/blob/main/tools/check_qemu.py) (QEMU offline check)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_enrollment["Project enrollment"]
  node_enrollment_files["Project enrollment"]
  node_project_config["Project settings<br/>[project.yaml]"]
  node_dockerfile["Build instructions"]
  node_threat_model["Threat guidance<br/>[threat_model.md]"]
end

subgraph group_local["Local check tools"]
  node_validator["Enrollment validator<br/>[validate.py]"]
  node_build_check["Build and shell check<br/>[check_build.py]"]
  node_qemu_check["QEMU offline check<br/>[check_qemu.py]"]
end

subgraph group_hosted["Hosted scanning"]
  node_project_repo["Upstream project"]
  node_hosted_scanner["Hosted scanner"]
  node_isolated_build["Isolated build"]
  node_offline_audit["Offline audit"]
  node_findings["Findings and patches"]
end

node_maintainer(("Project maintainer"))
node_recipients(("Report recipients"))

node_maintainer -->|"adds project"| node_enrollment_files
node_enrollment_files -->|"configures scan"| node_project_config
node_enrollment_files -->|"provides build"| node_dockerfile
node_enrollment_files -->|"may provide"| node_threat_model
node_maintainer -->|"validates enrollment"| node_validator
node_validator -->|"checks settings"| node_enrollment_files
node_maintainer -->|"checks build"| node_build_check
node_qemu_check -->|"runs build"| node_build_check
node_maintainer -->|"enrolls project"| node_hosted_scanner
node_hosted_scanner -->|"imports project"| node_project_repo
node_hosted_scanner -->|"builds online"| node_isolated_build
node_isolated_build -->|"moves VM"| node_offline_audit
node_hosted_scanner -->|"scans project"| node_offline_audit
node_offline_audit -->|"produces findings"| node_findings
node_hosted_scanner -->|"emails reports"| node_recipients

click node_enrollment_files "https://github.com/anthropics/oss-scanner/tree/main/projects"
click node_project_config "https://github.com/anthropics/oss-scanner/blob/main/templates/project.yaml"
click node_dockerfile "https://github.com/anthropics/oss-scanner/blob/main/templates/Dockerfile"
click node_threat_model "https://github.com/anthropics/oss-scanner/blob/main/templates/threat_model.md"
click node_validator "https://github.com/anthropics/oss-scanner/blob/main/tools/validate.py"
click node_build_check "https://github.com/anthropics/oss-scanner/blob/main/tools/check_build.py"
click node_qemu_check "https://github.com/anthropics/oss-scanner/blob/main/tools/check_qemu.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_enrollment_files,node_project_config,node_dockerfile,node_threat_model toneBlue
class node_validator,node_build_check,node_qemu_check toneAmber
class node_project_repo,node_hosted_scanner,node_isolated_build,node_offline_audit,node_findings toneMint
class node_maintainer,node_recipients toneIndigo
```

## Components

### Project enrollment

- [Project enrollment](https://github.com/anthropics/oss-scanner/tree/main/projects): `projects`
- [Project settings](https://github.com/anthropics/oss-scanner/blob/main/templates/project.yaml): `templates/project.yaml`
- [Build instructions](https://github.com/anthropics/oss-scanner/blob/main/templates/Dockerfile): `templates/Dockerfile`
- [Threat guidance](https://github.com/anthropics/oss-scanner/blob/main/templates/threat_model.md): `templates/threat_model.md`

### Local check tools

- [Enrollment validator](https://github.com/anthropics/oss-scanner/blob/main/tools/validate.py): `tools/validate.py`
- [Build and shell check](https://github.com/anthropics/oss-scanner/blob/main/tools/check_build.py): `tools/check_build.py`
- [QEMU offline check](https://github.com/anthropics/oss-scanner/blob/main/tools/check_qemu.py): `tools/check_qemu.py`

### Hosted scanning

- **Upstream project**
- **Hosted scanner**
- **Isolated build**
- **Offline audit**
- **Findings and patches**

### Other components

- **Project maintainer**
- **Report recipients**

## Connections

- Project maintainer → Project enrollment: adds project (evidence: `README.md`)
- Project enrollment → Project settings: configures scan (evidence: `README.md`)
- Project enrollment → Build instructions: provides build (evidence: `README.md`)
- Project enrollment → Threat guidance: may provide (evidence: `README.md`)
- Project maintainer → Enrollment validator: validates enrollment (evidence: `README.md`)
- Enrollment validator → Project enrollment: checks settings (evidence: `tools/validate.py`)
- Project maintainer → Build and shell check: checks build (evidence: `README.md`)
- QEMU offline check → Build and shell check: runs build (evidence: `tools/check_qemu.py`)
- Project maintainer → Hosted scanner: enrolls project (evidence: `README.md`)
- Hosted scanner → Upstream project: imports project (evidence: `README.md`)
- Hosted scanner → Isolated build: builds online (evidence: `README.md`)
- Isolated build → Offline audit: moves VM (evidence: `README.md`)
- Hosted scanner → Offline audit: scans project (evidence: `README.md`)
- Offline audit → Findings and patches: produces findings (evidence: `README.md`)
- Hosted scanner → Report recipients: emails reports (evidence: `README.md`)
