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 4e28391
Browse filesBrowse the repository at this point in the historyBrowse files
Report and enforce existing alerts under --strict-blocking (#459)
* List every existing advisory under --strict-blocking
Existing alerts for --strict-blocking are read from the new full scan
through socketdev's fullscans.stream(). socketdev 3.6.2 merged alerts that
share a type and severity on a package, so only the first CVE of each
severity reached the CLI. The Existing alerts table and the EXISTING
blocking issues count undercounted (3 instead of 8 in the repro), and when
the first CVE of a group was resolved or triaged to monitor or ignore, the
Block CVEs behind it were dropped and the run passed.
socketdev 3.6.3 keys merged alerts on the advisory ID and keeps the most
severe action. Pin it. The CLI's own consolidation already keeps the
advisory ID (Issue.consolidation_key) and filters on error/warn before it
dedupes, so no CLI logic changes.
The new tests run the real FullScans.stream() over a canned response, so
they fail if the pinned SDK collapses advisories again.
Bumps the version to 2.13.1. uv.lock needs `uv lock` once socketdev 3.6.3
is published.
* Note the report output change in the changelog
Full-scan mode with --enable-json, --enable-sarif or --enable-gitlab-security
reads alerts through the same SDK stream, so those reports now list every
advisory on a package too. Diff mode's existing alerts in the GitLab and
FOSSA-format output change the same way.
* Pin socketdev 3.6.4
socketdev 3.6.3 was released without the advisory dedupe fix, which now
ships as 3.6.4. uv.lock still needs `uv lock` once 3.6.4 is published.
* Bump version to 2.13.3
2.13.2 was released from main, so this change needs the next patch version.
* Keep persistent alerts across dependency version changes
Load current alerts for added and updated packages in strict diff
mode. Report findings omitted by the comparison as existing so a Block
advisory that survives a version change still fails the run.
* Lock the published Socket Python SDK 3.6.4
* Preserve blocking actions and advisory details in scan reports
---------
Co-authored-by: lelia <2418071+lelia@users.noreply.github.com>
The `--strict-blocking` flag enforces a zero-tolerance security policy by failing builds when **ANY** security violations with blocking severity exist, not just new ones introduced in the current changes.
607
+
In a scan comparison, `--strict-blocking` fails the build on new and existing findings with a **Block** action.
608
608
609
609
### Standard vs Strict Blocking Behavior
610
610
611
-
**Standard Behavior (Default)**:
612
-
- ✅ Passes if no NEW violations are introduced
613
-
- ❌ Fails only on NEW violations from your changes
- ✅ Passes only if NO violations exist (new or existing)
618
-
- ❌ Fails on ANY violation (new OR existing)
619
-
- 🔴 Enforces zero-tolerance policy
611
+
- **Default** fails on findings introduced by the change that have a **Block** action.
612
+
- **Strict blocking** also checks unchanged dependencies and findings that persist after a version change. For example, if an upgrade leaves a blocking advisory unresolved, the run still fails and the advisory appears under **Existing alerts** at the new version.
620
613
621
614
### Usage Examples
622
615
@@ -668,8 +661,8 @@ Security issues detected by Socket Security:
668
661
### Important Notes
669
662
670
663
- **Diff Mode Only**: The flag applies when a scan comparison runs, with or without SCM integration. A full scan logs a warning and does not evaluate existing violations; see [Scan type by pipeline](ci-cd.md#scan-type-by-pipeline).
671
-
- **Error-Level Only**: Only fails on `error=True` alerts (blocking severity), not warnings.
672
-
- **Existing alerts come from the full scan**: The scan comparison doesn't carry alerts on unchanged packages, so the CLI reads them from the new full scan, at the cost of one more API request per run. If that request fails or omits an unchanged package, the run fails with the infrastructure-error code rather than passing without them.
664
+
- **Policy actions**. Warn findings are reported. If the same finding has both Warn and Block actions, Block takes precedence.
665
+
- **Existing alerts come from the full scan**. The CLI fetches the current full scan when the comparison leaves out alerts on unchanged packages or when a dependency version changes. A failed fetch or a missing package in that response triggers the infrastructure-error exit code.
673
666
- **PR/MR comments**: Existing alerts are listed in their own table after the new ones, blocking first, with license violations grouped per package. `@SocketSecurity ignore` applies to them too. Very large sets are cut off before the comment reaches GitHub's size limit, with a link to the full report. Ignoring every displayed alert preserves the warning about omitted findings;`ignore-all` also clears omitted findings.
674
667
- **Priority**: `--disable-blocking` takes precedence - if both flags are set, the build will always pass.
675
668
- **First Scan**: On the very first scan of a repository, there are no "existing" violations, so behavior is identical to standard mode.
@@ -899,13 +892,11 @@ The GitLab Security Dashboard report and the JSON/SARIF diff outputs use differe
899
892
900
893
| Output Format | Default Alerts | With `--strict-blocking` |
901
894
|:---|:---|:---|
902
-
|`--enable-gitlab-security`|**All** alerts (new + existing) | All alerts (same)|
895
+
| `--enable-gitlab-security` | New alerts and existing alerts on unchanged dependencies | Also includes findings that persist after a version change |
903
896
| `--enable-json` | New alerts only | New + existing alerts |
904
897
| `--enable-sarif` (diff scope) | New alerts only | New + existing alerts |
905
898
906
-
**Why the difference?** GitLab's Security Dashboard is designed to present the full security posture of a project. An empty dashboard on a scan with no dependency changes would be misleading -- the vulnerabilities still exist, they just didn't change. By contrast, JSON and SARIF in diff scope are designed to answer "what changed?" and only include existing alerts when `--strict-blocking` explicitly requests it.
907
-
908
-
>**Tip:** If you use `--enable-json` alongside `--enable-gitlab-security`, the GitLab report may contain more vulnerabilities than the JSON output. This is expected. To make JSON output match, add `--strict-blocking`.
899
+
Enable `--strict-blocking` to include existing findings in JSON and diff-scope SARIF. Scan-based SARIF includes the advisory ID in the rule ID when available, so separate advisories on the same package and manifest remain distinguishable.
|`--enable-json`, `--enable-sarif`, `--enable-gitlab-security` or `--generate-license` on a full scan |`GET orgs/{org}/full-scans/{id}` (scan contents) |`full-scans:list`|
126
-
|`--strict-blocking`, `--enable-gitlab-security` or `--legal-format fossa` on a run that compares scans |`GET orgs/{org}/full-scans/{id}` (alerts on unchanged packages) |`full-scans:list`|
126
+
|`--strict-blocking`, `--enable-gitlab-security` or `--legal-format fossa` on a run that compares scans |`GET orgs/{org}/full-scans/{id}` (existing alerts) |`full-scans:list`|
127
127
128
128
`--reach` also runs the analysis engine with the same token. The engine reports to the
129
129
`tier1-reachability-scan/*` endpoints, which check `full-scans:create`.
0 commit comments