socketsecurity 2.2.36__tar.gz → 2.2.40__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.2.36 → socketsecurity-2.2.40}/PKG-INFO +33 -2
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/README.md +31 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/pyproject.toml +2 -2
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/socketsecurity/__init__.py +1 -1
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/socketsecurity/core/__init__.py +82 -9
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/socketsecurity/core/tools/reachability.py +4 -2
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/socketsecurity/socketcli.py +3 -7
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/.github/CODEOWNERS +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/.github/PULL_REQUEST_TEMPLATE/bug-fix.md +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/.github/PULL_REQUEST_TEMPLATE/feature.md +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/.github/PULL_REQUEST_TEMPLATE/improvement.md +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/.github/workflows/docker-stable.yml +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/.github/workflows/pr-preview.yml +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/.github/workflows/release.yml +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/.github/workflows/version-check.yml +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/.gitignore +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/.hooks/sync_version.py +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/.pre-commit-config.yaml +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/.python-version +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/Dockerfile +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/LICENSE +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/Makefile +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/docs/README.md +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/pytest.ini +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/scripts/build_container.sh +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/scripts/build_container_flexible.sh +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/scripts/deploy-test-docker.sh +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/scripts/deploy-test-pypi.sh +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/scripts/docker-entrypoint.sh +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/scripts/run.sh +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/socketsecurity/config.py +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/socketsecurity/core/classes.py +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/socketsecurity/core/cli_client.py +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/socketsecurity/core/exceptions.py +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/socketsecurity/core/git_interface.py +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/socketsecurity/core/helper/__init__.py +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/socketsecurity/core/lazy_file_loader.py +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/socketsecurity/core/logging.py +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/socketsecurity/core/messages.py +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/socketsecurity/core/resource_utils.py +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/socketsecurity/core/scm/__init__.py +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/socketsecurity/core/scm/base.py +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/socketsecurity/core/scm/client.py +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/socketsecurity/core/scm/github.py +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/socketsecurity/core/scm/gitlab.py +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/socketsecurity/core/scm_comments.py +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/socketsecurity/core/socket_config.py +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/socketsecurity/core/utils.py +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/socketsecurity/output.py +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/socketsecurity/plugins/__init__.py +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/socketsecurity/plugins/base.py +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/socketsecurity/plugins/jira.py +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/socketsecurity/plugins/manager.py +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/socketsecurity/plugins/slack.py +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/socketsecurity/plugins/teams.py +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/socketsecurity/plugins/webhook.py +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/tests/__init__.py +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/tests/core/conftest.py +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/tests/core/create_diff_input.json +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/tests/core/test_diff_generation.py +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/tests/core/test_package_and_alerts.py +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/tests/core/test_sdk_methods.py +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/tests/core/test_supporting_methods.py +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/tests/data/fullscans/create_response.json +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/tests/data/fullscans/diff/stream_diff.json +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/tests/data/fullscans/diff/stream_diff_full.json +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/tests/data/fullscans/head_scan/metadata.json +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/tests/data/fullscans/head_scan/stream_scan.json +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/tests/data/fullscans/head_scan/stream_scan_full.json +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/tests/data/fullscans/new_scan/metadata.json +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/tests/data/fullscans/new_scan/stream_scan.json +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/tests/data/repos/repo_info_error.json +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/tests/data/repos/repo_info_no_head.json +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/tests/data/repos/repo_info_success.json +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/tests/data/settings/security-policy.json +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/tests/unit/__init__.py +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/tests/unit/test_cli_config.py +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/tests/unit/test_client.py +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/tests/unit/test_config.py +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/tests/unit/test_gitlab_auth.py +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/tests/unit/test_gitlab_auth_fallback.py +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/tests/unit/test_output.py +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/uv.lock +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/workflows/bitbucket-pipelines.yml +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/workflows/github-actions.yml +0 -0
- {socketsecurity-2.2.36 → socketsecurity-2.2.40}/workflows/gitlab-ci.yml +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: socketsecurity
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.40
|
|
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>
|
|
@@ -40,7 +40,7 @@ Requires-Dist: packaging
|
|
|
40
40
|
Requires-Dist: prettytable
|
|
41
41
|
Requires-Dist: python-dotenv
|
|
42
42
|
Requires-Dist: requests
|
|
43
|
-
Requires-Dist: socketdev<4.0.0,>=3.0.
|
|
43
|
+
Requires-Dist: socketdev<4.0.0,>=3.0.21
|
|
44
44
|
Provides-Extra: dev
|
|
45
45
|
Requires-Dist: hatch; extra == 'dev'
|
|
46
46
|
Requires-Dist: pre-commit; extra == 'dev'
|
|
@@ -553,3 +553,34 @@ Implementation targets:
|
|
|
553
553
|
#### GitLab Integration
|
|
554
554
|
- `GITLAB_TOKEN`: GitLab API token for GitLab integration (supports both Bearer and PRIVATE-TOKEN authentication)
|
|
555
555
|
- `CI_JOB_TOKEN`: GitLab CI job token (automatically provided in GitLab CI environments)
|
|
556
|
+
|
|
557
|
+
### Manual Development Environment Setup
|
|
558
|
+
|
|
559
|
+
For manual setup without using the Make targets, follow these steps:
|
|
560
|
+
|
|
561
|
+
1. **Create a virtual environment:**
|
|
562
|
+
```bash
|
|
563
|
+
python -m venv .venv
|
|
564
|
+
```
|
|
565
|
+
|
|
566
|
+
2. **Activate the virtual environment:**
|
|
567
|
+
```bash
|
|
568
|
+
source .venv/bin/activate
|
|
569
|
+
```
|
|
570
|
+
|
|
571
|
+
3. **Sync dependencies with uv:**
|
|
572
|
+
```bash
|
|
573
|
+
uv sync
|
|
574
|
+
```
|
|
575
|
+
|
|
576
|
+
4. **Install pre-commit:**
|
|
577
|
+
```bash
|
|
578
|
+
uv add --dev pre-commit
|
|
579
|
+
```
|
|
580
|
+
|
|
581
|
+
5. **Register the pre-commit hook:**
|
|
582
|
+
```bash
|
|
583
|
+
pre-commit install
|
|
584
|
+
```
|
|
585
|
+
|
|
586
|
+
> **Note**: This manual setup is an alternative to the streamlined Make targets described above. For most development workflows, using `make first-time-setup` or `make first-time-local-setup` is recommended.
|
|
@@ -496,3 +496,34 @@ Implementation targets:
|
|
|
496
496
|
#### GitLab Integration
|
|
497
497
|
- `GITLAB_TOKEN`: GitLab API token for GitLab integration (supports both Bearer and PRIVATE-TOKEN authentication)
|
|
498
498
|
- `CI_JOB_TOKEN`: GitLab CI job token (automatically provided in GitLab CI environments)
|
|
499
|
+
|
|
500
|
+
### Manual Development Environment Setup
|
|
501
|
+
|
|
502
|
+
For manual setup without using the Make targets, follow these steps:
|
|
503
|
+
|
|
504
|
+
1. **Create a virtual environment:**
|
|
505
|
+
```bash
|
|
506
|
+
python -m venv .venv
|
|
507
|
+
```
|
|
508
|
+
|
|
509
|
+
2. **Activate the virtual environment:**
|
|
510
|
+
```bash
|
|
511
|
+
source .venv/bin/activate
|
|
512
|
+
```
|
|
513
|
+
|
|
514
|
+
3. **Sync dependencies with uv:**
|
|
515
|
+
```bash
|
|
516
|
+
uv sync
|
|
517
|
+
```
|
|
518
|
+
|
|
519
|
+
4. **Install pre-commit:**
|
|
520
|
+
```bash
|
|
521
|
+
uv add --dev pre-commit
|
|
522
|
+
```
|
|
523
|
+
|
|
524
|
+
5. **Register the pre-commit hook:**
|
|
525
|
+
```bash
|
|
526
|
+
pre-commit install
|
|
527
|
+
```
|
|
528
|
+
|
|
529
|
+
> **Note**: This manual setup is an alternative to the streamlined Make targets described above. For most development workflows, using `make first-time-setup` or `make first-time-local-setup` is recommended.
|
|
@@ -6,7 +6,7 @@ build-backend = "hatchling.build"
|
|
|
6
6
|
|
|
7
7
|
[project]
|
|
8
8
|
name = "socketsecurity"
|
|
9
|
-
version = "2.2.
|
|
9
|
+
version = "2.2.40"
|
|
10
10
|
requires-python = ">= 3.10"
|
|
11
11
|
license = {"file" = "LICENSE"}
|
|
12
12
|
dependencies = [
|
|
@@ -16,7 +16,7 @@ dependencies = [
|
|
|
16
16
|
'GitPython',
|
|
17
17
|
'packaging',
|
|
18
18
|
'python-dotenv',
|
|
19
|
-
'socketdev>=3.0.
|
|
19
|
+
'socketdev>=3.0.21,<4.0.0',
|
|
20
20
|
"bs4>=0.0.2",
|
|
21
21
|
]
|
|
22
22
|
readme = "README.md"
|
|
@@ -10,7 +10,10 @@ from dataclasses import asdict
|
|
|
10
10
|
from glob import glob
|
|
11
11
|
from io import BytesIO
|
|
12
12
|
from pathlib import PurePath
|
|
13
|
-
from typing import BinaryIO, Dict, List, Tuple, Set, Union
|
|
13
|
+
from typing import BinaryIO, Dict, List, Tuple, Set, Union, TYPE_CHECKING, Optional
|
|
14
|
+
|
|
15
|
+
if TYPE_CHECKING:
|
|
16
|
+
from socketsecurity.config import CliConfig
|
|
14
17
|
from socketdev import socketdev
|
|
15
18
|
from socketdev.exceptions import APIFailure
|
|
16
19
|
from socketdev.fullscans import FullScanParams, SocketArtifact
|
|
@@ -59,11 +62,13 @@ class Core:
|
|
|
59
62
|
|
|
60
63
|
config: SocketConfig
|
|
61
64
|
sdk: socketdev
|
|
65
|
+
cli_config: Optional['CliConfig']
|
|
62
66
|
|
|
63
|
-
def __init__(self, config: SocketConfig, sdk: socketdev) -> None:
|
|
67
|
+
def __init__(self, config: SocketConfig, sdk: socketdev, cli_config: Optional['CliConfig'] = None) -> None:
|
|
64
68
|
"""Initialize Core with configuration and SDK instance."""
|
|
65
69
|
self.config = config
|
|
66
70
|
self.sdk = sdk
|
|
71
|
+
self.cli_config = cli_config
|
|
67
72
|
self.set_org_vars()
|
|
68
73
|
|
|
69
74
|
def set_org_vars(self) -> None:
|
|
@@ -453,7 +458,61 @@ class Core:
|
|
|
453
458
|
log.debug(f"Created temporary empty file for baseline scan: {temp_path}")
|
|
454
459
|
return [temp_path]
|
|
455
460
|
|
|
456
|
-
def
|
|
461
|
+
def finalize_tier1_scan(self, full_scan_id: str, facts_file_path: str) -> bool:
|
|
462
|
+
"""
|
|
463
|
+
Finalize a tier 1 reachability scan by associating it with a full scan.
|
|
464
|
+
|
|
465
|
+
This function reads the tier1ReachabilityScanId from the facts file and
|
|
466
|
+
calls the SDK to link it with the specified full scan.
|
|
467
|
+
|
|
468
|
+
Linking the tier 1 scan to the full scan helps the Socket team debug potential issues.
|
|
469
|
+
|
|
470
|
+
Args:
|
|
471
|
+
full_scan_id: The ID of the full scan to associate with the tier 1 scan
|
|
472
|
+
facts_file_path: Path to the .socket.facts.json file containing the tier1ReachabilityScanId
|
|
473
|
+
|
|
474
|
+
Returns:
|
|
475
|
+
True if successful, False otherwise
|
|
476
|
+
"""
|
|
477
|
+
log.debug(f"Finalizing tier 1 scan for full scan {full_scan_id}")
|
|
478
|
+
|
|
479
|
+
# Read the tier1ReachabilityScanId from the facts file
|
|
480
|
+
try:
|
|
481
|
+
if not os.path.exists(facts_file_path):
|
|
482
|
+
log.debug(f"Facts file not found: {facts_file_path}")
|
|
483
|
+
return False
|
|
484
|
+
|
|
485
|
+
with open(facts_file_path, 'r') as f:
|
|
486
|
+
facts = json.load(f)
|
|
487
|
+
|
|
488
|
+
tier1_scan_id = facts.get('tier1ReachabilityScanId')
|
|
489
|
+
if not tier1_scan_id:
|
|
490
|
+
log.debug(f"No tier1ReachabilityScanId found in {facts_file_path}")
|
|
491
|
+
return False
|
|
492
|
+
|
|
493
|
+
tier1_scan_id = tier1_scan_id.strip()
|
|
494
|
+
log.debug(f"Found tier1ReachabilityScanId: {tier1_scan_id}")
|
|
495
|
+
|
|
496
|
+
except (json.JSONDecodeError, IOError) as e:
|
|
497
|
+
log.debug(f"Failed to read tier1ReachabilityScanId from {facts_file_path}: {e}")
|
|
498
|
+
return False
|
|
499
|
+
|
|
500
|
+
# Call the SDK to finalize the tier 1 scan
|
|
501
|
+
try:
|
|
502
|
+
success = self.sdk.fullscans.finalize_tier1(
|
|
503
|
+
full_scan_id=full_scan_id,
|
|
504
|
+
tier1_reachability_scan_id=tier1_scan_id,
|
|
505
|
+
)
|
|
506
|
+
|
|
507
|
+
if success:
|
|
508
|
+
log.debug(f"Successfully finalized tier 1 scan {tier1_scan_id} for full scan {full_scan_id}")
|
|
509
|
+
return success
|
|
510
|
+
|
|
511
|
+
except Exception as e:
|
|
512
|
+
log.debug(f"Unable to finalize tier 1 scan: {e}")
|
|
513
|
+
return False
|
|
514
|
+
|
|
515
|
+
def create_full_scan(self, files: List[str], params: FullScanParams, base_paths: Optional[List[str]] = None) -> FullScan:
|
|
457
516
|
"""
|
|
458
517
|
Creates a new full scan via the Socket API.
|
|
459
518
|
|
|
@@ -478,6 +537,19 @@ class Core:
|
|
|
478
537
|
total_time = create_full_end - create_full_start
|
|
479
538
|
log.debug(f"New Full Scan created in {total_time:.2f} seconds")
|
|
480
539
|
|
|
540
|
+
# Finalize tier1 scan if reachability analysis was enabled
|
|
541
|
+
if self.cli_config and self.cli_config.reach:
|
|
542
|
+
facts_file_path = self.cli_config.reach_output_file or ".socket.facts.json"
|
|
543
|
+
log.debug(f"Reachability analysis enabled, finalizing tier1 scan for full scan {full_scan.id}")
|
|
544
|
+
try:
|
|
545
|
+
success = self.finalize_tier1_scan(full_scan.id, facts_file_path)
|
|
546
|
+
if success:
|
|
547
|
+
log.debug(f"Successfully finalized tier1 scan for full scan {full_scan.id}")
|
|
548
|
+
else:
|
|
549
|
+
log.debug(f"Failed to finalize tier1 scan for full scan {full_scan.id}")
|
|
550
|
+
except Exception as e:
|
|
551
|
+
log.warning(f"Error finalizing tier1 scan for full scan {full_scan.id}: {e}")
|
|
552
|
+
|
|
481
553
|
return full_scan
|
|
482
554
|
|
|
483
555
|
def create_full_scan_with_report_url(
|
|
@@ -485,9 +557,9 @@ class Core:
|
|
|
485
557
|
paths: List[str],
|
|
486
558
|
params: FullScanParams,
|
|
487
559
|
no_change: bool = False,
|
|
488
|
-
save_files_list_path: str = None,
|
|
489
|
-
save_manifest_tar_path: str = None,
|
|
490
|
-
base_paths: List[str] = None
|
|
560
|
+
save_files_list_path: Optional[str] = None,
|
|
561
|
+
save_manifest_tar_path: Optional[str] = None,
|
|
562
|
+
base_paths: Optional[List[str]] = None
|
|
491
563
|
) -> Diff:
|
|
492
564
|
"""Create a new full scan and return with html_report_url.
|
|
493
565
|
|
|
@@ -881,9 +953,9 @@ class Core:
|
|
|
881
953
|
paths: List[str],
|
|
882
954
|
params: FullScanParams,
|
|
883
955
|
no_change: bool = False,
|
|
884
|
-
save_files_list_path: str = None,
|
|
885
|
-
save_manifest_tar_path: str = None,
|
|
886
|
-
base_paths: List[str] = None
|
|
956
|
+
save_files_list_path: Optional[str] = None,
|
|
957
|
+
save_manifest_tar_path: Optional[str] = None,
|
|
958
|
+
base_paths: Optional[List[str]] = None
|
|
887
959
|
) -> Diff:
|
|
888
960
|
"""Create a new diff using the Socket SDK.
|
|
889
961
|
|
|
@@ -1130,6 +1202,7 @@ class Core:
|
|
|
1130
1202
|
)
|
|
1131
1203
|
return purl
|
|
1132
1204
|
|
|
1205
|
+
|
|
1133
1206
|
@staticmethod
|
|
1134
1207
|
def get_source_data(package: Package, packages: dict) -> list:
|
|
1135
1208
|
"""
|
|
@@ -133,10 +133,12 @@ class ReachabilityAnalyzer:
|
|
|
133
133
|
cli_package = self._ensure_coana_cli_installed(version)
|
|
134
134
|
|
|
135
135
|
# Build CLI command arguments
|
|
136
|
-
cmd = ["npx", cli_package, "run",
|
|
136
|
+
cmd = ["npx", cli_package, "run", "."]
|
|
137
137
|
|
|
138
138
|
# Add required arguments
|
|
139
139
|
output_dir = str(pathlib.Path(output_path).parent)
|
|
140
|
+
log.warning(f"output_dir: {output_dir}")
|
|
141
|
+
log.warning(f"output_path: {output_path}")
|
|
140
142
|
cmd.extend([
|
|
141
143
|
"--output-dir", output_dir,
|
|
142
144
|
"--socket-mode", output_path,
|
|
@@ -210,7 +212,7 @@ class ReachabilityAnalyzer:
|
|
|
210
212
|
result = subprocess.run(
|
|
211
213
|
cmd,
|
|
212
214
|
env=env,
|
|
213
|
-
cwd=
|
|
215
|
+
cwd=target_directory,
|
|
214
216
|
stdout=sys.stderr, # Send stdout to stderr so user sees it
|
|
215
217
|
stderr=sys.stderr, # Send stderr to stderr
|
|
216
218
|
timeout=timeout + 60 if timeout else None # Add buffer to subprocess timeout
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import json
|
|
2
|
+
import os
|
|
2
3
|
import sys
|
|
3
4
|
import traceback
|
|
4
5
|
import shutil
|
|
@@ -81,7 +82,7 @@ def main_code():
|
|
|
81
82
|
client = CliClient(socket_config)
|
|
82
83
|
sdk.api.api_url = socket_config.api_url
|
|
83
84
|
log.debug("loaded client")
|
|
84
|
-
core = Core(socket_config, sdk)
|
|
85
|
+
core = Core(socket_config, sdk, config)
|
|
85
86
|
log.debug("loaded core")
|
|
86
87
|
|
|
87
88
|
# Check for required dependencies if reachability analysis is enabled
|
|
@@ -207,7 +208,6 @@ def main_code():
|
|
|
207
208
|
base_paths = [config.target_path] # Always use target_path as the single base path
|
|
208
209
|
|
|
209
210
|
if config.sub_paths:
|
|
210
|
-
import os
|
|
211
211
|
for sub_path in config.sub_paths:
|
|
212
212
|
full_scan_path = os.path.join(config.target_path, sub_path)
|
|
213
213
|
log.debug(f"Using sub-path for scanning: {full_scan_path}")
|
|
@@ -299,7 +299,6 @@ def main_code():
|
|
|
299
299
|
|
|
300
300
|
# If only-facts-file mode, mark the facts file for submission
|
|
301
301
|
if config.only_facts_file:
|
|
302
|
-
import os
|
|
303
302
|
facts_file_to_submit = os.path.abspath(output_path)
|
|
304
303
|
log.info(f"Only-facts-file mode: will submit only {facts_file_to_submit}")
|
|
305
304
|
|
|
@@ -355,9 +354,6 @@ def main_code():
|
|
|
355
354
|
# If using sub_paths, we need to check if manifest files exist in the scan paths
|
|
356
355
|
if config.sub_paths and not files_explicitly_specified:
|
|
357
356
|
# Override file checking to look in the scan paths instead
|
|
358
|
-
import os
|
|
359
|
-
from pathlib import Path
|
|
360
|
-
|
|
361
357
|
# Get manifest files from all scan paths
|
|
362
358
|
try:
|
|
363
359
|
all_scan_files = []
|
|
@@ -569,7 +565,7 @@ def main_code():
|
|
|
569
565
|
)
|
|
570
566
|
output_handler.handle_output(diff)
|
|
571
567
|
|
|
572
|
-
|
|
568
|
+
# Handle license generation
|
|
573
569
|
if not should_skip_scan and diff.id != "NO_DIFF_RAN" and diff.id != "NO_SCAN_RAN" and config.generate_license:
|
|
574
570
|
all_packages = {}
|
|
575
571
|
for purl in diff.packages:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{socketsecurity-2.2.36 → socketsecurity-2.2.40}/.github/PULL_REQUEST_TEMPLATE/improvement.md
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
|
|
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.2.36 → socketsecurity-2.2.40}/tests/data/fullscans/diff/stream_diff_full.json
RENAMED
|
File without changes
|
{socketsecurity-2.2.36 → socketsecurity-2.2.40}/tests/data/fullscans/head_scan/metadata.json
RENAMED
|
File without changes
|
{socketsecurity-2.2.36 → socketsecurity-2.2.40}/tests/data/fullscans/head_scan/stream_scan.json
RENAMED
|
File without changes
|
{socketsecurity-2.2.36 → socketsecurity-2.2.40}/tests/data/fullscans/head_scan/stream_scan_full.json
RENAMED
|
File without changes
|
|
File without changes
|
{socketsecurity-2.2.36 → socketsecurity-2.2.40}/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
|
|
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
|