@sentriflow/cli 0.9.0-rc.1 → 0.10.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -3
- package/dist/index.js +5167 -1043
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@ npm install -g @sentriflow/cli
|
|
|
12
12
|
bun add -g @sentriflow/cli
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
**Requirements:** Node.js
|
|
15
|
+
**Requirements:** Node.js 22+ or Bun 1.0+. The standalone binaries on [GitHub Releases](https://github.com/sentriflow/sentriflow/releases) and the Docker image (`ghcr.io/sentriflow/cli`) need neither.
|
|
16
16
|
|
|
17
17
|
## Quick Start
|
|
18
18
|
|
|
@@ -142,6 +142,16 @@ A plugin that fails to load stops the run with exit code 2 and a message such as
|
|
|
142
142
|
| `--exclude-pattern <pattern...>` | Regex pattern(s) to exclude files |
|
|
143
143
|
| `--max-depth <number>` | Maximum recursion depth (use with `-R`) |
|
|
144
144
|
| `--progress` | Show progress during directory scanning |
|
|
145
|
+
| `--jobs <n>` | Scan files in `n` worker threads (1 to 64), or `auto` for one per CPU core (at most 8). Default `1` |
|
|
146
|
+
| `--changed-only [git-ref]` | Scan only files changed since the merge base with `git-ref` (default `origin/HEAD`, else `HEAD`), plus uncommitted and untracked files |
|
|
147
|
+
|
|
148
|
+
Files found with `-D` are scanned and reported in order of their path, compared by character code (so `B.cfg` sorts before `a.cfg`), on every platform and runtime.
|
|
149
|
+
|
|
150
|
+
PAN-OS XML exports are not picked up by `-D` unless you list the extension, for example `--extensions xml,cfg,txt` (this replaces the default list). `xml` is left out of the defaults because unrelated XML files such as `pom.xml` would be skipped as undetectable vendors and make the run exit 2. An XML file passed as an argument is always scanned.
|
|
151
|
+
|
|
152
|
+
`--jobs` gives the same output (results, order, stderr messages, exit code) for any value; each worker loads the same rules, packs, plugins, config and suppressions, and what rules print while a file is scanned is printed after that file, in input order. Scans of fewer than 8 files, `--ast`, stdin and single files stay serial. Worker start-up takes about 0.1 s: on 4 cores, 200 files of 9,200 lines took 11.1 s with `--jobs 1` and 4.0 s with `--jobs 4`, while a directory of small files (under about 1 MB in total) gains nothing. If a worker cannot start, the scan runs serially with a note on stderr; if one fails mid-scan, the CLI exits 2.
|
|
153
|
+
|
|
154
|
+
`--changed-only` needs `git` and `-D`; the normal file selection (extensions, `--glob`, excludes) still applies, deleted files are skipped, and an empty selection writes an empty report and exits 0. It exits 2 outside a git repository, for an unknown ref, or when a shallow clone lacks the history (in GitHub Actions, check out with `fetch-depth: 0`). In CI, always pass the ref (for example `--changed-only origin/main`). The scanned repository's git configuration cannot make these git calls run programs: filter drivers (clean, smudge, process), fsmonitor, textconv, external diff and transports are disabled for them.
|
|
145
155
|
|
|
146
156
|
### Security Options
|
|
147
157
|
|
|
@@ -155,7 +165,7 @@ A plugin that fails to load stops the run with exit code 2 and a message such as
|
|
|
155
165
|
|------|---------|
|
|
156
166
|
| `0` | No failed rule at or above the `--fail-on` severity |
|
|
157
167
|
| `1` | At least one failed rule at or above the `--fail-on` severity (default `error`) |
|
|
158
|
-
| `2` | Error: for example a file that cannot be read, a file whose vendor cannot be detected, a rule source (`--rules`, `--pack`, `--json-rules`, config file entries) or plugin that fails to load,
|
|
168
|
+
| `2` | Error: for example a file that cannot be read, a file whose vendor cannot be detected, a rule source (`--rules`, `--pack`, `--json-rules`, config file entries) or plugin that fails to load, an invalid suppression file, a `--changed-only` git error, or a scan worker that fails during a `--jobs` scan |
|
|
159
169
|
|
|
160
170
|
By default only `error`-level findings exit 1. Use `--fail-on warning` or `--fail-on info` for a stricter threshold, or `--fail-on never` to report without failing.
|
|
161
171
|
|
|
@@ -237,7 +247,7 @@ Produces SARIF 2.1.0 output for GitHub Code Scanning and other tools. Passed res
|
|
|
237
247
|
sentriflow router.conf -f sarif --relative-paths > results.sarif
|
|
238
248
|
```
|
|
239
249
|
|
|
240
|
-
Each rule carries its category and tags in `properties`; rules with a CWE also carry a `security-severity` and a CWE relationship (`run.taxonomies`). Each result has a `partialFingerprints.primaryLocationLineHash` built from the rule ID, the message (digits ignored), the text of the reported line and the relative file path, so alerts survive line shifts.
|
|
250
|
+
Each rule carries its category and tags in `properties`; rules with a CWE also carry a `security-severity` and a CWE relationship (`run.taxonomies`). Each result has a `partialFingerprints.primaryLocationLineHash` built from the rule ID, the message (digits ignored), the text of the reported line with its secret words masked and the relative file path, so alerts survive line shifts.
|
|
241
251
|
|
|
242
252
|
> Upgrading from 0.7.x or earlier: fingerprints now include the finding message, so after the upgrade GitHub Code Scanning closes the existing SentriFlow alerts and opens the same findings again as new alerts, once. See the [SARIF guide](https://sentriflow.github.io/sentriflow/cli/sarif).
|
|
243
253
|
|
|
@@ -284,6 +294,8 @@ Or call the CLI yourself:
|
|
|
284
294
|
sarif_file: results.sarif
|
|
285
295
|
```
|
|
286
296
|
|
|
297
|
+
For pull requests, scan only the changed files: check out with `fetch-depth: 0` and add `--changed-only origin/${{ github.base_ref }}` (or the action's `changed-only` input).
|
|
298
|
+
|
|
287
299
|
A Docker image (`ghcr.io/sentriflow/cli`) and a pre-commit hook are also available. See the [integration docs](https://sentriflow.github.io/sentriflow/integrations/).
|
|
288
300
|
|
|
289
301
|
## Configuration File
|