Skip to content

Commit b996097

Browse files
committed
refactor(reachability): use full names instead of "tier 1/2/3" + bump Coana CLI to 15.5.7
Rename the reachability analysis types in user-facing text from the "Tier 1/2/3" numbering to their full names: Full application reachability (formerly Tier 1), Precomputed reachability (formerly Tier 2), and Dependency reachability (formerly Tier 3). Only --help text, command output, log messages, comments, and docs change; wire-format values such as the socket_tier1 scan type are kept as-is for backward compatibility. A note in docs/cli-reference.md maps the old names to the new ones. Also bump the pinned @coana-tech/cli version from 15.5.0 to 15.5.7.
1 parent 6e3996d commit b996097

8 files changed

Lines changed: 48 additions & 27 deletions

File tree

CHANGELOG.md

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

3+
## 2.4.13
4+
5+
### Changed: reachability analysis types now use full names instead of "Tier 1/2/3"
6+
7+
- Reachability analysis types are referred to by their full names instead of the
8+
"Tier 1/2/3" numbering: **Full application reachability** (formerly Tier 1),
9+
**Precomputed reachability** (formerly Tier 2), and **Dependency reachability**
10+
(formerly Tier 3). This updates `--help` text, command output, log messages, and docs
11+
only — wire-format values such as the `socket_tier1` scan type are unchanged for
12+
backward compatibility. See the reachability section in `docs/cli-reference.md` for the
13+
old→new name mapping.
14+
- Bumped the pinned `@coana-tech/cli` version to `15.5.7`.
15+
316
## 2.4.11
417

518
### Changed: units for `--reach-analysis-timeout` and `--reach-analysis-memory-limit`

