socketsecurity 2.2.65__tar.gz → 2.2.68__tar.gz

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.
Files changed (95) hide show
  1. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/PKG-INFO +259 -9
  2. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/README.md +258 -8
  3. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/pyproject.toml +1 -1
  4. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/socketsecurity/__init__.py +1 -1
  5. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/socketsecurity/config.py +25 -0
  6. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/socketsecurity/core/__init__.py +93 -1
  7. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/socketsecurity/core/classes.py +8 -0
  8. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/socketsecurity/core/messages.py +181 -0
  9. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/socketsecurity/output.py +103 -8
  10. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/socketsecurity/socketcli.py +13 -4
  11. socketsecurity-2.2.68/tests/core/test_diff_alerts.py +79 -0
  12. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/tests/unit/test_cli_config.py +21 -1
  13. socketsecurity-2.2.68/tests/unit/test_gitlab_format.py +393 -0
  14. socketsecurity-2.2.68/tests/unit/test_output.py +159 -0
  15. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/uv.lock +1 -1
  16. socketsecurity-2.2.65/tests/unit/test_output.py +0 -54
  17. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/.github/CODEOWNERS +0 -0
  18. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/.github/PULL_REQUEST_TEMPLATE/bug-fix.md +0 -0
  19. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/.github/PULL_REQUEST_TEMPLATE/feature.md +0 -0
  20. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/.github/PULL_REQUEST_TEMPLATE/improvement.md +0 -0
  21. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  22. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/.github/workflows/docker-stable.yml +0 -0
  23. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/.github/workflows/pr-preview.yml +0 -0
  24. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/.github/workflows/release.yml +0 -0
  25. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/.github/workflows/version-check.yml +0 -0
  26. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/.gitignore +0 -0
  27. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/.hooks/sync_version.py +0 -0
  28. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/.pre-commit-config.yaml +0 -0
  29. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/.python-version +0 -0
  30. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/CHANGELOG.md +0 -0
  31. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/Dockerfile +0 -0
  32. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/LICENSE +0 -0
  33. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/Makefile +0 -0
  34. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/docs/README.md +0 -0
  35. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/pytest.ini +0 -0
  36. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/scripts/build_container.sh +0 -0
  37. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/scripts/build_container_flexible.sh +0 -0
  38. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/scripts/deploy-test-docker.sh +0 -0
  39. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/scripts/deploy-test-pypi.sh +0 -0
  40. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/scripts/docker-entrypoint.sh +0 -0
  41. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/scripts/run.sh +0 -0
  42. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/session.md +0 -0
  43. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/socketsecurity/core/cli_client.py +0 -0
  44. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/socketsecurity/core/exceptions.py +0 -0
  45. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/socketsecurity/core/git_interface.py +0 -0
  46. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/socketsecurity/core/helper/__init__.py +0 -0
  47. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/socketsecurity/core/helper/socket_facts_loader.py +0 -0
  48. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/socketsecurity/core/lazy_file_loader.py +0 -0
  49. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/socketsecurity/core/logging.py +0 -0
  50. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/socketsecurity/core/resource_utils.py +0 -0
  51. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/socketsecurity/core/scm/__init__.py +0 -0
  52. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/socketsecurity/core/scm/base.py +0 -0
  53. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/socketsecurity/core/scm/client.py +0 -0
  54. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/socketsecurity/core/scm/github.py +0 -0
  55. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/socketsecurity/core/scm/gitlab.py +0 -0
  56. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/socketsecurity/core/scm_comments.py +0 -0
  57. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/socketsecurity/core/socket_config.py +0 -0
  58. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/socketsecurity/core/tools/reachability.py +0 -0
  59. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/socketsecurity/core/utils.py +0 -0
  60. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/socketsecurity/plugins/__init__.py +0 -0
  61. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/socketsecurity/plugins/base.py +0 -0
  62. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/socketsecurity/plugins/formatters/__init__.py +0 -0
  63. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/socketsecurity/plugins/formatters/slack.py +0 -0
  64. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/socketsecurity/plugins/jira.py +0 -0
  65. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/socketsecurity/plugins/manager.py +0 -0
  66. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/socketsecurity/plugins/slack.py +0 -0
  67. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/socketsecurity/plugins/teams.py +0 -0
  68. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/socketsecurity/plugins/webhook.py +0 -0
  69. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/tests/__init__.py +0 -0
  70. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/tests/core/conftest.py +0 -0
  71. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/tests/core/create_diff_input.json +0 -0
  72. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/tests/core/test_diff_generation.py +0 -0
  73. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/tests/core/test_package_and_alerts.py +0 -0
  74. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/tests/core/test_sdk_methods.py +0 -0
  75. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/tests/core/test_supporting_methods.py +0 -0
  76. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/tests/data/fullscans/create_response.json +0 -0
  77. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/tests/data/fullscans/diff/stream_diff.json +0 -0
  78. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/tests/data/fullscans/diff/stream_diff_full.json +0 -0
  79. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/tests/data/fullscans/head_scan/metadata.json +0 -0
  80. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/tests/data/fullscans/head_scan/stream_scan.json +0 -0
  81. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/tests/data/fullscans/head_scan/stream_scan_full.json +0 -0
  82. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/tests/data/fullscans/new_scan/metadata.json +0 -0
  83. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/tests/data/fullscans/new_scan/stream_scan.json +0 -0
  84. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/tests/data/repos/repo_info_error.json +0 -0
  85. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/tests/data/repos/repo_info_no_head.json +0 -0
  86. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/tests/data/repos/repo_info_success.json +0 -0
  87. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/tests/data/settings/security-policy.json +0 -0
  88. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/tests/unit/__init__.py +0 -0
  89. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/tests/unit/test_client.py +0 -0
  90. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/tests/unit/test_config.py +0 -0
  91. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/tests/unit/test_gitlab_auth.py +0 -0
  92. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/tests/unit/test_gitlab_auth_fallback.py +0 -0
  93. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/workflows/bitbucket-pipelines.yml +0 -0
  94. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/workflows/github-actions.yml +0 -0
  95. {socketsecurity-2.2.65 → socketsecurity-2.2.68}/workflows/gitlab-ci.yml +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: socketsecurity
