@corgea/cli 1.10.0 → 1.11.0

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 CHANGED
@@ -31,6 +31,64 @@ Once the binary is installed, login with your token from the Corgea app.
31
31
  corgea login <token>
32
32
  ```
33
33
 
34
+ ## Scanning
35
+
36
+ `corgea scan` uploads your project and waits for results. `corgea wait [scan_id]`
37
+ attaches to a running scan; `corgea upload <report> --wait` does the same for a
38
+ third-party report.
39
+
40
+ All three exit 1 if the scan fails, printing the reason and the scanners that hit
41
+ problems. A scan that completes with a scanner missing exits 0 with a warning.
42
+ Waiting gives up after 10 hours; override with `CORGEA_SCAN_TIMEOUT_SECONDS`.
43
+ `--fail`/`--block-on` then wait up to 15 minutes for blocking rules to be
44
+ evaluated; override with `CORGEA_BLOCKING_RULES_TIMEOUT_SECONDS`.
45
+
46
+ `--out-format`/`--out-file` and `--sbom` are honored whether or not a gate
47
+ trips: both are written before `--fail`/`--block-on` are evaluated, so a scan
48
+ that exits 1 on a blocking rule still leaves its report behind to ingest.
49
+
50
+ ### Skipping a re-scan of the same commit
51
+
52
+ A pipeline that re-runs on an unchanged commit can reuse the scan it already
53
+ has instead of paying for a duplicate:
54
+
55
+ ```bash
56
+ corgea scan --skip-if-commit-scanned-recently --block-on criticals
57
+ corgea scan --skip-if-commit-scanned-recently --scanned-within 4h # 90s, 30m, 4h, 7d
58
+ ```
59
+
60
+ When the project already has a completed scan of the current commit inside the
61
+ window (24h by default), that scan takes the new scan's place: the results
62
+ table, the `--block-on` gate and its exit code, and any `--out-file` report all
63
+ come from it, so the pipeline behaves the same whether or not a scan ran. The
64
+ window exists because unchanged code is still exposed to advisories published
65
+ since it was last scanned.
66
+
67
+ Two lines make the outcome scriptable — `CORGEA_SCAN_SKIPPED=true` plus
68
+ `CORGEA_SCAN_ID=<id>` when a scan was reused, `CORGEA_SCAN_SKIPPED=false` when
69
+ one ran — so a later step (an ingest, say) can branch on it.
70
+
71
+ Only a scan that answers the same question is reused, which is stricter than
72
+ "same commit". A candidate has to be a completed BLAST scan of that commit, on a
73
+ branch rather than a pull request, from an explicitly clean worktree, with no
74
+ scanner problems reported — and this run has to be a default whole-commit scan
75
+ itself. Anything else runs a real scan: nothing inside the window, only a failed
76
+ or still-running scan, a worktree that does not match the commit (including
77
+ files the index hides from `git status`), or a lookup the platform could not
78
+ answer.
79
+
80
+ Two things are hard errors instead. An unresolvable commit (not a git
81
+ repository, or no commits yet) exits 1 rather than silently scanning. And a run
82
+ that changes what gets scanned cannot be matched against a candidate — the API
83
+ exposes neither a scan's configured scan types and target policies nor whether
84
+ it bundled a container image — so the flag is rejected alongside `--scan-type`,
85
+ `--policy`, `--include-image`, `--only-uncommitted`, and `--target`.
86
+
87
+ `--exclude` is allowed, and warns on a skip. A reused scan is one of the whole
88
+ commit (an `--exclude` upload is recorded as not matching the commit exactly, so
89
+ it is never itself reusable), which means the results and the gate can cover
90
+ files this run would have skipped — over-reporting, never under-reporting.
91
+
34
92
  ## Dependency Inventory (offline)
35
93
 
36
94
  `corgea deps` builds a dependency inventory from npm, Python, and Java manifests
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corgea/cli",
3
- "version": "1.10.0",
3
+ "version": "1.11.0",
4
4
  "description": "The Corgea CLI. Scan for vulnerabilities, create fixes.",
5
5
  "license": "LGPL-2.1-only",
6
6
  "homepage": "https://corgea.com",