docs/cli-reference.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,8 @@ If you don't want to provide the Socket API Token every time then you can use th
240240
#### Reachability Analysis
241241
| Parameter | Required | Default | Description |
242242
|:---------------------------------|:---------|:--------|:---------------------------------------------------------------------------------------------------------------------------|
243-
| `--reach` | False | False | Enable reachability analysis to identify which vulnerable functions are actually called by your code. Creates a tier-1 full-application reachability scan (`scan_type=socket_tier1`). |
244-
| `--reach-version` | False | 15.5.0 | Version of @coana-tech/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. |
243+
| `--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`). |
244+
| `--reach-version` | False | 15.5.7 | Version of @coana-tech/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. |
245245
| `--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` |
246246
| `--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` |
247247
| `--reach-concurrency` | False | 1 | Control parallel analysis execution (must be >= 1). Omitted by default, so coana applies its own default. |
@@ -271,6 +271,14 @@ The Python CLI verifies the following **up front** (before invoking the analysis
271271
272272
Separately, the analysis engine (coana) needs the **per-ecosystem build toolchain** for whatever languages your project uses — e.g. a compatible Python interpreter (3.11+, or PyPy) for Python, a JDK for Java/Kotlin/Scala, .NET 6+ for C#, the matching Go toolchain for Go, etc. These are validated by the engine **at analysis time** (the CLI does not pre-check them) and that validation can be skipped with `--reach-disable-external-tool-checks`.
273273
274+
**Reachability analysis types:**
275+
276+
Socket's reachability analysis comes in three forms, referred to by their full names rather than the older "Tier" numbering:
277+
278+
- **Full application reachability** (formerly *Tier 1*) — the full-application analysis enabled by `--reach`.
279+
- **Precomputed reachability** (formerly *Tier 2*).
280+
- **Dependency reachability** (formerly *Tier 3*).
281+
274282
## Config file support
275283

276284
Use `--config <path>` to load defaults from a `.toml` or `.json` file.

docs/troubleshooting.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Common reasons:
2222
- Policy vs dataset:
2323
- `--strict-blocking` only affects diff-scope behavior and does not make diff output equivalent to full dashboard data.
2424
- Reachability data availability:
25-
- If reachability analysis partially fails and falls back to precomputed tiers, counts can shift.
25+
- If reachability analysis partially fails and falls back to precomputed reachability, counts can shift.
2626

2727
Recommended comparison path:
2828

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.11"
9+
version = "2.4.13"
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.11'
2+
__version__ = '2.4.13'
33
USER_AGENT = f'SocketPythonCLI/{__version__}'

socketsecurity/core/__init__.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
# whose basename is exactly ``.socket.facts.json.br`` and stores it as plain
5959
# ``.socket.facts.json``. Compressing the facts file on upload keeps it well under the
6060
# server's per-file size cap (a ~262 MB facts file compresses to roughly 15-30 MB),
61-
# which is required for large reachability (tier 1) scans to succeed.
61+
# which is required for large full application reachability scans to succeed.
6262
#
6363
# The server matches the *exact* name ``.socket.facts.json.br``, so we only compress
6464
# files whose basename is exactly ``.socket.facts.json`` (a custom ``--reach-output-file``
@@ -72,8 +72,8 @@
7272
# Stream the facts file in 1 MiB chunks so large files aren't held fully in memory.
7373
SOCKET_FACTS_BROTLI_CHUNK_SIZE = 1024 * 1024
7474

75-
# Tier 1 reachability finalize retry policy. The finalize call links the tier1 scan to the
76-
# full scan and can fail transiently (network/API blips); a few backoff retries make it robust.
75+
# Full application reachability finalize retry policy. The finalize call links the reachability
76+
# scan to the full scan and can fail transiently (network/API blips); a few backoff retries make it robust.
7777
TIER1_FINALIZE_MAX_ATTEMPTS = 3
7878
TIER1_FINALIZE_BACKOFF_SECONDS = 1.0
7979

@@ -612,21 +612,21 @@ def empty_head_scan_file() -> List[str]:
612612

613613
def finalize_tier1_scan(self, full_scan_id: str, facts_file_path: str) -> bool:
614614
"""
615-
Finalize a tier 1 reachability scan by associating it with a full scan.
615+
Finalize a full application reachability scan by associating it with a full scan.
616616
617617
This function reads the tier1ReachabilityScanId from the facts file and
618618
calls the SDK to link it with the specified full scan.
619619
620-
Linking the tier 1 scan to the full scan helps the Socket team debug potential issues.
620+
Linking the reachability scan to the full scan helps the Socket team debug potential issues.
621621
622622
Args:
623-
full_scan_id: The ID of the full scan to associate with the tier 1 scan
623+
full_scan_id: The ID of the full scan to associate with the reachability scan
624624
facts_file_path: Path to the .socket.facts.json file containing the tier1ReachabilityScanId
625625
626626
Returns:
627627
True if successful, False otherwise
628628
"""
629-
log.debug(f"Finalizing tier 1 scan for full scan {full_scan_id}")
629+
log.debug(f"Finalizing full application reachability scan for full scan {full_scan_id}")
630630

631631
# Read the tier1ReachabilityScanId from the facts file
632632
try:
@@ -649,7 +649,7 @@ def finalize_tier1_scan(self, full_scan_id: str, facts_file_path: str) -> bool:
649649
log.debug(f"Failed to read tier1ReachabilityScanId from {facts_file_path}: {e}")
650650
return False
651651

652-
# Call the SDK to finalize the tier 1 scan, retrying transient failures with backoff.
652+
# Call the SDK to finalize the full application reachability scan, retrying transient failures with backoff.
653653
last_error: Optional[Exception] = None
654654
for attempt in range(1, TIER1_FINALIZE_MAX_ATTEMPTS + 1):
655655
try:
@@ -659,7 +659,7 @@ def finalize_tier1_scan(self, full_scan_id: str, facts_file_path: str) -> bool:
659659
)
660660

661661
if success:
662-
log.debug(f"Successfully finalized tier 1 scan {tier1_scan_id} for full scan {full_scan_id}")
662+
log.debug(f"Successfully finalized full application reachability scan {tier1_scan_id} for full scan {full_scan_id}")
663663
return True
664664

