socketsecurity 2.10.11__tar.gz → 2.11.1__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.10.11 → socketsecurity-2.11.1}/.github/workflows/python-tests.yml +1 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/CHANGELOG.md +26 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/Dockerfile +1 -1
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/PKG-INFO +1 -1
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/docs/cli-reference.md +3 -10
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/pyproject.toml +1 -1
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/socketsecurity/__init__.py +1 -1
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/socketsecurity/config.py +1 -1
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/socketsecurity/core/cli_client.py +15 -2
- socketsecurity-2.11.1/socketsecurity/core/tools/coana-cache.mjs +203 -0
- socketsecurity-2.11.1/socketsecurity/core/tools/reachability.py +440 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/socketsecurity/socketcli.py +2 -3
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/e2e/fixtures/simple-npm/package.json +1 -1
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/unit/test_client.py +19 -0
- socketsecurity-2.11.1/tests/unit/test_reachability.py +162 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/uv.lock +1 -1
- socketsecurity-2.10.11/socketsecurity/core/tools/reachability.py +0 -493
- socketsecurity-2.10.11/tests/unit/test_reachability.py +0 -447
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/.github/CODEOWNERS +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/.github/PULL_REQUEST_TEMPLATE/bug-fix.md +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/.github/PULL_REQUEST_TEMPLATE/feature.md +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/.github/PULL_REQUEST_TEMPLATE/improvement.md +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/.github/actions/setup-docker/action.yml +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/.github/actions/setup-hatch/action.yml +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/.github/actions/setup-sfw/action.yml +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/.github/dependabot.yml +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/.github/workflows/dependency-audit.yml +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/.github/workflows/dependency-review.yml +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/.github/workflows/docker-stable.yml +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/.github/workflows/e2e-test.yml +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/.github/workflows/package-check.yml +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/.github/workflows/pr-preview.yml +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/.github/workflows/release.yml +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/.github/workflows/version-check.yml +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/.github/zizmor.yml +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/.gitignore +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/.hooks/sync_version.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/.pre-commit-config.yaml +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/.python-version +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/CONTRIBUTING.md +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/Dockerfile.preview +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/LICENSE +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/Makefile +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/README.md +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/benchmarks/manifest_discovery.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/docs/ci-cd.md +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/docs/development.md +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/docs/troubleshooting.md +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/examples/config/sarif-dashboard-parity.json +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/examples/config/sarif-dashboard-parity.toml +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/examples/config/sarif-diff-ci-cd.json +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/examples/config/sarif-diff-ci-cd.toml +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/examples/config/sarif-instance-detail.json +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/examples/config/sarif-instance-detail.toml +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/instructions/gitlab-commit-status/uat.md +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/pytest.ini +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/scripts/build_container.sh +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/scripts/build_container_flexible.sh +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/scripts/deploy-test-docker.sh +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/scripts/deploy-test-pypi.sh +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/scripts/docker-entrypoint.sh +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/scripts/run.sh +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/session.md +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/socket.yml +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/socketsecurity/core/__init__.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/socketsecurity/core/alert_selection.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/socketsecurity/core/classes.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/socketsecurity/core/cli_run.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/socketsecurity/core/exceptions.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/socketsecurity/core/git_interface.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/socketsecurity/core/git_remote.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/socketsecurity/core/helper/__init__.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/socketsecurity/core/helper/socket_facts_loader.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/socketsecurity/core/lazy_file_loader.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/socketsecurity/core/log_uploader.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/socketsecurity/core/logging.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/socketsecurity/core/messages.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/socketsecurity/core/pull_request.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/socketsecurity/core/resource_utils.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/socketsecurity/core/scm/__init__.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/socketsecurity/core/scm/base.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/socketsecurity/core/scm/client.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/socketsecurity/core/scm/github.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/socketsecurity/core/scm/gitlab.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/socketsecurity/core/scm_comments.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/socketsecurity/core/socket_config.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/socketsecurity/core/streaming.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/socketsecurity/core/utils.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/socketsecurity/fossa_compat.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/socketsecurity/output.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/socketsecurity/plugins/__init__.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/socketsecurity/plugins/base.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/socketsecurity/plugins/formatters/__init__.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/socketsecurity/plugins/formatters/slack.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/socketsecurity/plugins/jira.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/socketsecurity/plugins/manager.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/socketsecurity/plugins/slack.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/socketsecurity/plugins/teams.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/socketsecurity/plugins/webhook.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/__init__.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/core/conftest.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/core/create_diff_input.json +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/core/test_diff_alerts.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/core/test_diff_generation.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/core/test_diff_scan_polling.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/core/test_facts_compression.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/core/test_full_scan_outputs.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/core/test_has_manifest_files.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/core/test_invalid_facts_marker.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/core/test_package_and_alerts.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/core/test_sdk_methods.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/core/test_supporting_methods.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/data/fullscans/create_response.json +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/data/fullscans/diff/stream_diff.json +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/data/fullscans/diff/stream_diff_full.json +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/data/fullscans/head_scan/metadata.json +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/data/fullscans/head_scan/stream_scan.json +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/data/fullscans/head_scan/stream_scan_full.json +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/data/fullscans/new_scan/metadata.json +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/data/fullscans/new_scan/stream_scan.json +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/data/repos/repo_info_error.json +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/data/repos/repo_info_no_head.json +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/data/repos/repo_info_success.json +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/data/settings/security-policy.json +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/e2e/fixtures/simple-npm/index.js +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/e2e/fixtures/simple-pypi/requirements.txt +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/e2e/reach-facts-probe.sh +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/e2e/validate-gitlab.sh +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/e2e/validate-json.sh +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/e2e/validate-reachability.sh +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/e2e/validate-sarif.sh +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/e2e/validate-scan.sh +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/fixtures/fossa/README.md +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/fixtures/fossa/fossa-analyze-empty.json +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/fixtures/fossa/fossa-analyze-populated.json +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/fixtures/fossa/fossa-sbom-empty-deep.json +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/fixtures/fossa/fossa-sbom-populated.json +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/unit/__init__.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/unit/test_alert_selection.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/unit/test_cli_config.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/unit/test_cli_run.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/unit/test_commit_message_truncation.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/unit/test_config.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/unit/test_dependency_overview.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/unit/test_disable_ignore.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/unit/test_exclude_paths.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/unit/test_fossa_compat.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/unit/test_fossa_parity.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/unit/test_full_scan_retry.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/unit/test_git_interface.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/unit/test_git_remote.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/unit/test_github_buildkite_config.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/unit/test_gitlab_auth.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/unit/test_gitlab_auth_fallback.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/unit/test_gitlab_commit_status.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/unit/test_gitlab_format.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/unit/test_ignore_authorization.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/unit/test_ignore_telemetry_filtering.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/unit/test_include_dirs.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/unit/test_log_uploader.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/unit/test_manifest_discovery.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/unit/test_messages.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/unit/test_output.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/unit/test_pr_comment_rendering.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/unit/test_pull_request_context.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/unit/test_scan_scope.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/unit/test_slack_plugin.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/unit/test_slack_severity_normalization.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/unit/test_socketcli.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/unit/test_streaming.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/unit/test_summary_text.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/tests/unit/test_tier1_finalize.py +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/workflows/bitbucket-pipelines.yml +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/workflows/buildkite.yml +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/workflows/github-actions.yml +0 -0
- {socketsecurity-2.10.11 → socketsecurity-2.11.1}/workflows/gitlab-ci.yml +0 -0
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.11.1
|
|
4
|
+
|
|
5
|
+
### Changed: bump pinned Coana CLI to 15.12.10
|
|
6
|
+
|
|
7
|
+
- Bumped the pinned reachability engine (the Coana CLI) from `15.12.8` to
|
|
8
|
+
`15.12.10`. See the
|
|
9
|
+
[reachability analysis changelog](https://docs.socket.dev/docs/reachability-analysis-changelog)
|
|
10
|
+
for engine changes.
|
|
11
|
+
|
|
12
|
+
## 2.11.0
|
|
13
|
+
|
|
14
|
+
### Changed: download the Coana CLI from Socket instead of npm
|
|
15
|
+
|
|
16
|
+
- The Coana CLI is now downloaded from Socket's servers instead of npm, and is now cached in
|
|
17
|
+
`$XDG_CACHE_HOME/socket/coana` (`~/.cache/socket/coana` by default).
|
|
18
|
+
- The `SOCKET_CLI_COANA_LAUNCHER` environment variable no longer has an effect.
|
|
19
|
+
|
|
20
|
+
## 2.10.12
|
|
21
|
+
|
|
22
|
+
### Changed: bump pinned @coana-tech/cli to 15.12.8
|
|
23
|
+
|
|
24
|
+
- Bumped the pinned reachability engine (`@coana-tech/cli`) from `15.12.7` to
|
|
25
|
+
`15.12.8`. See the
|
|
26
|
+
[reachability analysis changelog](https://docs.socket.dev/docs/reachability-analysis-changelog)
|
|
27
|
+
for engine changes.
|
|
28
|
+
|
|
3
29
|
## 2.10.11
|
|
4
30
|
|
|
5
31
|
### Changed: bump pinned @coana-tech/cli to 15.12.7
|
|
@@ -75,7 +75,7 @@ RUN if [ "$TARGETARCH" = "amd64" ]; then \
|
|
|
75
75
|
fi
|
|
76
76
|
|
|
77
77
|
# Install additional tools
|
|
78
|
-
RUN npm install
|
|
78
|
+
RUN npm install socket -g && \
|
|
79
79
|
gem install bundler && \
|
|
80
80
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \
|
|
81
81
|
. ~/.cargo/env && \
|
|
@@ -338,7 +338,7 @@ If you don't want to provide the Socket API Token every time then you can use th
|
|
|
338
338
|
| Parameter | Required | Default | Description |
|
|
339
339
|
|:---------------------------------|:---------|:--------|:---------------------------------------------------------------------------------------------------------------------------|
|
|
340
340
|
| `--reach` | False | False | Enable reachability analysis to identify which vulnerable functions are actually called by your code. Creates a full application reachability scan (`scan_type=socket_tier1`). |
|
|
341
|
-
| `--reach-version` | False | 15.12.
|
|
341
|
+
| `--reach-version` | False | 15.12.10 | Version of the Coana CLI to use. Defaults to the pinned version that ships with this CLI release, so the engine only changes when you upgrade the Socket CLI. Pass `latest` to always use the newest published version (opt-in auto-update), or an explicit version (e.g. `1.2.3`) to pin it. |
|
|
342
342
|
| `--reach-analysis-timeout` | False | 10m | Timeout for each reachability analysis run, e.g. `90s`, `10m` or `1h`. Omitted by default, so coana applies its own default (`10m`). Alias: `--reach-timeout` |
|
|
343
343
|
| `--reach-analysis-memory-limit` | False | 8GB | Memory limit for each reachability analysis run, e.g. `512MB` or `8GB`. Omitted by default, so coana applies its own default (`8GB`). Alias: `--reach-memory-limit` |
|
|
344
344
|
| `--reach-concurrency` | False | 1 | Control parallel analysis execution (must be >= 1). Omitted by default, so coana applies its own default. |
|
|
@@ -359,9 +359,7 @@ If you don't want to provide the Socket API Token every time then you can use th
|
|
|
359
359
|
**Reachability Analysis Requirements:**
|
|
360
360
|
|
|
361
361
|
The Python CLI verifies the following **up front** (before invoking the analysis engine) and exits with code **3** if any are unmet:
|
|
362
|
-
- `
|
|
363
|
-
- `npx` - Required to fetch (on first use) and run `@coana-tech/cli` (the analysis engine)
|
|
364
|
-
- `node` - Required to run the engine (used directly by the `npm install` fallback)
|
|
362
|
+
- `node` - Required to run the analysis engine (the Coana CLI). The engine needs Node.js 20 or later.
|
|
365
363
|
- `uv` - Required by the analysis engine
|
|
366
364
|
- An **Enterprise** Socket organization plan (any `enterprise*` plan, including Enterprise trials)
|
|
367
365
|
|
|
@@ -419,12 +417,7 @@ Sample config files:
|
|
|
419
417
|
|
|
420
418
|
For CI-specific examples and guidance, see [`ci-cd.md`](ci-cd.md).
|
|
421
419
|
|
|
422
|
-
The CLI runs a pinned
|
|
423
|
-
|
|
424
|
-
The launcher can be tuned via the `SOCKET_CLI_COANA_LAUNCHER` environment variable:
|
|
425
|
-
- `auto` (default when unset) — try `npx` first; fall back to `npm install` + `node` if the launcher fails before the engine starts.
|
|
426
|
-
- `npm-install` — skip `npx` entirely and always use the `npm install` + `node` path (useful where `npx` is known-broken).
|
|
427
|
-
- `npx` — never fall back; surface the `npx` failure directly.
|
|
420
|
+
The CLI runs a pinned version of the Coana CLI, the analysis engine; it does **not** auto-update the engine. It downloads the engine from the Socket API on first use and keeps it in `$XDG_CACHE_HOME/socket/coana/v1` (`~/.cache/socket/coana/v1` when `XDG_CACHE_HOME` is unset). Pass `--reach-version latest` to opt into the newest published version. Use `--reach` to enable reachability analysis during a full scan, or add `--only-facts-file` (with `--reach`) to submit only the reachability facts file (`.socket.facts.json`) when creating the full scan.
|
|
428
421
|
|
|
429
422
|
#### Advanced Configuration
|
|
430
423
|
| Parameter | Required | Default | Description |
|
|
@@ -1069,7 +1069,7 @@ def create_argument_parser() -> argparse.ArgumentParser:
|
|
|
1069
1069
|
"--reach-version",
|
|
1070
1070
|
dest="reach_version",
|
|
1071
1071
|
metavar="<version|latest>",
|
|
1072
|
-
help="Version of
|
|
1072
|
+
help="Version of the Coana CLI to use. Defaults to the version pinned to this CLI "
|
|
1073
1073
|
"release; pass 'latest' to always use the newest published version (opt-in "
|
|
1074
1074
|
"auto-update), or an explicit version (e.g. '1.2.3') to pin it."
|
|
1075
1075
|
)
|
|
@@ -55,13 +55,26 @@ class CliClient:
|
|
|
55
55
|
return response
|
|
56
56
|
|
|
57
57
|
except requests.exceptions.RequestException as e:
|
|
58
|
-
|
|
58
|
+
server_message = self._server_error_message(e.response)
|
|
59
|
+
detail = f"{e}: {server_message}" if server_message else str(e)
|
|
60
|
+
logger.error(f"API request failed: {detail}")
|
|
59
61
|
# Carry the status forward. Callers that need to react to a specific
|
|
60
62
|
# code -- the GitLab auth fallback to the other token scheme, and
|
|
61
63
|
# APIFailure.is_transient_error -- have no other way to recover it
|
|
62
64
|
# once the requests exception has been translated.
|
|
63
65
|
status_code = e.response.status_code if e.response is not None else None
|
|
64
|
-
raise APIFailure(f"Request failed: {
|
|
66
|
+
raise APIFailure(f"Request failed: {detail}", status_code=status_code) from e
|
|
67
|
+
|
|
68
|
+
@staticmethod
|
|
69
|
+
def _server_error_message(response: Optional[requests.Response]) -> Optional[str]:
|
|
70
|
+
"""The explanation the Socket API gives in its ``{"error": {"message": ...}}`` body."""
|
|
71
|
+
if response is None:
|
|
72
|
+
return None
|
|
73
|
+
try:
|
|
74
|
+
message = response.json()["error"]["message"]
|
|
75
|
+
except (ValueError, KeyError, TypeError):
|
|
76
|
+
return None
|
|
77
|
+
return message if isinstance(message, str) and message else None
|
|
65
78
|
|
|
66
79
|
def post_telemetry_events(self, org_slug: str, events: List[Dict]) -> None:
|
|
67
80
|
"""Post telemetry events one at a time to the v0 telemetry API. Fire-and-forget — logs errors but never raises."""
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
// Generated from coana-package-manager's packages/coana-cache. Don't edit it here.
|
|
2
|
+
// See "Launching Coana" in packages/cli/docs/gcs-releases.md there.
|
|
3
|
+
|
|
4
|
+
// src/cli.ts
|
|
5
|
+
import { cp, readdir as readdir2, rename as rename2, rm as rm3 } from "node:fs/promises";
|
|
6
|
+
import { join as join3 } from "node:path";
|
|
7
|
+
|
|
8
|
+
// src/cache.ts
|
|
9
|
+
import { mkdir as mkdir2, open, readdir, readFile, rm as rm2, stat, utimes } from "node:fs/promises";
|
|
10
|
+
import { homedir } from "node:os";
|
|
11
|
+
import { dirname as dirname2, isAbsolute, join as join2, relative } from "node:path";
|
|
12
|
+
|
|
13
|
+
// ../utils/src/atomic-fs.ts
|
|
14
|
+
import { randomUUID } from "node:crypto";
|
|
15
|
+
import { existsSync } from "node:fs";
|
|
16
|
+
import { chmod, mkdir, mkdtemp, rename, rm, writeFile } from "node:fs/promises";
|
|
17
|
+
import { basename, dirname, join } from "node:path";
|
|
18
|
+
async function populateDirAtomically(targetDir, populate) {
|
|
19
|
+
if (existsSync(targetDir)) return;
|
|
20
|
+
const parentDir = dirname(targetDir);
|
|
21
|
+
await mkdir(parentDir, { recursive: true });
|
|
22
|
+
const tmpDir = await mkdtemp(join(parentDir, `.${basename(targetDir)}-`));
|
|
23
|
+
try {
|
|
24
|
+
await populate(tmpDir);
|
|
25
|
+
await chmod(tmpDir, 493);
|
|
26
|
+
await rename(tmpDir, targetDir).catch((e) => {
|
|
27
|
+
if (!existsSync(targetDir)) throw e;
|
|
28
|
+
});
|
|
29
|
+
} finally {
|
|
30
|
+
await rm(tmpDir, { recursive: true, force: true }).catch(() => {
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
async function writeFileAtomically(path, data) {
|
|
35
|
+
const tmpPath = `${path}.${randomUUID()}.tmp`;
|
|
36
|
+
try {
|
|
37
|
+
await writeFile(tmpPath, data);
|
|
38
|
+
await rename(tmpPath, path);
|
|
39
|
+
} finally {
|
|
40
|
+
await rm(tmpPath, { force: true }).catch(() => {
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// src/cache.ts
|
|
46
|
+
var SHA256 = /^[0-9a-f]{64}$/;
|
|
47
|
+
var VERSION = /^[0-9A-Za-z][0-9A-Za-z.+-]*$/;
|
|
48
|
+
var COMPONENT = /^[A-Za-z][0-9A-Za-z-]*$/;
|
|
49
|
+
var TEMP_DIR = /^\.[0-9a-f]{64}-/;
|
|
50
|
+
var ABANDONED_TEMP_DIR_MS = 24 * 60 * 6e4;
|
|
51
|
+
function cacheRoot() {
|
|
52
|
+
const xdgCacheHome = process.env.XDG_CACHE_HOME;
|
|
53
|
+
const cacheHome = xdgCacheHome && isAbsolute(xdgCacheHome) ? xdgCacheHome : join2(homedir(), ".cache");
|
|
54
|
+
return join2(cacheHome, "socket", "coana", "v1");
|
|
55
|
+
}
|
|
56
|
+
var OUT_OF_SPACE_CODES = /* @__PURE__ */ new Set(["ENOSPC", "EDQUOT"]);
|
|
57
|
+
var NOT_WRITABLE_CODES = /* @__PURE__ */ new Set(["EACCES", "EPERM", "EROFS", ...OUT_OF_SPACE_CODES]);
|
|
58
|
+
var CacheNotWritable = class _CacheNotWritable extends Error {
|
|
59
|
+
constructor(outOfSpace, cause) {
|
|
60
|
+
super(
|
|
61
|
+
outOfSpace ? `The disk holding the Coana cache in ${cacheRoot()} is out of space (${cause.message}). Free some up, or set XDG_CACHE_HOME to a directory on another disk.` : `Could not write to the Coana cache in ${cacheRoot()} (${cause.message}). Set XDG_CACHE_HOME to a writable directory.`,
|
|
62
|
+
{ cause }
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
/** `e` as a {@link CacheNotWritable} when it is such a failure of a path in the cache. */
|
|
66
|
+
static from(e) {
|
|
67
|
+
if (e instanceof _CacheNotWritable) return e;
|
|
68
|
+
if (!(e instanceof Error)) return void 0;
|
|
69
|
+
const { code = "", path: source, dest } = e;
|
|
70
|
+
if (!NOT_WRITABLE_CODES.has(code)) return void 0;
|
|
71
|
+
const outOfSpace = OUT_OF_SPACE_CODES.has(code);
|
|
72
|
+
const paths = (outOfSpace && dest !== void 0 ? [dest] : [source, dest]).filter((p) => p !== void 0);
|
|
73
|
+
const ofCache = paths.length === 0 ? outOfSpace : paths.some((path) => within(cacheRoot(), path) || within(path, cacheRoot()));
|
|
74
|
+
return ofCache ? new _CacheNotWritable(outOfSpace, e) : void 0;
|
|
75
|
+
function within(dir, path) {
|
|
76
|
+
const fromDir = relative(dir, path);
|
|
77
|
+
return !fromDir.startsWith("..") && !isAbsolute(fromDir);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
var InvalidCacheKey = class extends Error {
|
|
82
|
+
};
|
|
83
|
+
async function writing(f) {
|
|
84
|
+
try {
|
|
85
|
+
return await f();
|
|
86
|
+
} catch (e) {
|
|
87
|
+
throw CacheNotWritable.from(e) ?? e;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
function objectDir(sha256) {
|
|
91
|
+
return join2(cacheRoot(), "objects", sha256);
|
|
92
|
+
}
|
|
93
|
+
function versionSegment(version) {
|
|
94
|
+
if (!VERSION.test(version)) throw new InvalidCacheKey(`Invalid Coana version: ${version}`);
|
|
95
|
+
return version;
|
|
96
|
+
}
|
|
97
|
+
function indexFile(version, component) {
|
|
98
|
+
if (!COMPONENT.test(component)) throw new InvalidCacheKey(`Invalid component name: ${component}`);
|
|
99
|
+
return join2(cacheRoot(), "versions", versionSegment(version), component);
|
|
100
|
+
}
|
|
101
|
+
async function lookup(version, component) {
|
|
102
|
+
const index = indexFile(version, component);
|
|
103
|
+
const sha256 = (await readFile(index, "utf8").catch(() => "")).trim();
|
|
104
|
+
if (!SHA256.test(sha256)) return void 0;
|
|
105
|
+
const dir = objectDir(sha256);
|
|
106
|
+
const isDirectory = await stat(dir).then(
|
|
107
|
+
(s) => s.isDirectory(),
|
|
108
|
+
() => false
|
|
109
|
+
);
|
|
110
|
+
if (!isDirectory) return void 0;
|
|
111
|
+
const now = /* @__PURE__ */ new Date();
|
|
112
|
+
await utimes(index, now, now).catch(() => writeFileAtomically(index, sha256)).catch(() => {
|
|
113
|
+
});
|
|
114
|
+
return dir;
|
|
115
|
+
}
|
|
116
|
+
async function install(version, component, sha256, populate) {
|
|
117
|
+
if (!SHA256.test(sha256)) throw new InvalidCacheKey(`Invalid SHA-256: ${sha256}`);
|
|
118
|
+
const index = indexFile(version, component);
|
|
119
|
+
const target = objectDir(sha256);
|
|
120
|
+
await writing(() => mkdir2(dirname2(index), { recursive: true }));
|
|
121
|
+
await writing(
|
|
122
|
+
() => populateDirAtomically(target, (dir) => {
|
|
123
|
+
void sweepAbandonedTempDirs();
|
|
124
|
+
return populate(dir);
|
|
125
|
+
})
|
|
126
|
+
);
|
|
127
|
+
await writing(() => writeFileAtomically(index, sha256));
|
|
128
|
+
return target;
|
|
129
|
+
}
|
|
130
|
+
var sweeps = /* @__PURE__ */ new Map();
|
|
131
|
+
function sweepAbandonedTempDirs() {
|
|
132
|
+
const objects = join2(cacheRoot(), "objects");
|
|
133
|
+
let sweep = sweeps.get(objects);
|
|
134
|
+
if (sweep === void 0) {
|
|
135
|
+
sweep = removeAbandoned();
|
|
136
|
+
sweeps.set(objects, sweep);
|
|
137
|
+
}
|
|
138
|
+
return sweep;
|
|
139
|
+
async function removeAbandoned() {
|
|
140
|
+
const names = await readdir(objects).catch(() => []);
|
|
141
|
+
await Promise.all(
|
|
142
|
+
names.filter((name) => TEMP_DIR.test(name)).map(async (name) => {
|
|
143
|
+
const dir = join2(objects, name);
|
|
144
|
+
const age = await ageMs(dir);
|
|
145
|
+
if (age !== void 0 && age > ABANDONED_TEMP_DIR_MS)
|
|
146
|
+
await rm2(dir, { recursive: true, force: true }).catch(() => {
|
|
147
|
+
});
|
|
148
|
+
})
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
async function ageMs(path) {
|
|
153
|
+
return stat(path).then(
|
|
154
|
+
(s) => Date.now() - s.ctimeMs,
|
|
155
|
+
() => void 0
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// src/cli.ts
|
|
160
|
+
var USAGE = `usage: coana-cache.mjs lookup <version> <component>
|
|
161
|
+
coana-cache.mjs install <version> <component> <sha256> <extracted-dir>`;
|
|
162
|
+
var NOT_CACHED = 4;
|
|
163
|
+
async function main(args) {
|
|
164
|
+
const [command, ...rest] = args;
|
|
165
|
+
if (command === "lookup" && rest.length === 2) {
|
|
166
|
+
const [version, component] = rest;
|
|
167
|
+
const dir = await lookup(version, component);
|
|
168
|
+
if (dir === void 0) return NOT_CACHED;
|
|
169
|
+
process.stdout.write(`${dir}
|
|
170
|
+
`);
|
|
171
|
+
return 0;
|
|
172
|
+
}
|
|
173
|
+
if (command === "install" && rest.length === 4) {
|
|
174
|
+
const [version, component, sha256, extracted] = rest;
|
|
175
|
+
const dir = await install(version, component, sha256, (tmp) => moveInto(extracted, tmp));
|
|
176
|
+
await rm3(extracted, { recursive: true, force: true }).catch(() => {
|
|
177
|
+
});
|
|
178
|
+
process.stdout.write(`${dir}
|
|
179
|
+
`);
|
|
180
|
+
return 0;
|
|
181
|
+
}
|
|
182
|
+
process.stderr.write(`${USAGE}
|
|
183
|
+
`);
|
|
184
|
+
return 2;
|
|
185
|
+
async function moveInto(extractedDir, dir) {
|
|
186
|
+
for (const name of await readdir2(extractedDir)) {
|
|
187
|
+
const from = join3(extractedDir, name);
|
|
188
|
+
const to = join3(dir, name);
|
|
189
|
+
try {
|
|
190
|
+
await rename2(from, to);
|
|
191
|
+
} catch (e) {
|
|
192
|
+
if (e.code !== "EXDEV") throw e;
|
|
193
|
+
await cp(from, to, { recursive: true, verbatimSymlinks: true });
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
process.exitCode = await main(process.argv.slice(2)).catch((e) => {
|
|
199
|
+
process.stderr.write(`${e instanceof Error ? e.message : String(e)}
|
|
200
|
+
`);
|
|
201
|
+
if (e instanceof InvalidCacheKey) return 2;
|
|
202
|
+
return e instanceof CacheNotWritable ? 3 : 1;
|
|
203
|
+
});
|