Skip to content

Commit 3c991e3

Browse files
committed
Merge remote-tracking branch 'origin/main' into lelia/dependabot-pr-merge-fix
2 parents 3f4bee2 + 80741b7 commit 3c991e3

14 files changed

Lines changed: 775 additions & 43 deletions

CHANGELOG.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,49 @@
11
# Changelog
22

3+
## 2.4.3
4+
5+
### Added: unified `--exclude-paths` for manifest discovery and reachability
6+
7+
- New `--exclude-paths` flag (comma-separated globs) that excludes matching paths from
8+
BOTH SCA manifest discovery and reachability analysis. Patterns are scan-root-relative
9+
anchored globs (`*` does not cross `/`, `**` does), matching the Node CLI's behavior.
10+
- Pattern validation rejects unsupported forms (negation, absolute paths, `..` traversal,
11+
and match-everything patterns). Patterns may be supplied on the CLI as a comma-separated
12+
string or via a `--config` file list.
13+
- `--reach-exclude-paths` is now deprecated in favor of `--exclude-paths`. It still works
14+
(and is unioned into the Coana `--exclude-dirs` argument) but is marked deprecated in
15+
`--help` and warns at runtime.
16+
17+
## 2.4.2
18+
19+
### Added: reachability flag and Coana environment alignment with the Node CLI
20+
21+
- New `--reach-disable-external-tool-checks` flag (passes `--disable-external-tool-checks`
22+
to the Coana CLI).
23+
- New `--reach-debug` flag to enable Coana debug output (`--debug`) independently of the
24+
global `--enable-debug`.
25+
- Node-style `--reach-analysis-timeout` and `--reach-analysis-memory-limit` are now the
26+
primary flag names; the previous `--reach-timeout` / `--reach-memory-limit` continue to
27+
work as hidden aliases.
28+
- The Coana subprocess now receives `SOCKET_CLI_VERSION` and `SOCKET_CALLER_USER_AGENT` so
29+
calls are attributed to the Python CLI. Proxies continue to work via the inherited
30+
`HTTPS_PROXY` / `HTTP_PROXY` environment variables, which Coana reads itself.
31+
- `SOCKET_REPO_NAME` / `SOCKET_BRANCH_NAME` are no longer forwarded to Coana when the repo
32+
and branch are the default sentinels, avoiding cross-run reachability cache-bucket
33+
collisions.
34+
- Tier 1 reachability finalize now retries with exponential backoff instead of giving up on
35+
the first transient error.
36+
37+
## 2.4.1
38+
39+
### Added: pyenv in the Docker image
40+
41+
- The `socketdev/cli` Docker image now bundles [pyenv](https://github.com/pyenv/pyenv)
42+
(pinned to `v2.7.1`) along with the Alpine build dependencies needed to compile
43+
CPython from source, so the image can build/install arbitrary Python versions on
44+
demand.
45+
- The CLI itself is unchanged — this release only affects the published Docker image.
46+
347
## 2.4.0
448

549
### Changed: license details are no longer requested on the full-scan diff

Dockerfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,29 @@ ENV GOPATH="/go"
8888
# Install uv
8989
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
9090

91+
# Install pyenv
92+
# pyenv lets us build/install arbitrary Python versions on demand. We install
93+
# the build dependencies needed to compile CPython on Alpine, then install
94+
# pyenv itself. We deliberately only symlink the `pyenv` binary onto the PATH
95+
# and do NOT add pyenv's shims directory, so its shims don't shadow the system
96+
# Python that the CLI runs on.
97+
RUN apk add --no-cache \
98+
bash \
99+
bzip2-dev \
100+
ca-certificates \
101+
libffi-dev \
102+
libxslt-dev \
103+
linux-headers \
104+
ncurses-dev \
105+
openssl-dev \
106+
readline-dev \
107+
sqlite-dev \
108+
xz-dev \
109+
zlib-dev
110+
RUN curl -L https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | PYENV_GIT_TAG="v2.7.1" bash && \
111+
ln -s ~/.pyenv/bin/pyenv /bin/pyenv && \
112+
pyenv --version
113+
91114
# Install CLI based on build mode
92115
RUN if [ "$USE_LOCAL_INSTALL" = "true" ]; then \
93116
echo "Using local development install"; \

docs/cli-reference.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -148,14 +148,14 @@ socketcli [-h] [--api-token API_TOKEN] [--repo REPO] [--workspace WORKSPACE] [--
148148
[--owner OWNER] [--pr-number PR_NUMBER] [--commit-message COMMIT_MESSAGE] [--commit-sha COMMIT_SHA] [--committers [COMMITTERS ...]]
149149
[--target-path TARGET_PATH] [--sbom-file SBOM_FILE] [--license-file-name LICENSE_FILE_NAME] [--save-submitted-files-list SAVE_SUBMITTED_FILES_LIST]
150150
[--save-manifest-tar SAVE_MANIFEST_TAR] [--files FILES] [--sub-path SUB_PATH] [--workspace-name WORKSPACE_NAME]
151-
[--excluded-ecosystems EXCLUDED_ECOSYSTEMS] [--default-branch] [--pending-head] [--generate-license] [--enable-debug]
151+
[--excluded-ecosystems EXCLUDED_ECOSYSTEMS] [--exclude-paths EXCLUDE_PATHS] [--default-branch] [--pending-head] [--generate-license] [--enable-debug]
152152
[--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>]
153153
[--disable-overview] [--exclude-license-details] [--allow-unverified] [--disable-security-issue]
154154
[--ignore-commit-files] [--disable-blocking] [--disable-ignore] [--enable-diff] [--scm SCM] [--timeout TIMEOUT] [--include-module-folders]
155-
[--reach] [--reach-version REACH_VERSION] [--reach-timeout REACH_ANALYSIS_TIMEOUT]
156-
[--reach-memory-limit REACH_ANALYSIS_MEMORY_LIMIT] [--reach-ecosystems REACH_ECOSYSTEMS] [--reach-exclude-paths REACH_EXCLUDE_PATHS]
157-
[--reach-min-severity {low,medium,high,critical}] [--reach-skip-cache] [--reach-disable-analytics] [--reach-output-file REACH_OUTPUT_FILE]
158-
[--only-facts-file] [--version]
155+
[--reach] [--reach-version REACH_VERSION] [--reach-analysis-timeout REACH_ANALYSIS_TIMEOUT]
156+
[--reach-analysis-memory-limit REACH_ANALYSIS_MEMORY_LIMIT] [--reach-concurrency REACH_CONCURRENCY] [--reach-ecosystems REACH_ECOSYSTEMS]
157+
[--reach-min-severity {low,medium,high,critical}] [--reach-skip-cache] [--reach-disable-analytics] [--reach-debug] [--reach-disable-external-tool-checks]
158+
[--reach-output-file REACH_OUTPUT_FILE] [--only-facts-file] [--version]
159159
````
160160

161161
If you don't want to provide the Socket API Token every time then you can use the environment variable `SOCKET_SECURITY_API_TOKEN`
@@ -203,6 +203,7 @@ If you don't want to provide the Socket API Token every time then you can use th
203203
| `--sub-path` | False | | Sub-path within target-path for manifest file scanning (can be specified multiple times). All sub-paths are combined into a single workspace scan while preserving git context from target-path. Must be used with `--workspace-name` |
204204
| `--workspace-name` | False | | Workspace name suffix to append to repository name (repo-name-workspace_name). Must be used with `--sub-path` |
205205
| `--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) |
206+
| `--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`. |
206207

207208
#### Branch and Scan Configuration
208209
| Parameter | Required | Default | Description |
@@ -239,16 +240,18 @@ If you don't want to provide the Socket API Token every time then you can use th
239240
|:---------------------------------|:---------|:--------|:---------------------------------------------------------------------------------------------------------------------------|
240241
| `--reach` | False | False | Enable reachability analysis to identify which vulnerable functions are actually called by your code |
241242
| `--reach-version` | False | latest | Version of @coana-tech/cli to use for analysis |
242-
| `--reach-timeout` | False | 1200 | Timeout in seconds for the reachability analysis (default: 1200 seconds / 20 minutes) |
243-
| `--reach-memory-limit` | False | 4096 | Memory limit in MB for the reachability analysis (default: 4096 MB / 4 GB) |
244-
| `--reach-concurrency` | False | | Control parallel analysis execution (must be >= 1) |
243+
| `--reach-analysis-timeout` | False | *coana* | Timeout in seconds for the reachability analysis. Omitted by default, so coana applies its own (currently 600s). Alias: `--reach-timeout` |
244+
| `--reach-analysis-memory-limit` | False | *coana* | Memory limit in MB for the reachability analysis. Omitted by default, so coana applies its own (currently 8192). Alias: `--reach-memory-limit` |
245+
| `--reach-concurrency` | False | *coana* | Control parallel analysis execution (must be >= 1). Omitted by default, so coana applies its own (currently 1) |
245246
| `--reach-additional-params` | False | | Pass custom parameters to the coana CLI tool |
246247
| `--reach-ecosystems` | False | | Comma-separated list of ecosystems to analyze (e.g., "npm,pypi"). If not specified, all supported ecosystems are analyzed |
247-
| `--reach-exclude-paths` | False | | Comma-separated list of file paths or patterns to exclude from reachability analysis |
248248
| `--reach-min-severity` | False | | Minimum severity level for reporting reachability results (low, medium, high, critical) |
249249
| `--reach-skip-cache` | False | False | Skip cache and force fresh reachability analysis |
250250
| `--reach-disable-analytics` | False | False | Disable analytics collection during reachability analysis |
251+
| `--reach-debug` | False | False | Enable coana debug output (`--debug`) for the analysis, independent of the global `--enable-debug` |
252+
| `--reach-disable-external-tool-checks` | False | False | Disable coana's external tool availability checks (passes `--disable-external-tool-checks`) |
251253
| `--reach-output-file` | False | .socket.facts.json | Path where reachability analysis results should be saved |
254+
| `--reach-exclude-paths` | False | | **[DEPRECATED — use `--exclude-paths`]** Comma-separated paths to exclude from reachability analysis. Still honored (unioned with `--exclude-paths`) but will be hidden in a future release |
252255
| `--only-facts-file` | False | False | Submit only the .socket.facts.json file to an existing scan (requires --reach and a prior scan) |
253256
254257
**Reachability Analysis Requirements:**

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ build-backend = "hatchling.build"
66

77
[project]
88
name = "socketsecurity"
9-
version = "2.4.0"
9+
version = "2.4.3"
1010
requires-python = ">= 3.11"
1111
license = {"file" = "LICENSE"}
1212
dependencies = [

socketsecurity/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
__author__ = 'socket.dev'
2-
__version__ = '2.4.0'
2+
__version__ = '2.4.3'
33
USER_AGENT = f'SocketPythonCLI/{__version__}'

0 commit comments

Comments
 (0)