3
- Version: 2.2.65
3
+ Version: 2.2.68
4
4
  Summary: Socket Security CLI for CI/CD
5
5
  Project-URL: Homepage, https://socket.dev
6
6
  Author-email: Douglas Coburn <douglas@socket.dev>
@@ -137,6 +137,32 @@ This will:
137
137
  - Create a repository in Socket named like `my-repo-mobile-web`
138
138
  - Preserve git context (commits, branch info) from the repository root
139
139
 
140
+ **Generate GitLab Security Dashboard report:**
141
+ ```bash
142
+ socketcli --enable-gitlab-security \
143
+ --repo owner/repo \
144
+ --target-path .
145
+ ```
146
+
147
+ This will:
148
+ - Scan all manifest files in the current directory
149
+ - Generate a GitLab-compatible Dependency Scanning report
150
+ - Save to `gl-dependency-scanning-report.json`
151
+ - Include all actionable security alerts (error/warn level)
152
+
153
+ **Multiple output formats:**
154
+ ```bash
155
+ socketcli --enable-json \
156
+ --enable-sarif \
157
+ --enable-gitlab-security \
158
+ --repo owner/repo
159
+ ```
160
+
161
+ This will simultaneously generate:
162
+ - JSON output to console
163
+ - SARIF format to console
164
+ - GitLab Security Dashboard report to file
165
+
140
166
  ### Requirements
141
167
 
142
168
  - Both `--sub-path` and `--workspace-name` must be specified together
@@ -146,14 +172,15 @@ This will:
146
172
  ## Usage
147
173
 
148
174
  ```` shell
149
- socketcli [-h] [--api-token API_TOKEN] [--repo REPO] [--repo-is-public] [--branch BRANCH] [--integration {api,github,gitlab,azure,bitbucket}]
150
- [--owner OWNER] [--pr-number PR_NUMBER] [--commit-message COMMIT_MESSAGE] [--commit-sha COMMIT_SHA] [--committers [COMMITTERS ...]]
175
+ socketcli [-h] [--api-token API_TOKEN] [--repo REPO] [--repo-is-public] [--branch BRANCH] [--integration {api,github,gitlab,azure,bitbucket}]
176
+ [--owner OWNER] [--pr-number PR_NUMBER] [--commit-message COMMIT_MESSAGE] [--commit-sha COMMIT_SHA] [--committers [COMMITTERS ...]]
151
177
  [--target-path TARGET_PATH] [--sbom-file SBOM_FILE] [--license-file-name LICENSE_FILE_NAME] [--save-submitted-files-list SAVE_SUBMITTED_FILES_LIST]
152
- [--save-manifest-tar SAVE_MANIFEST_TAR] [--files FILES] [--sub-path SUB_PATH] [--workspace-name WORKSPACE_NAME]
153
- [--excluded-ecosystems EXCLUDED_ECOSYSTEMS] [--default-branch] [--pending-head] [--generate-license] [--enable-debug]
154
- [--enable-json] [--enable-sarif] [--disable-overview] [--exclude-license-details] [--allow-unverified] [--disable-security-issue]
155
- [--ignore-commit-files] [--disable-blocking] [--enable-diff] [--scm SCM] [--timeout TIMEOUT] [--include-module-folders]
156
- [--reach] [--reach-version REACH_VERSION] [--reach-analysis-timeout REACH_ANALYSIS_TIMEOUT]
178
+ [--save-manifest-tar SAVE_MANIFEST_TAR] [--files FILES] [--sub-path SUB_PATH] [--workspace-name WORKSPACE_NAME]
179
+ [--excluded-ecosystems EXCLUDED_ECOSYSTEMS] [--default-branch] [--pending-head] [--generate-license] [--enable-debug]
180
+ [--enable-json] [--enable-sarif] [--enable-gitlab-security] [--gitlab-security-file <path>]
181
+ [--disable-overview] [--exclude-license-details] [--allow-unverified] [--disable-security-issue]
182
+ [--ignore-commit-files] [--disable-blocking] [--enable-diff] [--scm SCM] [--timeout TIMEOUT] [--include-module-folders]
183
+ [--reach] [--reach-version REACH_VERSION] [--reach-analysis-timeout REACH_ANALYSIS_TIMEOUT]
157
184
  [--reach-analysis-memory-limit REACH_ANALYSIS_MEMORY_LIMIT] [--reach-ecosystems REACH_ECOSYSTEMS] [--reach-exclude-paths REACH_EXCLUDE_PATHS]
