|
| 1 | +[Back to Contents](/docs/README.md) | [简体中文](./Configuration-and-Parameters-zh_CN.md) |
| 2 | + |
| 3 | +- [Command-line Parameters](#command-line-parameters) |
| 4 | +- [Configuration File](#configuration-file) |
| 5 | +- [Ignore Path Configuration](#ignore-path-configuration) |
| 6 | + |
| 7 | +# Command-line Parameters |
| 8 | + |
| 9 | +| Parameter | Description | Example | |
| 10 | +| --------- | ----------- | ------- | |
| 11 | +| `config` | Set the configuration file path | `-config config.json` | |
| 12 | +| `path` | Set the target path. HTTP(S), FTP, and file paths are supported | `-path ./foo` | |
| 13 | +| `out` | Set report output paths. File types are detected by suffix | `-out out.json,out.html` | |
| 14 | +| `log` | Set the log file path | `-log my_log.txt` | |
| 15 | +| `token` | Cloud service token | `-token xxx` | |
| 16 | +| `proj` | SaaS project token | `-proj xxx` | |
| 17 | +| `version` | Print version information | `-version` | |
| 18 | +| `help` | Print help information | `-help` | |
| 19 | + |
| 20 | +# Configuration File |
| 21 | + |
| 22 | +The configuration file uses JSON syntax and supports the following top-level fields: |
| 23 | + |
| 24 | +- `path`: `String` target path. HTTP(S), FTP, and file paths are supported. |
| 25 | +- `out`: `String` report output paths. Supported suffixes include html/json/xml/csv/sqlite/cdx/spdx/swid/dsdx. |
| 26 | +- `optional`: `Object` optional scanning settings. |
| 27 | + - `ui`: `Boolean` enable the interactive UI. Default: `false`. |
| 28 | + - `dedup`: `Boolean` deduplicate identical components and merge paths. Default: `false`. |
| 29 | + - `dir`: `Boolean` scan directories only and skip archives. Default: `false`. |
| 30 | + - `vuln`: `Boolean` keep only vulnerable components. Default: `false`. |
| 31 | + - `progress`: `Boolean` show the progress bar. Default: `true`. |
| 32 | + - `dev`: `Boolean` keep development dependencies. Default: `true`. |
| 33 | + - `tls`: `Boolean` enable TLS certificate verification. Default: `false`. |
| 34 | + - `proxy`: `String` HTTP proxy address. Default: empty. |
| 35 | + - `ignore`: `Array<String>` path rules ignored during scanning. Default: empty. OpenSCA only reads these rules from the current configuration file and does not automatically load the project's `.gitignore`. The syntax is compatible with common `.gitignore` rules, including directory matches, wildcards, and `!` negation. |
| 36 | +- `repo`: `Object` component repository settings for Maven, npm, and Composer. |
| 37 | +- `origin`: `Object` vulnerability database settings. |
| 38 | + |
| 39 | +# Ignore Path Configuration |
| 40 | + |
| 41 | +Use `optional.ignore` to skip test dependencies, temporary directories, or specific archives: |
| 42 | + |
| 43 | +```json |
| 44 | +{ |
| 45 | + "optional": { |
| 46 | + "ignore": [ |
| 47 | + "JarCollection/", |
| 48 | + "*.jar", |
| 49 | + "!libs/keep.jar" |
| 50 | + ] |
| 51 | + } |
| 52 | +} |
| 53 | +``` |
| 54 | + |
| 55 | +The example above skips `JarCollection/` and all `.jar` files, but keeps `libs/keep.jar`. Ignore rules only affect OpenSCA scanning and do not modify project files. |
0 commit comments