Skip to content

Commit 9ea2fa0

Browse files
committed
Update docs
1 parent 1887425 commit 9ea2fa0

File tree

1 file changed

+15
-28
lines changed

1 file changed

+15
-28
lines changed

README.md

Lines changed: 15 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Supports human-readable, JSON, CSV and SARIF output. SARIF alerts can be uploade
1616
- Optional progress bar while fetching SBOMs
1717
- Option to suppress secondary rate limit warnings, and full quiet mode to suppress informative messages
1818
- Adaptive backoff: each secondary rate limit hit increases the SBOM fetch delay by 10% to reduce future throttling
19+
- Optional branch scanning†: fetch SBOM diffs with Dependency Review for non-default branches and submit missing dependency snapshots if needed with Component Detection + Dependency Submission
1920
- Offline caching of SBOMs and security advisories with incremental updates
2021
- Matching:
2122
- Version-aware matching of SBOM packages against malware advisories
@@ -27,9 +28,11 @@ Supports human-readable, JSON, CSV and SARIF output. SARIF alerts can be uploade
2728
- Output:
2829
- Human-readable console output
2930
- JSON or CSV output (to stdout or file) with both search and malware matches
30-
- Optional SARIF 2.1.0 output per repository for malware matches with optional Code Scanning upload
31+
- Optional SARIF 2.1.0 output per repository for malware matches
32+
- includes Code Scanning upload†
3133
- Works with GitHub.com, GitHub Enterprise Server, GitHub Enterprise Managed Users and GitHub Enterprise Cloud with Data Residency (custom base URL)
32-
- Optional branch scanning: fetch SBOMs for non-default branches (limited) and compute Dependency Review diffs vs the default (or chosen base) branch
34+
35+
† GitHub Advanced Security or GitHub Code Security required for this feature
3336

3437
## Usage
3538

@@ -83,31 +86,15 @@ If a branch SBOM or diff retrieval fails, the error is recorded but does not sto
8386

8487
#### Handling Missing Dependency Review Snapshots
8588

86-
If the Dependency Review API returns a 404 for a branch diff (commonly due to a missing dependency snapshot on either the base or head commit), the toolkit can optionally attempt to generate and submit a snapshot using the Component Detection + Dependency Submission Action.
89+
If the Dependency Review API returns a 404 for a branch diff (commonly due to a missing dependency snapshot on either the base or head commit), the toolkit can optionally attempt to generate and submit a snapshot using Component Detection and Dependency Submission. This is vendored-in and forked from the public [Component Detection Dependency Submission Action](https://github.com/your-org/component-detection-dependency-submission-action).
8790

8891
Enable automatic submission + retry with:
8992

9093
```bash
9194
--submit-on-missing-snapshot
9295
```
9396

94-
This requires the action repository to be present as a git submodule (or copied) at the path:
95-
96-
```bash
97-
component-detection-dependency-submission-action/
98-
```
99-
100-
After cloning, initialize submodules:
101-
102-
```bash
103-
git submodule update --init --recursive
104-
```
105-
106-
Build the action (if not already built) so its `dist/entrypoint.js` exists. The toolkit will then:
107-
108-
1. Detect 404 from diff endpoint.
109-
2. Invoke the action locally to produce a snapshot for the target branch.
110-
3. Wait briefly then retry the dependency review diff once.
97+
The tool will attempt to download the latest Component Detection release from GitHub Releases into the current directory, to run it, unless you provide a local binary with `--component-detection-bin`.
11198

11299
If submission fails, the original 404 reason is retained and collection proceeds.
113100

@@ -125,15 +112,16 @@ npm run start -- \
125112
--component-detection-bin /usr/local/bin/component-detection
126113
```
127114

128-
GitHub Enterprise Server example:
115+
On MacOS, you may find that system protection prevents running a downloaded binary. You can [check out the .NET code](https://github.com/microsoft/component-detection/) and run it via a wrapper script such as:
129116

130117
```bash
131-
npm run start -- \
132-
--sync-sboms --org my-org --sbom-cache sboms \
133-
--base-url https://ghe.example.com/api/v3 \
134-
--branch-scan --submit-on-missing-snapshot \
135-
--submit-languages Python \
136-
--component-detection-bin /opt/tools/component-detection
118+
#!/bin/bash
119+
120+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
121+
122+
cd "$SCRIPT_DIR" || exit 1
123+
124+
dotnet run --project "./src/Microsoft.ComponentDetection/Microsoft.ComponentDetection.csproj" "$@"
137125
```
138126

139127
Notes:
@@ -214,7 +202,6 @@ Malware-only advisory sync (no SBOM cache required):
214202
```bash
215203
npm run start -- --sync-malware --malware-cache malware-cache --token $GITHUB_TOKEN
216204
```
217-
```
218205

219206
Write malware matches (and optionally search results later) to a JSON file using `--output-file`:
220207

0 commit comments

Comments
 (0)