socketsecurity 2.4.9__tar.gz → 2.4.10__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.
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/CHANGELOG.md +15 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/PKG-INFO +1 -1
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/docs/cli-reference.md +3 -2
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/pyproject.toml +1 -1
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/socketsecurity/__init__.py +1 -1
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/socketsecurity/config.py +13 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/socketsecurity/core/socket_config.py +4 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/socketsecurity/socketcli.py +14 -2
- socketsecurity-2.4.10/tests/unit/test_include_dirs.py +99 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/uv.lock +1 -1
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/.github/CODEOWNERS +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/.github/PULL_REQUEST_TEMPLATE/bug-fix.md +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/.github/PULL_REQUEST_TEMPLATE/feature.md +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/.github/PULL_REQUEST_TEMPLATE/improvement.md +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/.github/actions/setup-docker/action.yml +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/.github/actions/setup-hatch/action.yml +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/.github/actions/setup-sfw/action.yml +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/.github/dependabot.yml +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/.github/workflows/dependency-review.yml +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/.github/workflows/docker-stable.yml +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/.github/workflows/e2e-test.yml +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/.github/workflows/pr-preview.yml +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/.github/workflows/python-tests.yml +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/.github/workflows/release.yml +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/.github/workflows/version-check.yml +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/.github/zizmor.yml +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/.gitignore +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/.hooks/sync_version.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/.pre-commit-config.yaml +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/.python-version +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/Dockerfile +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/LICENSE +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/Makefile +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/README.md +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/docs/ci-cd.md +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/docs/development.md +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/docs/troubleshooting.md +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/examples/config/sarif-dashboard-parity.json +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/examples/config/sarif-dashboard-parity.toml +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/examples/config/sarif-diff-ci-cd.json +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/examples/config/sarif-diff-ci-cd.toml +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/examples/config/sarif-instance-detail.json +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/examples/config/sarif-instance-detail.toml +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/instructions/gitlab-commit-status/uat.md +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/pytest.ini +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/scripts/build_container.sh +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/scripts/build_container_flexible.sh +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/scripts/deploy-test-docker.sh +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/scripts/deploy-test-pypi.sh +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/scripts/docker-entrypoint.sh +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/scripts/run.sh +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/session.md +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/socket.yml +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/socketsecurity/core/__init__.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/socketsecurity/core/alert_selection.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/socketsecurity/core/classes.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/socketsecurity/core/cli_client.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/socketsecurity/core/cli_run.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/socketsecurity/core/exceptions.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/socketsecurity/core/git_interface.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/socketsecurity/core/helper/__init__.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/socketsecurity/core/helper/socket_facts_loader.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/socketsecurity/core/lazy_file_loader.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/socketsecurity/core/log_uploader.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/socketsecurity/core/logging.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/socketsecurity/core/messages.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/socketsecurity/core/resource_utils.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/socketsecurity/core/scm/__init__.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/socketsecurity/core/scm/base.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/socketsecurity/core/scm/client.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/socketsecurity/core/scm/github.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/socketsecurity/core/scm/gitlab.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/socketsecurity/core/scm_comments.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/socketsecurity/core/streaming.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/socketsecurity/core/tools/reachability.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/socketsecurity/core/utils.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/socketsecurity/fossa_compat.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/socketsecurity/output.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/socketsecurity/plugins/__init__.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/socketsecurity/plugins/base.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/socketsecurity/plugins/formatters/__init__.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/socketsecurity/plugins/formatters/slack.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/socketsecurity/plugins/jira.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/socketsecurity/plugins/manager.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/socketsecurity/plugins/slack.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/socketsecurity/plugins/teams.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/socketsecurity/plugins/webhook.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/__init__.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/core/conftest.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/core/create_diff_input.json +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/core/test_diff_alerts.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/core/test_diff_generation.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/core/test_facts_compression.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/core/test_has_manifest_files.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/core/test_package_and_alerts.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/core/test_sdk_methods.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/core/test_supporting_methods.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/data/fullscans/create_response.json +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/data/fullscans/diff/stream_diff.json +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/data/fullscans/diff/stream_diff_full.json +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/data/fullscans/head_scan/metadata.json +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/data/fullscans/head_scan/stream_scan.json +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/data/fullscans/head_scan/stream_scan_full.json +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/data/fullscans/new_scan/metadata.json +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/data/fullscans/new_scan/stream_scan.json +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/data/repos/repo_info_error.json +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/data/repos/repo_info_no_head.json +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/data/repos/repo_info_success.json +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/data/settings/security-policy.json +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/e2e/fixtures/simple-npm/index.js +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/e2e/fixtures/simple-npm/package.json +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/e2e/fixtures/simple-pypi/requirements.txt +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/e2e/validate-gitlab.sh +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/e2e/validate-json.sh +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/e2e/validate-reachability.sh +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/e2e/validate-sarif.sh +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/e2e/validate-scan.sh +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/fixtures/fossa/README.md +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/fixtures/fossa/fossa-analyze-empty.json +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/fixtures/fossa/fossa-analyze-populated.json +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/fixtures/fossa/fossa-sbom-empty-deep.json +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/fixtures/fossa/fossa-sbom-populated.json +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/unit/__init__.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/unit/test_alert_selection.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/unit/test_cli_config.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/unit/test_cli_run.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/unit/test_client.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/unit/test_config.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/unit/test_dependency_overview.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/unit/test_disable_ignore.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/unit/test_exclude_paths.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/unit/test_fossa_compat.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/unit/test_fossa_parity.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/unit/test_full_scan_retry.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/unit/test_gitlab_auth.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/unit/test_gitlab_auth_fallback.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/unit/test_gitlab_commit_status.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/unit/test_gitlab_format.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/unit/test_ignore_telemetry_filtering.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/unit/test_log_uploader.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/unit/test_output.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/unit/test_reachability.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/unit/test_slack_plugin.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/unit/test_socketcli.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/unit/test_streaming.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/unit/test_tier1_finalize.py +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/workflows/bitbucket-pipelines.yml +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/workflows/buildkite.yml +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/workflows/github-actions.yml +0 -0
- {socketsecurity-2.4.9 → socketsecurity-2.4.10}/workflows/gitlab-ci.yml +0 -0
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.4.10
|
|
4
|
+
|
|
5
|
+
### Added: opt directories back into manifest discovery via `--include-dirs`
|
|
6
|
+
|
|
7
|
+
- New `--include-dirs` flag (comma-separated directory names) that re-includes directories
|
|
8
|
+
the CLI excludes from manifest discovery by default. The default exclude list
|
|
9
|
+
(`node_modules`, `bower_components`, `jspm_packages`, `__pycache__`, `.venv`, `venv`,
|
|
10
|
+
`build`, `dist`, `.tox`, `.mypy_cache`, `.pytest_cache`, `*.egg-info`, `vendor`) is a sane
|
|
11
|
+
default, but some projects keep manifest files under those names — e.g. `build/requirements.txt`.
|
|
12
|
+
Pass `--include-dirs build,dist` to scan them. Names are matched against any path segment,
|
|
13
|
+
mirroring how the default exclude list is applied.
|
|
14
|
+
- `--include-module-folders` now functions as documented: it re-includes the JS/TS module
|
|
15
|
+
folders (`node_modules`, `bower_components`, `jspm_packages`) as a group. Previously the
|
|
16
|
+
flag was accepted but had no effect.
|
|
17
|
+
|
|
3
18
|
## 2.4.9
|
|
4
19
|
|
|
5
20
|
### Added: opt-in streaming log channel via `--upload-logs`
|
|
@@ -148,7 +148,7 @@ socketcli [-h] [--api-token API_TOKEN] [--repo REPO] [--workspace WORKSPACE] [--
|
|
|
148
148
|
[--owner OWNER] [--pr-number PR_NUMBER] [--commit-message COMMIT_MESSAGE] [--commit-sha COMMIT_SHA] [--committers [COMMITTERS ...]]
|
|
149
149
|
[--target-path TARGET_PATH] [--sbom-file SBOM_FILE] [--license-file-name LICENSE_FILE_NAME] [--save-submitted-files-list SAVE_SUBMITTED_FILES_LIST]
|
|
150
150
|
[--save-manifest-tar SAVE_MANIFEST_TAR] [--files FILES] [--sub-path SUB_PATH] [--workspace-name WORKSPACE_NAME]
|
|
151
|
-
[--excluded-ecosystems EXCLUDED_ECOSYSTEMS] [--exclude-paths EXCLUDE_PATHS] [--default-branch] [--pending-head] [--generate-license] [--enable-debug]
|
|
151
|
+
[--excluded-ecosystems EXCLUDED_ECOSYSTEMS] [--exclude-paths EXCLUDE_PATHS] [--include-dirs INCLUDE_DIRS] [--default-branch] [--pending-head] [--generate-license] [--enable-debug]
|
|
152
152
|
[--enable-json] [--enable-sarif] [--sarif-file <path>] [--sarif-scope {diff,full}] [--sarif-grouping {instance,alert}] [--sarif-reachability {all,reachable,potentially,reachable-or-potentially}] [--enable-gitlab-security] [--gitlab-security-file <path>]
|
|
153
153
|
[--disable-overview] [--exclude-license-details] [--allow-unverified] [--disable-security-issue]
|
|
154
154
|
[--ignore-commit-files] [--disable-blocking] [--disable-ignore] [--enable-diff] [--scm SCM] [--timeout TIMEOUT] [--include-module-folders]
|
|
@@ -205,13 +205,14 @@ If you don't want to provide the Socket API Token every time then you can use th
|
|
|
205
205
|
| `--workspace-name` | False | | Workspace name suffix to append to repository name (repo-name-workspace_name). Must be used with `--sub-path` |
|
|
206
206
|
| `--excluded-ecosystems` | False | [] | List of ecosystems to exclude from analysis (JSON array string). You can get supported files from the [Supported Files API](https://docs.socket.dev/reference/getsupportedfiles) |
|
|
207
207
|
| `--exclude-paths` | False | | Comma-separated paths/globs to exclude from **both** manifest discovery (every scan) **and** reachability analysis (e.g. `tests/**,packages/legacy,*.spec.ts`). Patterns are scan-root-relative, case-sensitive globs where `*` does not cross `/` and `**` does. Supersedes `--reach-exclude-paths`. |
|
|
208
|
+
| `--include-dirs` | False | | Comma-separated directory **names** that are excluded from manifest discovery by default but should be scanned (e.g. `build,dist`). Names are matched against any path segment, mirroring the default exclude list (`node_modules`, `bower_components`, `jspm_packages`, `__pycache__`, `.venv`, `venv`, `build`, `dist`, `.tox`, `.mypy_cache`, `.pytest_cache`, `*.egg-info`, `vendor`). Use this when manifest files live under a normally-ignored folder, e.g. `build/requirements.txt`. |
|
|
208
209
|
|
|
209
210
|
#### Branch and Scan Configuration
|
|
210
211
|
| Parameter | Required | Default | Description |
|
|
211
212
|
|:-------------------------|:---------|:--------|:------------------------------------------------------------------------------------------------------|
|
|
212
213
|
| `--default-branch` | False | *auto* | Make this branch the default branch (auto-detected from git and CI environment when not specified) |
|
|
213
214
|
| `--pending-head` | False | *auto* | If true, the new scan will be set as the branch's head scan (automatically synced with default-branch) |
|
|
214
|
-
| `--include-module-folders` | False | False | If enabled
|
|
215
|
+
| `--include-module-folders` | False | False | If enabled, re-includes the JS/TS module folders (`node_modules`, `bower_components`, `jspm_packages`) in manifest discovery. For other excluded directories, use `--include-dirs`. |
|
|
215
216
|
|
|
216
217
|
#### Output Configuration
|
|
217
218
|
| Parameter | Required | Default | Description |
|
|
@@ -154,6 +154,7 @@ class CliConfig:
|
|
|
154
154
|
repo_is_public: bool = False
|
|
155
155
|
excluded_ecosystems: list[str] = field(default_factory=lambda: [])
|
|
156
156
|
exclude_paths: Optional[List[str]] = None
|
|
157
|
+
included_dirs: List[str] = field(default_factory=lambda: [])
|
|
157
158
|
version: str = __version__
|
|
158
159
|
jira_plugin: PluginConfig = field(default_factory=PluginConfig)
|
|
159
160
|
slack_plugin: PluginConfig = field(default_factory=PluginConfig)
|
|
@@ -314,6 +315,7 @@ class CliConfig:
|
|
|
314
315
|
'reach_ecosystems': args.reach_ecosystems.split(',') if args.reach_ecosystems else None,
|
|
315
316
|
'reach_exclude_paths': args.reach_exclude_paths.split(',') if args.reach_exclude_paths else None,
|
|
316
317
|
'exclude_paths': normalize_exclude_paths(args.exclude_paths),
|
|
318
|
+
'included_dirs': normalize_exclude_paths(args.include_dirs) or [],
|
|
317
319
|
'reach_skip_cache': args.reach_skip_cache,
|
|
318
320
|
'reach_min_severity': args.reach_min_severity,
|
|
319
321
|
'reach_output_file': args.reach_output_file,
|
|
@@ -639,6 +641,17 @@ def create_argument_parser() -> argparse.ArgumentParser:
|
|
|
639
641
|
"Supersedes --reach-exclude-paths."
|
|
640
642
|
)
|
|
641
643
|
|
|
644
|
+
path_group.add_argument(
|
|
645
|
+
"--include-dirs",
|
|
646
|
+
dest="include_dirs",
|
|
647
|
+
metavar="<list>",
|
|
648
|
+
help="Comma-separated directory names that are excluded from manifest discovery by "
|
|
649
|
+
"default but should be scanned (e.g. 'build,dist'). Names are matched against any "
|
|
650
|
+
"path segment, mirroring the default exclude list. Defaults excluded: "
|
|
651
|
+
"node_modules, bower_components, jspm_packages, __pycache__, .venv, venv, build, "
|
|
652
|
+
"dist, .tox, .mypy_cache, .pytest_cache, *.egg-info, vendor."
|
|
653
|
+
)
|
|
654
|
+
|
|
642
655
|
# Branch and Scan Configuration
|
|
643
656
|
config_group = parser.add_argument_group('Branch and Scan Configuration')
|
|
644
657
|
config_group.add_argument(
|
|
@@ -15,6 +15,10 @@ default_exclude_dirs = {
|
|
|
15
15
|
"vendor"
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
# Subset of default_exclude_dirs that hold installed JS/TS modules. Re-included as a group
|
|
19
|
+
# by --include-module-folders (see CliConfig.include_module_folders).
|
|
20
|
+
module_folder_dirs = {"node_modules", "bower_components", "jspm_packages"}
|
|
21
|
+
|
|
18
22
|
@dataclass
|
|
19
23
|
class SocketConfig:
|
|
20
24
|
api_key: str
|
|
@@ -19,7 +19,7 @@ from socketsecurity.core.git_interface import Git
|
|
|
19
19
|
from socketsecurity.core.logging import initialize_logging, set_debug_mode
|
|
20
20
|
from socketsecurity.core.messages import Messages
|
|
21
21
|
from socketsecurity.core.scm_comments import Comments
|
|
22
|
-
from socketsecurity.core.socket_config import SocketConfig
|
|
22
|
+
from socketsecurity.core.socket_config import SocketConfig, module_folder_dirs
|
|
23
23
|
from socketsecurity.core.streaming import StreamingLogs
|
|
24
24
|
from socketsecurity.fossa_compat import build_fossa_attribution_payload
|
|
25
25
|
from socketsecurity.output import OutputHandler
|
|
@@ -195,7 +195,19 @@ def main_code():
|
|
|
195
195
|
) as streaming:
|
|
196
196
|
core = Core(socket_config, sdk, config)
|
|
197
197
|
log.debug("loaded core")
|
|
198
|
-
|
|
198
|
+
|
|
199
|
+
# Re-include directories that are excluded from manifest discovery by default
|
|
200
|
+
# (e.g. build/dist). --include-dirs names them individually; --include-module-folders
|
|
201
|
+
# re-includes the JS module folders as a group. Build a new set rather than mutating
|
|
202
|
+
# the shared default_exclude_dirs in place. Applied here so it covers every find_files
|
|
203
|
+
# call below, including the sub-path manifest pre-check.
|
|
204
|
+
dirs_to_include = set(config.included_dirs or [])
|
|
205
|
+
if config.include_module_folders:
|
|
206
|
+
dirs_to_include |= module_folder_dirs
|
|
207
|
+
if dirs_to_include:
|
|
208
|
+
core.config.excluded_dirs = set(core.config.excluded_dirs) - dirs_to_include
|
|
209
|
+
log.debug(f"Re-including normally-excluded directories in scan: {sorted(dirs_to_include)}")
|
|
210
|
+
|
|
199
211
|
# Check for required dependencies if reachability analysis is enabled
|
|
200
212
|
if config.reach:
|
|
201
213
|
log.info("Reachability analysis enabled, checking for required dependencies...")
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"""Tests for --include-dirs (and the now-functional --include-module-folders).
|
|
2
|
+
|
|
3
|
+
Covers config parsing of the comma-separated directory names and that re-including a
|
|
4
|
+
normally-excluded directory (e.g. build) lets Core.find_files discover manifests under it.
|
|
5
|
+
"""
|
|
6
|
+
import types
|
|
7
|
+
from unittest.mock import MagicMock
|
|
8
|
+
|
|
9
|
+
import pytest
|
|
10
|
+
|
|
11
|
+
from socketsecurity.config import CliConfig
|
|
12
|
+
from socketsecurity.core import Core
|
|
13
|
+
from socketsecurity.core.socket_config import (
|
|
14
|
+
SocketConfig,
|
|
15
|
+
default_exclude_dirs,
|
|
16
|
+
module_folder_dirs,
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
BASE_ARGS = ["--api-token", "test-token", "--repo", "test-repo"]
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# ---- config parsing ------------------------------------------------------
|
|
23
|
+
|
|
24
|
+
def test_include_dirs_parses_to_list():
|
|
25
|
+
config = CliConfig.from_args(BASE_ARGS + ["--include-dirs", "build, dist , vendor"])
|
|
26
|
+
assert config.included_dirs == ["build", "dist", "vendor"]
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def test_include_dirs_defaults_empty():
|
|
30
|
+
config = CliConfig.from_args(BASE_ARGS)
|
|
31
|
+
assert config.included_dirs == []
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def test_include_dirs_from_config_file(tmp_path):
|
|
35
|
+
import json
|
|
36
|
+
cfg = tmp_path / "socketcli.json"
|
|
37
|
+
cfg.write_text(json.dumps({"socketcli": {"include_dirs": ["build", "dist"]}}), encoding="utf-8")
|
|
38
|
+
config = CliConfig.from_args(BASE_ARGS + ["--config", str(cfg)])
|
|
39
|
+
assert config.included_dirs == ["build", "dist"]
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def test_module_folder_dirs_is_subset_of_defaults():
|
|
43
|
+
assert module_folder_dirs <= default_exclude_dirs
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
# ---- find_files integration ----------------------------------------------
|
|
47
|
+
|
|
48
|
+
def _make_core(excluded_dirs):
|
|
49
|
+
core = Core.__new__(Core)
|
|
50
|
+
core.config = SocketConfig(api_key="test-key", excluded_dirs=excluded_dirs)
|
|
51
|
+
core.cli_config = types.SimpleNamespace(exclude_paths=None)
|
|
52
|
+
core.sdk = MagicMock()
|
|
53
|
+
return core
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def _seed_manifests(tmp_path):
|
|
57
|
+
for rel in ("requirements.txt", "build/requirements.txt", "dist/requirements.txt"):
|
|
58
|
+
p = tmp_path / rel
|
|
59
|
+
p.parent.mkdir(parents=True, exist_ok=True)
|
|
60
|
+
p.write_text("flask==1.0\n", encoding="utf-8")
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def test_find_files_excludes_build_by_default(tmp_path, mocker):
|
|
64
|
+
_seed_manifests(tmp_path)
|
|
65
|
+
core = _make_core(set(default_exclude_dirs))
|
|
66
|
+
mocker.patch.object(
|
|
67
|
+
core, "get_supported_patterns",
|
|
68
|
+
return_value={"pypi": {"requirements.txt": {"pattern": "requirements.txt"}}},
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
found = core.find_files(str(tmp_path))
|
|
72
|
+
assert not any("/build/" in f for f in found)
|
|
73
|
+
assert not any("/dist/" in f for f in found)
|
|
74
|
+
assert any(f.endswith("/requirements.txt") for f in found)
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def test_find_files_includes_build_when_unexcluded(tmp_path, mocker):
|
|
78
|
+
"""Mirrors socketcli wiring: dropping a name from excluded_dirs re-includes its manifests."""
|
|
79
|
+
_seed_manifests(tmp_path)
|
|
80
|
+
core = _make_core(set(default_exclude_dirs) - {"build"})
|
|
81
|
+
mocker.patch.object(
|
|
82
|
+
core, "get_supported_patterns",
|
|
83
|
+
return_value={"pypi": {"requirements.txt": {"pattern": "requirements.txt"}}},
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
found = core.find_files(str(tmp_path))
|
|
87
|
+
assert any("/build/requirements.txt" in f for f in found)
|
|
88
|
+
# dist is still excluded since only build was re-included
|
|
89
|
+
assert not any("/dist/" in f for f in found)
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
def test_unexcluding_does_not_mutate_shared_defaults():
|
|
93
|
+
"""The socketcli flow builds a new set rather than mutating the module-level default."""
|
|
94
|
+
before = set(default_exclude_dirs)
|
|
95
|
+
config = SocketConfig(api_key="test-key")
|
|
96
|
+
config.excluded_dirs = set(config.excluded_dirs) - {"build"}
|
|
97
|
+
assert "build" not in config.excluded_dirs
|
|
98
|
+
assert default_exclude_dirs == before
|
|
99
|
+
assert "build" in default_exclude_dirs
|
|
@@ -1283,7 +1283,7 @@ wheels = [
|
|
|
1283
1283
|
|
|
1284
1284
|
[[package]]
|
|
1285
1285
|
name = "socketsecurity"
|
|
1286
|
-
version = "2.4.
|
|
1286
|
+
version = "2.4.10"
|
|
1287
1287
|
source = { editable = "." }
|
|
1288
1288
|
dependencies = [
|
|
1289
1289
|
{ name = "brotli", marker = "platform_python_implementation == 'CPython'" },
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{socketsecurity-2.4.9 → socketsecurity-2.4.10}/socketsecurity/core/helper/socket_facts_loader.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{socketsecurity-2.4.9 → socketsecurity-2.4.10}/socketsecurity/plugins/formatters/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/data/fullscans/diff/stream_diff_full.json
RENAMED
|
File without changes
|
|
File without changes
|
{socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/data/fullscans/head_scan/stream_scan.json
RENAMED
|
File without changes
|
{socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/data/fullscans/head_scan/stream_scan_full.json
RENAMED
|
File without changes
|
|
File without changes
|
{socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/data/fullscans/new_scan/stream_scan.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/e2e/fixtures/simple-pypi/requirements.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/fixtures/fossa/fossa-analyze-empty.json
RENAMED
|
File without changes
|
{socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/fixtures/fossa/fossa-analyze-populated.json
RENAMED
|
File without changes
|
{socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/fixtures/fossa/fossa-sbom-empty-deep.json
RENAMED
|
File without changes
|
{socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/fixtures/fossa/fossa-sbom-populated.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{socketsecurity-2.4.9 → socketsecurity-2.4.10}/tests/unit/test_ignore_telemetry_filtering.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|