665665
log.debug(
@@ -669,20 +669,20 @@ def finalize_tier1_scan(self, full_scan_id: str, facts_file_path: str) -> bool:
669669
except Exception as e:
670670
last_error = e
671671
log.debug(
672-
f"Unable to finalize tier 1 scan (attempt {attempt}/{TIER1_FINALIZE_MAX_ATTEMPTS}): {e}"
672+
f"Unable to finalize full application reachability scan (attempt {attempt}/{TIER1_FINALIZE_MAX_ATTEMPTS}): {e}"
673673
)
674674

675675
if attempt < TIER1_FINALIZE_MAX_ATTEMPTS:
676676
time.sleep(TIER1_FINALIZE_BACKOFF_SECONDS * (2 ** (attempt - 1)))
677677

678678
if last_error is not None:
679679
log.debug(
680-
f"Giving up finalizing tier 1 scan {tier1_scan_id} after "
680+
f"Giving up finalizing full application reachability scan {tier1_scan_id} after "
681681
f"{TIER1_FINALIZE_MAX_ATTEMPTS} attempts: {last_error}"
682682
)
683683
else:
684684
log.debug(
685-
f"Giving up finalizing tier 1 scan {tier1_scan_id} after "
685+
f"Giving up finalizing full application reachability scan {tier1_scan_id} after "
686686
f"{TIER1_FINALIZE_MAX_ATTEMPTS} attempts"
687687
)
688688
return False
@@ -846,21 +846,21 @@ def create_full_scan(self, files: List[str], params: FullScanParams, base_paths:
846846
total_time = create_full_end - create_full_start
847847
log.debug(f"New Full Scan created in {total_time:.2f} seconds")
848848

849-
# Finalize tier1 scan if reachability analysis was enabled
849+
# Finalize full application reachability scan if reachability analysis was enabled
850850
if self.cli_config and self.cli_config.reach:
851851
facts_file_path = os.path.join(
852-
self.cli_config.target_path or ".",
852+
self.cli_config.target_path or ".",
853853
self.cli_config.reach_output_file
854854
)
855-
log.debug(f"Reachability analysis enabled, finalizing tier1 scan for full scan {full_scan.id}")
855+
log.debug(f"Reachability analysis enabled, finalizing full application reachability scan for full scan {full_scan.id}")
856856
try:
857857
success = self.finalize_tier1_scan(full_scan.id, facts_file_path)
858858
if success:
859-
log.debug(f"Successfully finalized tier1 scan for full scan {full_scan.id}")
859+
log.debug(f"Successfully finalized full application reachability scan for full scan {full_scan.id}")
860860
else:
861-
log.debug(f"Failed to finalize tier1 scan for full scan {full_scan.id}")
861+
log.debug(f"Failed to finalize full application reachability scan for full scan {full_scan.id}")
862862
except Exception as e:
863-
log.warning(f"Error finalizing tier1 scan for full scan {full_scan.id}: {e}")
863+
log.warning(f"Error finalizing full application reachability scan for full scan {full_scan.id}: {e}")
864864

865865
return full_scan
866866

socketsecurity/core/tools/reachability.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# Pinned @coana-tech/cli version. Bumped deliberately per Python CLI release so the
1919
# reachability engine version only changes through a standard pip upgrade (advance notice).
2020
# Pass --reach-version latest to opt into the newest published version instead.
21-
DEFAULT_COANA_CLI_VERSION: Final = "15.5.0"
21+
DEFAULT_COANA_CLI_VERSION: Final = "15.5.7"
2222

2323
# Resolved @coana-tech/cli script paths from the npm-install fallback, keyed by version.
2424
# Lives for the process lifetime so repeated fallback invocations install only once
@@ -55,7 +55,7 @@ def __init__(self, sdk: socketdev, api_token: str):
5555

5656
def _resolve_coana_package_spec(self, version: Optional[str] = None) -> str:
5757
"""
58-
Resolve the @coana-tech/cli package spec to run (e.g. '@coana-tech/cli@15.5.0').
58+
Resolve the @coana-tech/cli package spec to run (e.g. '@coana-tech/cli@15.5.7').
5959
6060
Args:
6161
version: Coana CLI version to use.
@@ -64,7 +64,7 @@ def _resolve_coana_package_spec(self, version: Optional[str] = None) -> str:
6464
- '<semver>': that exact version.
6565
6666
Returns:
67-
str: The package specifier to use with npx (e.g. '@coana-tech/cli@15.5.0').
67+
str: The package specifier to use with npx (e.g. '@coana-tech/cli@15.5.7').
6868
"""
6969
return f"@coana-tech/cli@{self._resolve_coana_version(version)}"
7070

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)