|
6 | 6 | [](https://slsa.dev)
|
7 | 7 | [](https://github.com/google/osv-scanner/releases)
|
8 | 8 |
|
9 |
| -Use OSV-Scanner to find existing vulnerabilities affecting your project's dependencies. |
| 9 | +Use OSV-Scanner to find existing vulnerabilities affecting your project's dependencies. |
| 10 | +OSV-Scanner provides an officially supported frontend to the [OSV database](https://osv.dev/) and CLI interface to [OSV-Scalibr](https://github.com/google/osv-scalibr) that connects a project’s list of dependencies with the vulnerabilities that affect them. |
10 | 11 |
|
11 |
| -OSV-Scanner provides an officially supported frontend to the [OSV database](https://osv.dev/) that connects a project’s list of dependencies with the vulnerabilities that affect them. Since the OSV.dev database is open source and distributed, it has several benefits in comparison with closed source advisory databases and scanners: |
| 12 | +OSV-Scanner supports a wide range of project types, package managers and features, including but not limited to: |
12 | 13 |
|
13 |
| -- Each advisory comes from an open and authoritative source (e.g. the [RustSec Advisory Database](https://github.com/rustsec/advisory-db)) |
14 |
| -- Anyone can suggest improvements to advisories, resulting in a very high quality database |
| 14 | +- **Languages:** C/C++, Dart, Elixir, Go, Java, Javascript, PHP, Python, R, Ruby, Rust. |
| 15 | +- **Package Managers:** npm, pip, yarn, maven, go modules, cargo, gem, composer, nuget and others. |
| 16 | +- **Operating Systems:** Detects vulnerabilities in OS packages on Linux systems. |
| 17 | +- **Containers:** Scans container images for vulnerabilities in their base images and included packages. |
| 18 | +- **Guided Remediation:** Provides recommendations for package version upgrades based on criteria such as dependency depth, minimum severity, fix strategy, and return on investment. |
| 19 | + |
| 20 | +OSV-Scanner uses the extensible [OSV-Scalibr](https://github.com/google/osv-scalibr) library under the hood to provide this functionality. If a language or package manager is not supported currently, please file a [feature request.](https://github.com/google/osv-scanner/issues) |
| 21 | + |
| 22 | +#### Underlying database |
| 23 | + |
| 24 | +The underlying database, [OSV.dev](https://osv.dev/) has several benefits in comparison with closed source advisory databases and scanners: |
| 25 | + |
| 26 | +- Covering most open source language and OS ecosystems (including [Git](https://osv.dev/list?q=&ecosystem=GIT)), it’s comprehensive. |
| 27 | +- Each advisory comes from an open and authoritative source (e.g. [GitHub Security Advisories](https://github.com/github/advisory-database), [RustSec Advisory Database](https://github.com/rustsec/advisory-db), [Ubuntu security notices](https://github.com/canonical/ubuntu-security-notices/tree/main/osv)) |
| 28 | +- Anyone can suggest improvements to advisories, resulting in a very high quality database. |
15 | 29 | - The OSV format unambiguously stores information about affected versions in a machine-readable format that precisely maps onto a developer’s list of packages
|
16 | 30 |
|
17 |
| -The above all results in fewer, more actionable vulnerability notifications, which reduces the time needed to resolve them. Check out our [announcement blog post] for more details! |
| 31 | +The above all results in accurate and actionable vulnerability notifications, which reduces the time needed to resolve them. Check out [OSV.dev](https://osv.dev/) for more details! |
| 32 | + |
| 33 | +## Basic installation |
| 34 | + |
| 35 | +To install OSV-Scanner, please refer to the [installation section](https://google.github.io/osv-scanner/installation) of our documentation. OSV-Scanner releases can be found on the [releases page](https://github.com/google/osv-scanner/releases) of the GitHub repository. The recommended method is to download a prebuilt binary for your platform. Alternatively, you can use |
| 36 | +`go install github.com/google/osv-scanner/cmd/[email protected]`. |
| 37 | + |
| 38 | +## Key Features |
| 39 | + |
| 40 | +For more information, please read our [detailed documentation](https://google.github.io/osv-scanner) to learn how to use OSV-Scanner. For detailed information about each feature, click their titles in this README. |
| 41 | + |
| 42 | +Please note: These are the instructions for the latest OSV-Scanner V2 beta. If you are using V1, checkout the V1 [README](https://github.com/google/osv-scanner-v1) and [documentation](https://google.github.io/osv-scanner-v1/) instead. |
| 43 | + |
| 44 | +### [Scanning a source directory](https://google.github.io/osv-scanner/usage) |
| 45 | + |
| 46 | +`osv-scanner scan source -r /path/to/your/dir` |
| 47 | +This command will recursively scan the specified directory for any supported package files, such as `package.json`, `go.mod`, `pom.xml`, etc. and output any discovered vulnerabilities. |
| 48 | + |
| 49 | +OSV-Scanner has the option of using call analysis to determine if a vulnerable function is actually being used in the project, resulting in fewer false positives, and actionable alerts. |
| 50 | + |
| 51 | +OSV-Scanner can also detect vendored C/C++ code for vulnerability scanning. See [here](https://google.github.io/osv-scanner/usage/#cc-scanning) for details. |
| 52 | + |
| 53 | +#### Supported Lockfiles |
| 54 | + |
| 55 | +OSV-Scanner supports 11+ language ecosystems and 19+ lockfile types. To check if your ecosystem is covered, please check out our [detailed documentation](https://google.github.io/osv-scanner/supported-languages-and-lockfiles/#supported-lockfiles). |
| 56 | + |
| 57 | +### [Container Scanning](https://google.github.io/osv-scanner/usage/scan-image) |
| 58 | + |
| 59 | +OSV-Scanner also supports comprehensive, layer-aware scanning for container images to detect vulnerabilities the following operating system packages and language-specific dependencies. |
| 60 | + |
| 61 | +| Distro Support | Language Artifacts Support | |
| 62 | +| -------------- | -------------------------- | |
| 63 | +| Alpine OS | Go | |
| 64 | +| Debian | Java | |
| 65 | +| Ubuntu | Node | |
| 66 | +| | Python | |
| 67 | + |
| 68 | +See the [full documentation](https://google.github.io/osv-scanner/supported-languages-and-lockfiles/#supported-artifacts) for details on support. |
| 69 | + |
| 70 | +**Usage**: |
| 71 | + |
| 72 | +`$ osv-scanner scan image my-image-name:tag` |
| 73 | + |
| 74 | + |
| 75 | + |
| 76 | +### [License Scanning](https://google.github.io/osv-scanner/experimental/license-scanning/) (Experimental) |
| 77 | + |
| 78 | +Check your dependencies' licenses using deps.dev data. For a summary: |
| 79 | + |
| 80 | +`osv-scanner --experimental-licenses-summary path/to/repository` |
| 81 | + |
| 82 | +To check against an allowed license list (SPDX format): |
| 83 | + |
| 84 | +`osv-scanner --experimental-licenses="MIT,Apache-2.0" path/to/directory` |
| 85 | + |
| 86 | +### [Offline Scanning](https://google.github.io/osv-scanner/experimental/offline-mode/) (Experimental) |
| 87 | + |
| 88 | +Scan your project against a local OSV database. No network connection is required after the initial database download. The database can also be manually downloaded. |
| 89 | + |
| 90 | +`osv-scanner --experimental-offline --experimental-download-offline-databases ./path/to/your/dir` |
| 91 | + |
| 92 | +### [Guided Remediation](https://google.github.io/osv-scanner/experimental/guided-remediation/) (Experimental) |
| 93 | + |
| 94 | +OSV-Scanner provides guided remediation, a feature that suggests package version upgrades based on criteria such as dependency depth, minimum severity, fix strategy, and return on investment. |
| 95 | +We currently support remediating vulnerabilities in the following files: |
| 96 | + |
| 97 | +| Ecosystem | File Format (Type) | Supported Remediation Strategies | |
| 98 | +| :-------- | :----------------------------- | :---------------------------------------------------------------------------------------------------------------- | |
| 99 | +| npm | `package-lock.json` (lockfile) | [`in-place`](https://google.github.io/osv-scanner/experimental/guided-remediation/#in-place-lockfile-remediation) | |
| 100 | +| npm | `package.json` (manifest) | [`relock`](https://google.github.io/osv-scanner/experimental/guided-remediation/#in-place-lockfile-remediation) | |
| 101 | +| Maven | `pom.xml` (manifest) | [`override`](https://google.github.io/osv-scanner/experimental/guided-remediation/#override-dependency-versions) | |
| 102 | + |
| 103 | +This is available as a headless CLI command, as well as an interactive mode. |
18 | 104 |
|
19 |
| -[announcement blog post]: https://security.googleblog.com/2022/12/announcing-osv-scanner-vulnerability.html |
| 105 | +#### Example (for npm) |
20 | 106 |
|
21 |
| -## Documentation |
| 107 | +`$ osv-scanner fix \--max-depth=3 \--min-severity=5 \--ignore-dev \--non-interactive \--strategy=in-place \-L path/to/package-lock.json` |
22 | 108 |
|
23 |
| -Read our [detailed documentation](https://google.github.io/osv-scanner) to learn how to use OSV-Scanner. |
| 109 | +#### Interactive mode (for npm) |
24 | 110 |
|
25 |
| -## Go toolchain compatibility policy |
| 111 | +`$ osv-scanner fix -M path/to/package.json -L path/to/package-lock.json ` |
26 | 112 |
|
27 |
| -We aim to keep the osv-scanner library packages compatible with supported versions of Go (last 2 Go releases), while always building osv-scanner binaries with the latest version of Go. |
| 113 | +<img src="https://google.github.io/osv-scanner/images/guided-remediation-relock-patches.png" alt="Screenshot of the interactive relock results screen with some relaxation patches selected"> |
28 | 114 |
|
29 | 115 | ## Contribute
|
30 | 116 |
|
|
0 commit comments