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
Copy file name to clipboardExpand all lines: README.md
+113
Original file line number
Diff line number
Diff line change
@@ -322,6 +322,119 @@ environmentManifest:
322
322
323
323
Using this mechanism you can also overwrite the default manifest entries, e.g. "go" or "yarn".
324
324
325
+
## SBOM and Vulnerability Scanning
326
+
327
+
Leeway includes built-in support for Software Bill of Materials (SBOM) generation and vulnerability scanning. This feature helps you identify and manage security vulnerabilities in your software supply chain.
328
+
329
+
### Enabling SBOM Generation
330
+
331
+
SBOM generation is configured in your `WORKSPACE.yaml` file:
When enabled, Leeway automatically generates SBOMs for each package during the build process in multiple formats (CycloneDX, SPDX, and Syft JSON) using [Syft](https://github.com/anchore/syft). These SBOMs are included in the package's build artifacts.
344
+
345
+
### Vulnerability Scanning
346
+
347
+
When `scanVulnerabilities` is enabled, Leeway scans the generated SBOMs for vulnerabilities using [Grype](https://github.com/anchore/grype). The scan results are written to the build directory in multiple formats:
348
+
349
+
- `vulnerabilities.txt`- Human-readable table format
350
+
- `vulnerabilities.json`- Detailed JSON format
351
+
- `vulnerabilities.cdx.json`- CycloneDX format
352
+
- `vulnerabilities.sarif`- SARIF format for integration with code analysis tools
353
+
354
+
#### Configuring Build Failure Thresholds
355
+
356
+
The `failOn` setting determines which vulnerability severity levels will cause a build to fail. Omit this configuration to generate only the reports without causing the build to fail. For example:
357
+
358
+
```yaml
359
+
failOn: ["critical", "high"] # Fail on critical and high vulnerabilities
Leeway provides a flexible system for ignoring specific vulnerabilities. Ignore rules can be defined at both the workspace level (in `WORKSPACE.yaml`) and the package level (in `BUILD.yaml`). For detailed documentation on ignore rules, see [Grype's documentation on specifying matches to ignore](https://github.com/anchore/grype/blob/main/README.md#specifying-matches-to-ignore).
367
+
368
+
#### Ignore Rule Configuration
369
+
370
+
Ignore rules use Grype's powerful filtering capabilities:
371
+
372
+
```yaml
373
+
# In WORKSPACE.yaml (workspace-level rules)
374
+
sbom:
375
+
ignoreVulnerabilities:
376
+
# Basic usage - ignore a specific CVE
377
+
- vulnerability: "CVE-2023-1234"
378
+
reason: "Not exploitable in our context"
379
+
380
+
# Advanced usage - ignore a vulnerability only for a specific package
381
+
- vulnerability: "GHSA-abcd-1234-efgh"
382
+
reason: "Mitigated by our application architecture"
383
+
package:
384
+
name: "vulnerable-pkg"
385
+
version: "1.2.3"
386
+
387
+
# Using fix state
388
+
- vulnerability: "CVE-2023-5678"
389
+
reason: "Will be fixed in next dependency update"
390
+
fix-state: "fixed"
391
+
392
+
# Using VEX status
393
+
- vulnerability: "CVE-2023-9012"
394
+
reason: "Not affected as we don't use the vulnerable component"
0 commit comments