You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These are some small changes to the usage section of the README, based on conversations with @olivekl.
The goal was to clarify the different options available to the user.
Copy file name to clipboardExpand all lines: README.md
+15-24
Original file line number
Diff line number
Diff line change
@@ -83,46 +83,43 @@ All releases on the same Major version will be guaranteed to have backward compa
83
83
84
84
## Usage
85
85
86
-
OSV-Scanner collects a list of dependencies and versions that are used in your project, before matching this list against the OSV database via the [OSV.dev API](https://osv.dev#use-the-api). To build the list of dependencies, you can point OSV-Scanner at your project directory, or manually pass in the path to individual manifest files.
86
+
OSV-Scanner parses lockfiles, SBOMs, and git directories to determine your project's open source dependencies. These dependencies are matched against the OSV database via the [OSV.dev API](https://osv.dev#use-the-api) and known vulnerabilities are returned to you in the output.
87
87
88
-
### Scan a directory
88
+
### General use case: scanning a directory
89
89
90
-
Walks through a list of directories to find:
90
+
```console
91
+
osv-scanner -r /path/to/your/dir
92
+
```
91
93
92
-
- Lockfiles
93
-
- SBOMs
94
-
- git directories for the latest commit hash
94
+
The preceding command will find lockfiles, SBOMs, and git directories in your target directory and use them to determine the dependencies to check against the OSV database for any known vulnerabilities.
95
95
96
-
which is used to build the list of dependencies to be matched against OSV vulnerabilities.
96
+
The recursive flag `-r` or `--recursive` will tell the scanner to search all subdirectories in addition to the specified directory. It can find additional lockfiles, dependencies, and vulnerabilities. If your project has deeply nested subdirectories, a recursive search may take a long time.
97
97
98
-
Can be configured to recursively walk through subdirectories with the `--recursive` / `-r` flag.
98
+
Git directories are searched for the latest commit hash. Searching for git commit hash is intended to work with projects that use git submodules or a similar mechanism where dependencies are checked out as real git repositories.
99
99
100
-
Searching for git commit hash is intended to work with projects that use
101
-
git submodules or a similar mechanism where dependencies are checked out
102
-
as real git repositories.
100
+
### Specify SBOM
103
101
104
-
#### Example
102
+
If you want to check for known vulnerabilities only in dependencies in your SBOM, you can use the following command:
105
103
106
104
```console
107
-
osv-scanner -r /path/to/your/dir
105
+
osv-scanner --sbom=/path/to/your/sbom.json
108
106
```
109
107
110
-
### Input an SBOM
111
-
112
108
[SPDX] and [CycloneDX] SBOMs using [Package URLs] are supported. The format is
It is possible to specify more than one lockfile at a time.
126
123
127
124
A wide range of lockfiles are supported by utilizing this [lockfile package](https://github.com/google/osv-scanner/tree/main/pkg/lockfile). This is the current list of supported lockfiles:
128
125
@@ -145,12 +142,6 @@ A wide range of lockfiles are supported by utilizing this [lockfile package](htt
0 commit comments