158
185
  [--reach-min-severity {low,medium,high,critical}] [--reach-skip-cache] [--reach-disable-analytics] [--reach-output-file REACH_OUTPUT_FILE]
159
186
  [--only-facts-file] [--version]
@@ -212,6 +239,8 @@ If you don't want to provide the Socket API Token every time then you can use th
212
239
  | --enable-debug | False | False | Enable debug logging |
213
240
  | --enable-json | False | False | Output in JSON format |
214
241
  | --enable-sarif | False | False | Enable SARIF output of results instead of table or JSON format |
242
+ | --enable-gitlab-security | False | False | Enable GitLab Security Dashboard output format (Dependency Scanning report) |
243
+ | --gitlab-security-file | False | gl-dependency-scanning-report.json | Output file path for GitLab Security report |
215
244
  | --disable-overview | False | False | Disable overview output |
216
245
  | --exclude-license-details | False | False | Exclude license details from the diff report (boosts performance for large repos) |
217
246
  | --version | False | False | Show program's version number and exit |
@@ -251,6 +280,7 @@ The CLI will automatically install @coana-tech/cli if not present. Use `--reach`
251
280
  |:-------------------------|:---------|:--------|:----------------------------------------------------------------------|
252
281
  | --ignore-commit-files | False | False | Ignore commit files |
253
282
  | --disable-blocking | False | False | Disable blocking mode |
283
+ | --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. |
254
284
  | --enable-diff | False | False | Enable diff mode even when using --integration api (forces diff mode without SCM integration) |
255
285
  | --scm | False | api | Source control management type |
256
286
  | --timeout | False | | Timeout in seconds for API requests |
@@ -386,6 +416,99 @@ Bot mode (`bot_configs` array items):
386
416
  - `alert_types` (array, optional): Only send specific alert types
387
417
  - `reachability_alerts_only` (boolean, default: false): Only send reachable vulnerabilities when using `--reach`
388
418
 
419
+ ## Strict Blocking Mode
420
+
421
+ 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.
422
+
423
+ ### Standard vs Strict Blocking Behavior
424
+
425
+ **Standard Behavior (Default)**:
426
+ - ✅ Passes if no NEW violations are introduced
427
+ - ❌ Fails only on NEW violations from your changes
428
+ - 🟡 Existing violations are ignored
429
+
430
+ **Strict Blocking Behavior (`--strict-blocking`)**:
431
+ - ✅ Passes only if NO violations exist (new or existing)
432
+ - ❌ Fails on ANY violation (new OR existing)
433
+ - 🔴 Enforces zero-tolerance policy
434
+
435
+ ### Usage Examples
436
+
437
+ **Basic strict blocking:**
438
+ ```bash
439
+ socketcli --target-path ./my-project --strict-blocking
440
+ ```
441
+
442
+ **In GitLab CI:**
443
+ ```bash
444
+ socketcli --target-path $CI_PROJECT_DIR --scm gitlab --pr-number ${CI_MERGE_REQUEST_IID:-0} --strict-blocking
445
+ ```
446
+
447
+ **In GitHub Actions:**
448
+ ```bash
449
+ socketcli --target-path $GITHUB_WORKSPACE --scm github --pr-number $PR_NUMBER --strict-blocking
450
+ ```
451
+
452
+ ### Output Differences
453
+
454
+ **Standard scan output:**
455
+ ```
456
+ Security issues detected by Socket Security:
457
+ - NEW blocking issues: 2
458
+ - NEW warning issues: 1
459
+ ```
460
+
461
+ **Strict blocking scan output:**
462
+ ```
463
+ Security issues detected by Socket Security:
464
+ - NEW blocking issues: 2
465
+ - NEW warning issues: 1
466
+ - EXISTING blocking issues: 5 (causing failure due to --strict-blocking)
467
+ - EXISTING warning issues: 3
468
+ ```
469
+
470
+ ### Use Cases
471
+
472
+ 1. **Zero-Tolerance Security Policy**: Enforce that no security violations exist in your codebase at any time
473
+ 2. **Gradual Security Improvement**: Use alongside standard scans to monitor existing violations while blocking new ones
474
+ 3. **Protected Branch Enforcement**: Require all violations to be resolved before merging to main/production
475
+ 4. **Security Audits**: Scheduled scans that fail if any violations accumulate
476
+
477
+ ### Important Notes
478
+
479
+ - **Diff Mode Only**: The flag only works in diff mode (with SCM integration). In API mode, a warning is logged.
480
+ - **Error-Level Only**: Only fails on `error=True` alerts (blocking severity), not warnings.
481
+ - **Priority**: `--disable-blocking` takes precedence - if both flags are set, the build will always pass.
482
+ - **First Scan**: On the very first scan of a repository, there are no "existing" violations, so behavior is identical to standard mode.
483
+
484
+ ### Flag Combinations
485
+
486
+ **Strict blocking with debugging:**
487
+ ```bash
488
+ socketcli --strict-blocking --enable-debug
489
+ ```
490
+
491
+ **Strict blocking with JSON output:**
492
+ ```bash
493
+ socketcli --strict-blocking --enable-json > security-report.json
494
+ ```
495
+
496
+ **Override for testing** (passes even with violations):
497
+ ```bash
498
+ socketcli --strict-blocking --disable-blocking
499
+ ```
500
+
501
+ ### Migration Strategy
502
+
503
+ **Phase 1: Assessment** - Add strict scan with `allow_failure: true` in CI
504
+ **Phase 2: Remediation** - Fix or triage all violations
505
+ **Phase 3: Enforcement** - Set `allow_failure: false` to block merges
506
+
507
+ For complete GitLab CI/CD examples, see:
508
+ - [`.gitlab-ci-strict-blocking-demo.yml`](.gitlab-ci-strict-blocking-demo.yml) - Comprehensive demo
509
+ - [`.gitlab-ci-strict-blocking-production.yml`](.gitlab-ci-strict-blocking-production.yml) - Production-ready template
510
+ - [`STRICT-BLOCKING-GITLAB-CI.md`](STRICT-BLOCKING-GITLAB-CI.md) - Full documentation
511
+
389
512
  ## Automatic Git Detection
