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
{{ message }}
Repository navigation
Commit 766e50b
Browse filesBrowse the repository at this point in the historyBrowse files
| `0` | Successful report, skipped SCM event, or `--disable-blocking` set; findings gate only evaluated diffs |
223
223
| `1` | Blocking security finding(s) detected |
224
224
| `2` | Invalid flags or configuration (usage error), including argparse's own errors |
225
225
| `3` | Infrastructure or API error: missing API or SCM token, permission or plan problem, timeout, network failure, incomplete scan comparison, unexpected error |
@@ -278,6 +278,11 @@ Blocking findings still exit `1`. With `--strict-blocking`, existing blocking
278
278
alerts can now fail jobs that previously passed. GitLab report findings also get
279
279
new IDs once; see the [release notes](CHANGELOG.md#2130).
280
280
281
+
Configuration is validated before credentials or network setup. Use native
282
+
JSON/TOML booleans such as `false`, a positive integer `timeout`, and an array of
283
+
file paths for `files`. Invalid or unreadable configuration exits `2` even when
284
+
credentials are missing or blocking is disabled.
285
+
281
286
For a compact comparison of failure-handling policies, see
282
287
[Exit codes in CI](docs/ci-cd.md#exit-codes-in-ci).
Copy file name to clipboardExpand all lines: docs/cli-reference.md
+10-3Lines changed: 10 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -358,7 +358,7 @@ If you don't want to provide the Socket API Token every time then you can use th
358
358
359
359
**Reachability Analysis Requirements:**
360
360
361
-
The Python CLI verifies the following **up front** (before invoking the analysis engine) and exits with code **3**if any are unmet:
361
+
The Python CLI verifies the following **up front** (before invoking the analysis engine). Missing requirements use the infrastructure-error code (`3` by default), subject to `--exit-code-on-api-error` and `--disable-blocking`:
362
362
- `node` - Required to run the analysis engine (the Coana CLI). The engine needs Node.js 22.13 or later.
363
363
- `uv` - Required by the analysis engine
364
364
- An **Enterprise** Socket organization plan (any `enterprise*` plan, including Enterprise trials)
@@ -372,7 +372,7 @@ Separately, the analysis engine (coana) needs the **per-ecosystem build toolchai
372
372
| Host | Used for | If blocked |
373
373
|---|---|---|
374
374
| `api.socket.dev` | Socket API calls, and a signed URL for the engine download | The CLI fails |
375
-
| `storage.googleapis.com` | Downloading the engine and its analyzers (about 120 MB) | The CLI exits with code **3**: `Failed to run reachability analysis: HTTPSConnectionPool(host='storage.googleapis.com', ...)` |
375
+
| `storage.googleapis.com` | Downloading the engine and its analyzers (about 120 MB) | The CLI reports an infrastructure error (`3` by default, subject to the exit-code flags): `Failed to run reachability analysis: HTTPSConnectionPool(host='storage.googleapis.com', ...)` |
376
376
| The package registry of each scanned ecosystem, for example `registry.npmjs.org` | Installing your project's dependencies for analysis | The scan still completes, but the affected vulnerabilities are reported as `INSTALL ERROR` with no reachability result |
377
377
378
378
The engine comes from Socket, not npm, so an npm mirror or registry proxy does not cover the engine download. The registry row does not apply when your dependencies are already installed in the target path, for example a `node_modules` directory from an earlier `npm ci`. The engine is cached as described below; with a warm cache, `storage.googleapis.com` is not contacted.
@@ -389,6 +389,13 @@ Socket's reachability analysis comes in three forms, referred to by their full n
389
389
390
390
## Config file support
391
391
392
+
Values are validated after CLI overrides and before scan setup. Boolean options
393
+
use native JSON/TOML booleans; integer options use integers, with `timeout` greater
394
+
than zero. `files` accepts an array of nonempty file paths, or its JSON string
395
+
representation. Invalid values and unreadable config files exit `2`, including
396
+
with `--disable-blocking`. Runtime exit policy uses the configuration loaded at
397
+
startup; changing or removing the file during a run does not change its exit code.
398
+
392
399
Use `--config <path>` to load defaults from a `.toml` or `.json` file.
393
400
CLI arguments always take precedence over config file values.
394
401
@@ -446,7 +453,7 @@ The CLI runs a pinned version of the Coana CLI, the analysis engine; it does **n
446
453
| `--strict-blocking` | False | False | Fail on ANY security policy violations (blocking severity), not just new ones. Only works in diff mode. See [Strict Blocking Mode](#strict-blocking-mode) for details. |
447
454
| `--enable-diff` | False | False | Enable diff mode even when using `--integration api` (forces diff mode without SCM integration) |
448
455
| `--scm` | False | api | Source control management type |
449
-
| `--timeout` | False | 1200 | Timeout in seconds for each API request. This is not a total CLI runtime limit and does not limit local discovery, Git, or reachability analysis. |
456
+
| `--timeout` | False | 1200 | Positive integer timeout in seconds for each API request. This is not a total CLI runtime limit and does not limit local discovery, Git, or reachability analysis. |
Copy file name to clipboardExpand all lines: docs/troubleshooting.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@
4
4
5
5
| Symptom | What to check |
6
6
|---------|---------------|
7
-
| Exit `2`, even with `--disable-blocking`| Fix the flags or configuration reported in the logs. Usage errors are never suppressed. |
7
+
| Exit `2`, even with `--disable-blocking`| Fix the flags or configuration reported in the logs. Check config-file readability, native boolean/integer values, a positive timeout and the `files` array. Usage errors are never suppressed. |
8
8
| Exit `3` with no reported findings | Check tokens, scopes, baseline lookup and scan-completeness errors. This is a failed evaluation; `--exit-code-on-api-error` can remap its code. |
9
9
| Ctrl+C is treated as a configuration error | Update wrapper/CI rules: Ctrl+C changed from `2` to `130` in 2.13.0. |
10
10
| Exit `0` despite expected blockers | Check `--disable-blocking`, remapping to `0`, and whether the run produced a full scan instead of a diff. Full scans do not gate on findings. |
description="The Socket Security CLI will get the head scan for the provided repo from Socket, create a new one, and then report any alerts introduced by the changes. Any new alerts will cause the CLI to exit with a non-Zero exit code (1 for error alerts, 5 for warnings)."
557
+
description="Scan dependencies and report security alerts. In diff mode, blocking findings exit 1; "
0 commit comments