390
513
 
391
514
  The CLI now automatically detects repository information from your git environment, significantly simplifying usage in CI/CD pipelines:
@@ -588,9 +711,136 @@ The manifest archive feature is useful for:
588
711
 
589
712
  ### Differential scan skipped on octopus merge
590
713
 
591
- When your repo uses an **octopus merge** (3+ parents), the CLI may not detect all changed files.
714
+ When your repo uses an **octopus merge** (3+ parents), the CLI may not detect all changed files.
592
715
  This is expected Git behavior: the default diff only compares the merge result to the first parent.
593
716
 
717
+ ## GitLab Security Dashboard Integration
718
+
719
+ Socket CLI can generate reports compatible with GitLab's Security Dashboard, allowing vulnerability information to be displayed directly in merge requests and security dashboards. This feature complements the existing [Socket GitLab integration](https://docs.socket.dev/docs/gitlab) by providing standardized dependency scanning reports.
720
+
721
+ ### Generating GitLab Security Reports
722
+
723
+ To generate a GitLab-compatible security report:
724
+
725
+ ```bash
726
+ socketcli --enable-gitlab-security --repo owner/repo
727
+ ```
728
+
729
+ This creates a `gl-dependency-scanning-report.json` file following GitLab's Dependency Scanning report schema.
730
+
731
+ ### GitLab CI/CD Integration
732
+
733
+ Add Socket Security scanning to your GitLab CI pipeline to generate Security Dashboard reports:
734
+
735
+ ```yaml
736
+ # .gitlab-ci.yml
737
+ socket_security_scan:
738
+ stage: security
739
+ image: python:3.11
740
+ before_script:
741
+ - pip install socketsecurity
742
+ script:
743
+ - socketcli
744
+ --api-token $SOCKET_API_TOKEN
745
+ --repo $CI_PROJECT_PATH
746
+ --branch $CI_COMMIT_REF_NAME
747
+ --commit-sha $CI_COMMIT_SHA
748
+ --enable-gitlab-security
749
+ artifacts:
750
+ reports:
751
+ dependency_scanning: gl-dependency-scanning-report.json
752
+ paths:
753
+ - gl-dependency-scanning-report.json
754
+ expire_in: 1 week
755
+ only:
756
+ - merge_requests
757
+ - main
758
+ ```
759
+
760
+ **Note**: This Security Dashboard integration can be used alongside the [Socket GitLab App](https://docs.socket.dev/docs/gitlab) for comprehensive protection:
761
+ - **Socket GitLab App**: Real-time PR comments, policy enforcement, and blocking
762
+ - **Security Dashboard**: Centralized vulnerability tracking and reporting in GitLab's native interface
763
+
764
+ ### Custom Output Path
765
+
766
+ Specify a custom output path for the GitLab security report:
767
+
768
+ ```bash
769
+ socketcli --enable-gitlab-security --gitlab-security-file custom-path.json
770
+ ```
771
+
772
+ ### Multiple Output Formats
773
+
774
+ GitLab security reports can be generated alongside other output formats:
775
+
776
+ ```bash
777
+ socketcli --enable-json --enable-gitlab-security --enable-sarif
778
+ ```
779
+
780
+ This command will:
781
+ - Output JSON format to console
782
+ - Save GitLab Security Dashboard report to `gl-dependency-scanning-report.json`
783
+ - Save SARIF report (if configured)
784
+
785
+ ### Security Dashboard Features
786
+
787
+ The GitLab Security Dashboard will display:
788
+ - **Vulnerability Severity**: Critical, High, Medium, Low levels
789
+ - **Affected Packages**: Package name, version, and ecosystem
790
+ - **CVE Identifiers**: Direct links to CVE databases when available
791
+ - **Dependency Chains**: Distinction between direct and transitive dependencies
792
+ - **Remediation Suggestions**: Fix recommendations from Socket Security
793
+ - **Alert Categories**: Supply chain risks, malware, vulnerabilities, and more
794
+
795
+ ### Alert Filtering
796
+
797
+ The GitLab report includes **actionable security alerts** based on your Socket policy configuration:
798
+
799
+ **Included Alerts** ✅:
800
+ - **Error-level alerts** (`error: true`) - Security policy violations that block merges
801
+ - **Warning-level alerts** (`warn: true`) - Important security concerns requiring attention
802
+
803
+ **Excluded Alerts** ❌:
804
+ - **Ignored alerts** (`ignore: true`) - Alerts explicitly ignored in your policy
805
+ - **Monitor-only alerts** (`monitor: true` without error/warn) - Tracked but not actionable
806
+
807
+ **Socket Alert Types Detected**:
808
+ - Supply chain risks (malware, typosquatting, suspicious behavior)
809
+ - Security vulnerabilities (CVEs, unsafe code patterns)
810
+ - Risky permissions (network access, filesystem access, shell access)
811
+ - License policy violations
812
+
813
+ All alert types are included in the GitLab report if they're marked as `error` or `warn` by your Socket Security policy, ensuring the Security Dashboard shows only actionable findings.
814
+
815
+ ### Report Schema
816
+
817
+ Socket CLI generates reports compliant with [GitLab Dependency Scanning schema version 15.0.0](https://docs.gitlab.com/ee/development/integrations/secure.html). The reports include:
818
+
819
+ - **Scan metadata**: Analyzer and scanner information
820
+ - **Vulnerabilities**: Detailed vulnerability data with:
821
+ - Unique deterministic UUIDs for tracking
822
+ - Package location and dependency information
823
+ - Severity levels mapped from Socket's analysis
824
+ - Socket-specific alert types and CVE identifiers
825
+ - Links to Socket.dev for detailed analysis
826
+
827
+ ### Requirements
828
+
829
+ - **GitLab Version**: GitLab 12.0 or later (for Security Dashboard support)
830
+ - **Socket API Token**: Set via `$SOCKET_API_TOKEN` environment variable or `--api-token` parameter
831
+ - **CI/CD Artifacts**: Reports must be uploaded as `dependency_scanning` artifacts
832
+
833
+ ### Troubleshooting
834
+
835
+ **Report not appearing in Security Dashboard:**
836
+ - Verify the artifact is correctly configured in `.gitlab-ci.yml`
837
+ - Check that the job succeeded and artifacts were uploaded
838
+ - Ensure the report file follows the correct schema format
839
+
840
+ **Empty vulnerabilities array:**
841
+ - This is normal if no new security issues were detected
842
+ - Check Socket.dev dashboard for full analysis details
843
+
594
844
  ## Development
595
845
 
596
846
  This project uses `pyproject.toml` as the primary dependency specification.
@@ -79,6 +79,32 @@ This will:
79
79
  - Create a repository in Socket named like `my-repo-mobile-web`
80
80
  - Preserve git context (commits, branch info) from the repository root
81
81
 
82
+ **Generate GitLab Security Dashboard report:**
83
+ ```bash
84
+ socketcli --enable-gitlab-security \
85
+ --repo owner/repo \
86
+ --target-path .
87
+ ```
88
+
89
+ This will:
90
+ - Scan all manifest files in the current directory
91
+ - Generate a GitLab-compatible Dependency Scanning report
92
+ - Save to `gl-dependency-scanning-report.json`
93
+ - Include all actionable security alerts (error/warn level)
94
+
95
+ **Multiple output formats:**
96
+ ```bash
97
+ socketcli --enable-json \
98
+ --enable-sarif \
99
+ --enable-gitlab-security \
100
+ --repo owner/repo
101
+ ```
102
+
103
+ This will simultaneously generate:
104
+ - JSON output to console
105
+ - SARIF format to console
106
+ - GitLab Security Dashboard report to file
107
+
82
108
  ### Requirements
83
109
 
84
110
  - Both `--sub-path` and `--workspace-name` must be specified together
@@ -88,14 +114,15 @@ This will:
88
114
  ## Usage
89
115
 
90
116
  ```` shell
91
- socketcli [-h] [--api-token API_TOKEN] [--repo REPO] [--repo-is-public] [--branch BRANCH] [--integration {api,github,gitlab,azure,bitbucket}]
92
- [--owner OWNER] [--pr-number PR_NUMBER] [--commit-message COMMIT_MESSAGE] [--commit-sha COMMIT_SHA] [--committers [COMMITTERS ...]]
117
+ socketcli [-h] [--api-token API_TOKEN] [--repo REPO] [--repo-is-public] [--branch BRANCH] [--integration {api,github,gitlab,azure,bitbucket}]
118
+ [--owner OWNER] [--pr-number PR_NUMBER] [--commit-message COMMIT_MESSAGE] [--commit-sha COMMIT_SHA] [--committers [COMMITTERS ...]]
93
119
  [--target-path TARGET_PATH] [--sbom-file SBOM_FILE] [--license-file-name LICENSE_FILE_NAME] [--save-submitted-files-list SAVE_SUBMITTED_FILES_LIST]
94
- [--save-manifest-tar SAVE_MANIFEST_TAR] [--files FILES] [--sub-path SUB_PATH] [--workspace-name WORKSPACE_NAME]
95
- [--excluded-ecosystems EXCLUDED_ECOSYSTEMS] [--default-branch] [--pending-head] [--generate-license] [--enable-debug]
96
- [--enable-json] [--enable-sarif] [--disable-overview] [--exclude-license-details] [--allow-unverified] [--disable-security-issue]
97
- [--ignore-commit-files] [--disable-blocking] [--enable-diff] [--scm SCM] [--timeout TIMEOUT] [--include-module-folders]
98
- [--reach] [--reach-version REACH_VERSION] [--reach-analysis-timeout REACH_ANALYSIS_TIMEOUT]
120
+ [--save-manifest-tar SAVE_MANIFEST_TAR] [--files FILES] [--sub-path SUB_PATH] [--workspace-name WORKSPACE_NAME]
121
+ [--excluded-ecosystems EXCLUDED_ECOSYSTEMS] [--default-branch] [--pending-head] [--generate-license] [--enable-debug]
122
+ [--enable-json] [--enable-sarif] [--enable-gitlab-security] [--gitlab-security-file <path>]
123
+ [--disable-overview] [--exclude-license-details] [--allow-unverified] [--disable-security-issue]
124
+ [--ignore-commit-files] [--disable-blocking] [--enable-diff] [--scm SCM] [--timeout TIMEOUT] [--include-module-folders]
125
+ [--reach] [--reach-version REACH_VERSION] [--reach-analysis-timeout REACH_ANALYSIS_TIMEOUT]
99
126
  [--reach-analysis-memory-limit REACH_ANALYSIS_MEMORY_LIMIT] [--reach-ecosystems REACH_ECOSYSTEMS] [--reach-exclude-paths REACH_EXCLUDE_PATHS]
100
127
  [--reach-min-severity {low,medium,high,critical}] [--reach-skip-cache] [--reach-disable-analytics] [--reach-output-file REACH_OUTPUT_FILE]
101
128
  [--only-facts-file] [--version]
@@ -154,6 +181,8 @@ If you don't want to provide the Socket API Token every time then you can use th
154
181
  | --enable-debug | False | False | Enable debug logging |
155
182
  | --enable-json | False | False | Output in JSON format |
156
183
  | --enable-sarif | False | False | Enable SARIF output of results instead of table or JSON format |
184
+ | --enable-gitlab-security | False | False | Enable GitLab Security Dashboard output format (Dependency Scanning report) |
185
+ | --gitlab-security-file | False | gl-dependency-scanning-report.json | Output file path for GitLab Security report |
157
186
  | --disable-overview | False | False | Disable overview output |
158
187
  | --exclude-license-details | False | False | Exclude license details from the diff report (boosts performance for large repos) |
159
188
  | --version | False | False | Show program's version number and exit |
@@ -193,6 +222,7 @@ The CLI will automatically install @coana-tech/cli if not present. Use `--reach`
193
222
  |:-------------------------|:---------|:--------|:----------------------------------------------------------------------|
194
223
  | --ignore-commit-files | False | False | Ignore commit files |
195
224
  | --disable-blocking | False | False | Disable blocking mode |
225
+ | --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. |
196
226
  | --enable-diff | False | False | Enable diff mode even when using --integration api (forces diff mode without SCM integration) |
197
227
  | --scm | False | api | Source control management type |
198
228
  | --timeout | False | | Timeout in seconds for API requests |
@@ -328,6 +358,99 @@ Bot mode (`bot_configs` array items):
328
358
  - `alert_types` (array, optional): Only send specific alert types
329
359
  - `reachability_alerts_only` (boolean, default: false): Only send reachable vulnerabilities when using `--reach`
330
360
 
361
+ ## Strict Blocking Mode
362
+
363
+ 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.
364
+
365
+ ### Standard vs Strict Blocking Behavior
366
+
367
+ **Standard Behavior (Default)**:
368
+ - ✅ Passes if no NEW violations are introduced
369
+ - ❌ Fails only on NEW violations from your changes
370
+ - 🟡 Existing violations are ignored
371
+
372
+ **Strict Blocking Behavior (`--strict-blocking`)**:
373
+ - ✅ Passes only if NO violations exist (new or existing)
374
+ - ❌ Fails on ANY violation (new OR existing)
375
+ - 🔴 Enforces zero-tolerance policy
376
+
377
+ ### Usage Examples
378
+
379
+ **Basic strict blocking:**
380
+ ```bash
381
+ socketcli --target-path ./my-project --strict-blocking
382
+ ```
383
+
384
+ **In GitLab CI:**
385
+ ```bash
386
+ socketcli --target-path $CI_PROJECT_DIR --scm gitlab --pr-number ${CI_MERGE_REQUEST_IID:-0} --strict-blocking
387
+ ```
388
+
389
+ **In GitHub Actions:**
390
+ ```bash
391
+ socketcli --target-path $GITHUB_WORKSPACE --scm github --pr-number $PR_NUMBER --strict-blocking
392
+ ```
393
+
394
+ ### Output Differences
395
+
396
+ **Standard scan output:**
397
+ ```
398
+ Security issues detected by Socket Security:
399
+ - NEW blocking issues: 2
400
+ - NEW warning issues: 1
401
+ ```
402
+
403
+ **Strict blocking scan output:**
404
+ ```
405
+ Security issues detected by Socket Security:
406
+ - NEW blocking issues: 2
407
+ - NEW warning issues: 1
408
+ - EXISTING blocking issues: 5 (causing failure due to --strict-blocking)
409
+ - EXISTING warning issues: 3
410
+ ```
411
+
412
+ ### Use Cases
413
+
414
+ 1. **Zero-Tolerance Security Policy**: Enforce that no security violations exist in your codebase at any time
415
+ 2. **Gradual Security Improvement**: Use alongside standard scans to monitor existing violations while blocking new ones
416
+ 3. **Protected Branch Enforcement**: Require all violations to be resolved before merging to main/production
417
+ 4. **Security Audits**: Scheduled scans that fail if any violations accumulate
418
+
419
+ ### Important Notes
420
+
421
+ - **Diff Mode Only**: The flag only works in diff mode (with SCM integration). In API mode, a warning is logged.
422
+ - **Error-Level Only**: Only fails on `error=True` alerts (blocking severity), not warnings.
423
+ - **Priority**: `--disable-blocking` takes precedence - if both flags are set, the build will always pass.
424
+ - **First Scan**: On the very first scan of a repository, there are no "existing" violations, so behavior is identical to standard mode.
425
+
426
+ ### Flag Combinations
427
+
428
+ **Strict blocking with debugging:**
429
+ ```bash
430
+ socketcli --strict-blocking --enable-debug
431
+ ```
432
+
433
+ **Strict blocking with JSON output:**
434
+ ```bash
435
+ socketcli --strict-blocking --enable-json > security-report.json
436
+ ```
437
+
438
+ **Override for testing** (passes even with violations):
439
+ ```bash
440
+ socketcli --strict-blocking --disable-blocking
441
+ ```
442
+
443
+ ### Migration Strategy
444
+
445
+ **Phase 1: Assessment** - Add strict scan with `allow_failure: true` in CI
446
+ **Phase 2: Remediation** - Fix or triage all violations
447
+ **Phase 3: Enforcement** - Set `allow_failure: false` to block merges
448
+
449
+ For complete GitLab CI/CD examples, see:
450
+ - [`.gitlab-ci-strict-blocking-demo.yml`](.gitlab-ci-strict-blocking-demo.yml) - Comprehensive demo
451
+ - [`.gitlab-ci-strict-blocking-production.yml`](.gitlab-ci-strict-blocking-production.yml) - Production-ready template
452
+ - [`STRICT-BLOCKING-GITLAB-CI.md`](STRICT-BLOCKING-GITLAB-CI.md) - Full documentation
453
+
331
454
  ## Automatic Git Detection
332
455
 
333
456
  The CLI now automatically detects repository information from your git environment, significantly simplifying usage in CI/CD pipelines:
@@ -530,9 +653,136 @@ The manifest archive feature is useful for:
530
653
 
531
654
  ### Differential scan skipped on octopus merge
532
655
 
533
- When your repo uses an **octopus merge** (3+ parents), the CLI may not detect all changed files.
656
+ When your repo uses an **octopus merge** (3+ parents), the CLI may not detect all changed files.
534
657
  This is expected Git behavior: the default diff only compares the merge result to the first parent.
535
658
 
659
+ ## GitLab Security Dashboard Integration
660
+
661
+ Socket CLI can generate reports compatible with GitLab's Security Dashboard, allowing vulnerability information to be displayed directly in merge requests and security dashboards. This feature complements the existing [Socket GitLab integration](https://docs.socket.dev/docs/gitlab) by providing standardized dependency scanning reports.
662
+
663
+ ### Generating GitLab Security Reports
664
+
665
+ To generate a GitLab-compatible security report:
666
+
667
+ ```bash
668
+ socketcli --enable-gitlab-security --repo owner/repo
669
+ ```
670
+
671
+ This creates a `gl-dependency-scanning-report.json` file following GitLab's Dependency Scanning report schema.
672
+
673
+ ### GitLab CI/CD Integration
674
+
675
+ Add Socket Security scanning to your GitLab CI pipeline to generate Security Dashboard reports:
676
+
677
+ ```yaml
678
+ # .gitlab-ci.yml
679
+ socket_security_scan:
680
+ stage: security
681
+ image: python:3.11
682
+ before_script:
683
+ - pip install socketsecurity
684
+ script:
685
+ - socketcli
686
+ --api-token $SOCKET_API_TOKEN
687
+ --repo $CI_PROJECT_PATH
688
+ --branch $CI_COMMIT_REF_NAME
689
+ --commit-sha $CI_COMMIT_SHA
690
+ --enable-gitlab-security
691
+ artifacts:
692
+ reports:
693
+ dependency_scanning: gl-dependency-scanning-report.json
694
+ paths:
695
+ - gl-dependency-scanning-report.json
696
+ expire_in: 1 week
697
+ only:
698
+ - merge_requests
699
+ - main
700
+ ```
701
+
702
+ **Note**: This Security Dashboard integration can be used alongside the [Socket GitLab App](https://docs.socket.dev/docs/gitlab) for comprehensive protection:
703
+ - **Socket GitLab App**: Real-time PR comments, policy enforcement, and blocking
704
+ - **Security Dashboard**: Centralized vulnerability tracking and reporting in GitLab's native interface
705
+
706
+ ### Custom Output Path
707
+
708
+ Specify a custom output path for the GitLab security report:
709
+
710
+ ```bash
711
+ socketcli --enable-gitlab-security --gitlab-security-file custom-path.json
712
+ ```
713
+
714
+ ### Multiple Output Formats
715
+
716
+ GitLab security reports can be generated alongside other output formats:
717
+
718
+ ```bash
719
+ socketcli --enable-json --enable-gitlab-security --enable-sarif
720
+ ```
721
+
722
+ This command will:
723
+ - Output JSON format to console
724
+ - Save GitLab Security Dashboard report to `gl-dependency-scanning-report.json`
725
+ - Save SARIF report (if configured)
726
+
727
+ ### Security Dashboard Features
728
+
729
+ The GitLab Security Dashboard will display:
730
+ - **Vulnerability Severity**: Critical, High, Medium, Low levels
731
+ - **Affected Packages**: Package name, version, and ecosystem
732
+ - **CVE Identifiers**: Direct links to CVE databases when available
733
+ - **Dependency Chains**: Distinction between direct and transitive dependencies
734
+ - **Remediation Suggestions**: Fix recommendations from Socket Security
735
+ - **Alert Categories**: Supply chain risks, malware, vulnerabilities, and more
736
+
737
+ ### Alert Filtering
738
+
739
+ The GitLab report includes **actionable security alerts** based on your Socket policy configuration:
740
+
741
+ **Included Alerts** ✅:
742
+ - **Error-level alerts** (`error: true`) - Security policy violations that block merges
743
+ - **Warning-level alerts** (`warn: true`) - Important security concerns requiring attention
744
+
745
+ **Excluded Alerts** ❌:
746
+ - **Ignored alerts** (`ignore: true`) - Alerts explicitly ignored in your policy
747
+ - **Monitor-only alerts** (`monitor: true` without error/warn) - Tracked but not actionable
748
+
749
+ **Socket Alert Types Detected**:
750
+ - Supply chain risks (malware, typosquatting, suspicious behavior)
751
+ - Security vulnerabilities (CVEs, unsafe code patterns)
752
+ - Risky permissions (network access, filesystem access, shell access)
753
+ - License policy violations
754
+
755
+ All alert types are included in the GitLab report if they're marked as `error` or `warn` by your Socket Security policy, ensuring the Security Dashboard shows only actionable findings.
756
+
757
+ ### Report Schema
758
+
759
+ Socket CLI generates reports compliant with [GitLab Dependency Scanning schema version 15.0.0](https://docs.gitlab.com/ee/development/integrations/secure.html). The reports include:
760
+
761
+ - **Scan metadata**: Analyzer and scanner information
762
+ - **Vulnerabilities**: Detailed vulnerability data with:
763
+ - Unique deterministic UUIDs for tracking
764
+ - Package location and dependency information
765
+ - Severity levels mapped from Socket's analysis
766
+ - Socket-specific alert types and CVE identifiers
767
+ - Links to Socket.dev for detailed analysis
768
+
769
+ ### Requirements
770
+
771
+ - **GitLab Version**: GitLab 12.0 or later (for Security Dashboard support)
772
+ - **Socket API Token**: Set via `$SOCKET_API_TOKEN` environment variable or `--api-token` parameter
773
+ - **CI/CD Artifacts**: Reports must be uploaded as `dependency_scanning` artifacts
774
+
775
+ ### Troubleshooting
776
+
777
+ **Report not appearing in Security Dashboard:**
778
+ - Verify the artifact is correctly configured in `.gitlab-ci.yml`
779
+ - Check that the job succeeded and artifacts were uploaded
780
+ - Ensure the report file follows the correct schema format
781
+
782
+ **Empty vulnerabilities array:**
783
+ - This is normal if no new security issues were detected
784
+ - Check Socket.dev dashboard for full analysis details
785
+
536
786
  ## Development
537
787
 
538
788
  This project uses `pyproject.toml` as the primary dependency specification.
@@ -6,7 +6,7 @@ build-backend = "hatchling.build"
6
6
 
7
7
  [project]
8
8
  name = "socketsecurity"
9
- version = "2.2.65"
9
+ version = "2.2.68"
10
10
  requires-python = ">= 3.10"
11
11
  license = {"file" = "LICENSE"}
12
12
  dependencies = [
@@ -1,3 +1,3 @@
1
1
  __author__ = 'socket.dev'
2
- __version__ = '2.2.65'
2
+ __version__ = '2.2.68'
3
3
  USER_AGENT = f'SocketPythonCLI/{__version__}'