cycode 3.26.1.dev4__py3-none-any.whl → 3.27.0__py3-none-any.whl
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.
- cycode/__init__.py +1 -1
- cycode/cli/apps/scan/scan_command.py +1 -0
- cycode/cli/apps/scan/scan_parameters.py +1 -0
- cycode/cli/cli_types.py +1 -0
- cycode/cli/consts.py +1 -0
- cycode/cli/printers/tables/sca_table_printer.py +7 -0
- cycode/cli/printers/utils/sca_policy_details.py +21 -0
- {cycode-3.26.1.dev4.dist-info → cycode-3.27.0.dist-info}/METADATA +18 -2
- {cycode-3.26.1.dev4.dist-info → cycode-3.27.0.dist-info}/RECORD +12 -12
- {cycode-3.26.1.dev4.dist-info → cycode-3.27.0.dist-info}/WHEEL +0 -0
- {cycode-3.26.1.dev4.dist-info → cycode-3.27.0.dist-info}/entry_points.txt +0 -0
- {cycode-3.26.1.dev4.dist-info → cycode-3.27.0.dist-info}/licenses/LICENCE +0 -0
cycode/__init__.py
CHANGED
|
@@ -5,4 +5,4 @@ import time as _time
|
|
|
5
5
|
# end-to-end scan duration from the moment the user actually triggered it.
|
|
6
6
|
_BOOT_WALL: float = _time.time()
|
|
7
7
|
|
|
8
|
-
__version__ = '3.
|
|
8
|
+
__version__ = '3.27.0' # DON'T TOUCH. Placeholder. Will be filled automatically on poetry build from Git Tag
|
|
@@ -15,6 +15,7 @@ def _get_default_scan_parameters(ctx: typer.Context) -> dict:
|
|
|
15
15
|
'package_vulnerabilities': ctx.obj.get('package-vulnerabilities'),
|
|
16
16
|
'license_compliance': ctx.obj.get('license-compliance'),
|
|
17
17
|
'maintainability': ctx.obj.get('unmaintained-packages', False),
|
|
18
|
+
'malicious_packages': ctx.obj.get('malicious-packages', False),
|
|
18
19
|
'command_type': ctx.info_name.replace('-', '_'), # save backward compatibility
|
|
19
20
|
'aggregation_id': str(generate_unique_scan_id()),
|
|
20
21
|
'cli_start_time': _BOOT_WALL,
|
cycode/cli/cli_types.py
CHANGED
|
@@ -41,6 +41,7 @@ class ScaScanTypeOption(StrEnum):
|
|
|
41
41
|
PACKAGE_VULNERABILITIES = 'package-vulnerabilities'
|
|
42
42
|
LICENSE_COMPLIANCE = 'license-compliance'
|
|
43
43
|
UNMAINTAINED_PACKAGES = 'unmaintained-packages'
|
|
44
|
+
MALICIOUS_PACKAGES = 'malicious-packages'
|
|
44
45
|
|
|
45
46
|
|
|
46
47
|
class SbomFormatOption(StrEnum):
|
cycode/cli/consts.py
CHANGED
|
@@ -353,6 +353,7 @@ SCAN_ERROR_STATUS_CODE = 2
|
|
|
353
353
|
LICENSE_COMPLIANCE_POLICY_ID = '8f681450-49e1-4f7e-85b7-0c8fe84b3a35'
|
|
354
354
|
PACKAGE_VULNERABILITY_POLICY_ID = '9369d10a-9ac0-48d3-9921-5de7fe9a37a7'
|
|
355
355
|
UNMAINTAINED_PACKAGE_POLICY_ID = '7b45ee1f-ee08-4353-a00a-2586db27b0f1'
|
|
356
|
+
MALICIOUS_PACKAGE_POLICY_ID = '1fe6d83a-19de-48a2-a5ba-a80fe648489b'
|
|
356
357
|
|
|
357
358
|
# Shortcut dependency paths by remove all middle dependencies
|
|
358
359
|
# between direct dependency and influence/vulnerable dependency.
|
|
@@ -4,6 +4,7 @@ from typing import TYPE_CHECKING
|
|
|
4
4
|
from cycode.cli.cli_types import SeverityOption
|
|
5
5
|
from cycode.cli.consts import (
|
|
6
6
|
LICENSE_COMPLIANCE_POLICY_ID,
|
|
7
|
+
MALICIOUS_PACKAGE_POLICY_ID,
|
|
7
8
|
PACKAGE_VULNERABILITY_POLICY_ID,
|
|
8
9
|
UNMAINTAINED_PACKAGE_POLICY_ID,
|
|
9
10
|
)
|
|
@@ -28,6 +29,7 @@ CODE_PROJECT_COLUMN = column_builder.build(name='Code Project', highlight=False)
|
|
|
28
29
|
ECOSYSTEM_COLUMN = column_builder.build(name='Ecosystem', highlight=False)
|
|
29
30
|
PACKAGE_COLUMN = column_builder.build(name='Package', highlight=False)
|
|
30
31
|
CVE_COLUMNS = column_builder.build(name='CVE', highlight=False)
|
|
32
|
+
ADVISORY_COLUMN = column_builder.build(name='Advisory', highlight=False)
|
|
31
33
|
MAINTAINED_SCORE_COLUMN = column_builder.build(name='Maintained Score', highlight=False)
|
|
32
34
|
DEPENDENCY_PATHS_COLUMN = column_builder.build(name='Dependency Paths')
|
|
33
35
|
UPGRADE_COLUMN = column_builder.build(name='Upgrade')
|
|
@@ -59,6 +61,8 @@ class ScaTablePrinter(TablePrinterBase):
|
|
|
59
61
|
return 'License Compliance'
|
|
60
62
|
if policy_id == UNMAINTAINED_PACKAGE_POLICY_ID:
|
|
61
63
|
return 'Unmaintained Packages'
|
|
64
|
+
if policy_id == MALICIOUS_PACKAGE_POLICY_ID:
|
|
65
|
+
return 'Malicious Packages'
|
|
62
66
|
|
|
63
67
|
return 'Unknown'
|
|
64
68
|
|
|
@@ -72,6 +76,8 @@ class ScaTablePrinter(TablePrinterBase):
|
|
|
72
76
|
table.add_column(LICENSE_COLUMN)
|
|
73
77
|
elif policy_id == UNMAINTAINED_PACKAGE_POLICY_ID:
|
|
74
78
|
table.add_column(MAINTAINED_SCORE_COLUMN)
|
|
79
|
+
elif policy_id == MALICIOUS_PACKAGE_POLICY_ID:
|
|
80
|
+
table.add_column(ADVISORY_COLUMN)
|
|
75
81
|
|
|
76
82
|
if is_git_diff_based_scan(self.command_scan_type):
|
|
77
83
|
table.add_column(REPOSITORY_COLUMN)
|
|
@@ -128,6 +134,7 @@ class ScaTablePrinter(TablePrinterBase):
|
|
|
128
134
|
table.add_cell(UPGRADE_COLUMN, upgrade)
|
|
129
135
|
|
|
130
136
|
table.add_cell(CVE_COLUMNS, detection_details.get('vulnerability_id'))
|
|
137
|
+
table.add_cell(ADVISORY_COLUMN, detection_details.get('threat_id') or 'N/A')
|
|
131
138
|
table.add_cell(LICENSE_COLUMN, detection_details.get('license'))
|
|
132
139
|
|
|
133
140
|
if detection.detection_type_id == UNMAINTAINED_PACKAGE_POLICY_ID:
|
|
@@ -3,6 +3,7 @@ from typing import TYPE_CHECKING
|
|
|
3
3
|
|
|
4
4
|
from cycode.cli.consts import (
|
|
5
5
|
LICENSE_COMPLIANCE_POLICY_ID,
|
|
6
|
+
MALICIOUS_PACKAGE_POLICY_ID,
|
|
6
7
|
PACKAGE_VULNERABILITY_POLICY_ID,
|
|
7
8
|
SCA_SCAN_TYPE,
|
|
8
9
|
UNMAINTAINED_PACKAGE_POLICY_ID,
|
|
@@ -40,10 +41,30 @@ def _unmaintained_package_details(detection: 'Detection') -> list[tuple[str, str
|
|
|
40
41
|
]
|
|
41
42
|
|
|
42
43
|
|
|
44
|
+
def _malicious_package_details(detection: 'Detection') -> list[tuple[str, str]]:
|
|
45
|
+
detection_details = detection.detection_details
|
|
46
|
+
|
|
47
|
+
# A MAL- id matches none of the CVE/GHSA/CWE URL shapes, so the advisory URL comes from the detection.
|
|
48
|
+
threat_id = detection_details.get('threat_id')
|
|
49
|
+
advisory_url = detection_details.get('advisory_url')
|
|
50
|
+
if not threat_id:
|
|
51
|
+
advisory = _NOT_AVAILABLE
|
|
52
|
+
elif advisory_url:
|
|
53
|
+
advisory = f'[link={advisory_url}]{threat_id}[/]'
|
|
54
|
+
else:
|
|
55
|
+
advisory = threat_id
|
|
56
|
+
|
|
57
|
+
return [
|
|
58
|
+
('Advisory', advisory),
|
|
59
|
+
('Remediation', detection_details.get('remediation_guidelines') or _NOT_AVAILABLE),
|
|
60
|
+
]
|
|
61
|
+
|
|
62
|
+
|
|
43
63
|
_DETAILS_BY_POLICY: dict[str, Callable[['Detection'], list[tuple[str, str]]]] = {
|
|
44
64
|
PACKAGE_VULNERABILITY_POLICY_ID: _package_vulnerability_details,
|
|
45
65
|
LICENSE_COMPLIANCE_POLICY_ID: _license_compliance_details,
|
|
46
66
|
UNMAINTAINED_PACKAGE_POLICY_ID: _unmaintained_package_details,
|
|
67
|
+
MALICIOUS_PACKAGE_POLICY_ID: _malicious_package_details,
|
|
47
68
|
}
|
|
48
69
|
|
|
49
70
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cycode
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.27.0
|
|
4
4
|
Summary: Boost security in your dev lifecycle via SAST, SCA, Secrets & IaC scanning.
|
|
5
5
|
License-Expression: MIT
|
|
6
6
|
License-File: LICENCE
|
|
@@ -829,7 +829,7 @@ The Cycode CLI application offers several types of scans so that you can choose
|
|
|
829
829
|
| `--show-secret BOOLEAN` | Show secrets in plain text. See [Show/Hide Secrets](#showhide-secrets) section for more details. |
|
|
830
830
|
| `--soft-fail BOOLEAN` | Run scan without failing, always return a non-error status code. See [Soft Fail](#soft-fail) section for more details. |
|
|
831
831
|
| `--severity-threshold [INFO\|LOW\|MEDIUM\|HIGH\|CRITICAL]` | Show only violations at the specified level or higher. |
|
|
832
|
-
| `--sca-scan` | Specify the SCA scan you wish to execute (`package-vulnerabilities`/`license-compliance`/`unmaintained-packages`). The default is all. |
|
|
832
|
+
| `--sca-scan` | Specify the SCA scan you wish to execute (`package-vulnerabilities`/`license-compliance`/`unmaintained-packages`/`malicious-packages`). The default is all. |
|
|
833
833
|
| `--monitor` | When specified, the scan results will be recorded in Cycode. |
|
|
834
834
|
| `--cycode-report` | Display a link to the scan report in the Cycode platform in the console output. |
|
|
835
835
|
| `--no-restore` | When specified, Cycode will not run the restore command. This will scan direct dependencies ONLY! |
|
|
@@ -921,6 +921,22 @@ In the previous example, if you wanted to only run an SCA scan on unmaintained p
|
|
|
921
921
|
|
|
922
922
|
`cycode scan -t sca --sca-scan unmaintained-packages repository ~/home/git/codebase`
|
|
923
923
|
|
|
924
|
+
#### Malicious Packages Option
|
|
925
|
+
|
|
926
|
+
> [!NOTE]
|
|
927
|
+
> This option is only available to SCA scans.
|
|
928
|
+
|
|
929
|
+
To scan only for malicious packages (dependencies that a security advisory has identified as malware rather than merely vulnerable), add the argument `--sca-scan malicious-packages` following the `-t sca` or `--scan-type sca` option.
|
|
930
|
+
|
|
931
|
+
Malicious package violations are always reported as `Critical`, and carry no CVSS score and no fix version: the only remediation is removing the dependency.
|
|
932
|
+
|
|
933
|
+
> [!NOTE]
|
|
934
|
+
> Whether malicious packages are reported at all is controlled by your organization's policy. This option narrows what a scan reports; it cannot enable a policy that is turned off for your tenant.
|
|
935
|
+
|
|
936
|
+
In the previous example, if you wanted to only run an SCA scan on malicious packages, you could execute the following:
|
|
937
|
+
|
|
938
|
+
`cycode scan -t sca --sca-scan malicious-packages repository ~/home/git/codebase`
|
|
939
|
+
|
|
924
940
|
#### Lock Restore Option
|
|
925
941
|
|
|
926
942
|
> [!NOTE]
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
cycode/__init__.py,sha256=
|
|
1
|
+
cycode/__init__.py,sha256=AXG-Z_U9-0rnX-2Z0BiyC9ERz1kYkvBeNv_lg-U-ETI,391
|
|
2
2
|
cycode/__main__.py,sha256=Z3bD5yrA7yPvAChcADQrqCaZd0ChGI1gdiwALwbWJ6U,104
|
|
3
3
|
cycode/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
4
|
cycode/cli/app.py,sha256=sI6wBHmfo7RchO9rnOXaQyUHRG9fm4r9aIduV4ZOD5c,10167
|
|
@@ -88,18 +88,18 @@ cycode/cli/apps/scan/repository/repository_command.py,sha256=KTON0Piq04P4s55AA2_
|
|
|
88
88
|
cycode/cli/apps/scan/scan_ci/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
89
89
|
cycode/cli/apps/scan/scan_ci/ci_integrations.py,sha256=3ZUv1uLsHC13KTNQ4erQKKDXAkmaSm5jow2Utwr4mCw,1634
|
|
90
90
|
cycode/cli/apps/scan/scan_ci/scan_ci_command.py,sha256=37I6YTs5UWYtbnDe1EeYZnhV1twFTDUrniZ4Sf2_6Kk,562
|
|
91
|
-
cycode/cli/apps/scan/scan_command.py,sha256=
|
|
92
|
-
cycode/cli/apps/scan/scan_parameters.py,sha256=
|
|
91
|
+
cycode/cli/apps/scan/scan_command.py,sha256=aiD1b-F6-RerAjg6RJiXI7GdyYE6HTbiq-HcN64rsQo,7991
|
|
92
|
+
cycode/cli/apps/scan/scan_parameters.py,sha256=NhIVlp-IlVzG5ss1J4hGI3sznE33DaR-Fm5JJtwxkLU,1521
|
|
93
93
|
cycode/cli/apps/scan/scan_result.py,sha256=5PGmw-6MsGsfqcClXq34DkNqMcE05QLtIxP-DD80nkE,9113
|
|
94
94
|
cycode/cli/apps/status/__init__.py,sha256=uxfkEBafO7Da0mPc1fZhwoO0RTtyXp2a5T3LJTZxubU,371
|
|
95
95
|
cycode/cli/apps/status/get_cli_status.py,sha256=1UAVyKPpYk2S8nQYshKD1x5xgWR-hCTchLChxNU0JVA,2577
|
|
96
96
|
cycode/cli/apps/status/models.py,sha256=2SBpJlh_MNCPxv8aXMV5D4GfK6-G-XB0GlMFZ3Nep_o,1907
|
|
97
97
|
cycode/cli/apps/status/status_command.py,sha256=B8YZ4hibWkjkAkikailll2lkJmCRYh9APdvZSR4L33c,1069
|
|
98
98
|
cycode/cli/apps/status/version_command.py,sha256=c6Iko_rmZo9T_kQSd3HUloBi40Qv7cjgKJNVxpMiMfE,315
|
|
99
|
-
cycode/cli/cli_types.py,sha256=
|
|
99
|
+
cycode/cli/cli_types.py,sha256=CUrFCJDz_vORdpue8bl29DiUqJkf3iiNO_gWBtUhypk,3452
|
|
100
100
|
cycode/cli/config.py,sha256=Op-lX_neanJtvPvoOEx4ByBdveh5ygElIga1FdSHhOI,299
|
|
101
101
|
cycode/cli/console.py,sha256=fsKqkOQCkvVn34Vf0XYBjXwKbK51J_Ic7mLBFUtsjzI,1901
|
|
102
|
-
cycode/cli/consts.py,sha256=
|
|
102
|
+
cycode/cli/consts.py,sha256=3vTOZeeJCwVkmUCM-a8DnU-DoD5oNrdLGHS6nbOz31c,11290
|
|
103
103
|
cycode/cli/exceptions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
104
104
|
cycode/cli/exceptions/custom_exceptions.py,sha256=Mvjfkww2mmMBBCD4OWAkSfl_9iOvi4bLTLGLBL7OdOk,5423
|
|
105
105
|
cycode/cli/exceptions/handle_ai_remediation_errors.py,sha256=mA70upSYXK3rL_fmanzKYeUzLENhpXdkW8k3aIHrKzU,785
|
|
@@ -161,7 +161,7 @@ cycode/cli/printers/json_printer.py,sha256=nOwVH10h-W5z9Xz6ZPSEj9DMDby9bzpZm-q1T
|
|
|
161
161
|
cycode/cli/printers/printer_base.py,sha256=fx-fLXNUJGJu7dlmH4t-HH4gzo5yYJCxzUD7ie2xr08,3723
|
|
162
162
|
cycode/cli/printers/rich_printer.py,sha256=qOcTkr4wUnaHx-KFKWAtx8gRdoTS8EpupWivOtFqfjA,7367
|
|
163
163
|
cycode/cli/printers/tables/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
164
|
-
cycode/cli/printers/tables/sca_table_printer.py,sha256=
|
|
164
|
+
cycode/cli/printers/tables/sca_table_printer.py,sha256=6UQLkvVN1fAKptVWA2OHiPGH2a6u4ICJKJXEXEPr-PQ,7377
|
|
165
165
|
cycode/cli/printers/tables/table.py,sha256=eu9xuZ9U525xgXqoEOEdGOYrrQZKPCkfjEdeuYU3ZF8,2557
|
|
166
166
|
cycode/cli/printers/tables/table_models.py,sha256=pEPbsMxL3JYQ77anPy1Fxtf1U0vu5NVtKiPTFBsoLUM,725
|
|
167
167
|
cycode/cli/printers/tables/table_printer.py,sha256=8lYrjX_jaQrckOe7SSdIl6_uvyGbCsWaoxym8TTfhRQ,4693
|
|
@@ -175,7 +175,7 @@ cycode/cli/printers/utils/detection_ordering/common_ordering.py,sha256=WxdDGL9Hj
|
|
|
175
175
|
cycode/cli/printers/utils/detection_ordering/sca_ordering.py,sha256=nEy9PIrApLBi1hrhKbIZ5x8XVK0LW4jsKxzax3leM7o,2315
|
|
176
176
|
cycode/cli/printers/utils/rich_helpers.py,sha256=mUd9hIgZdRp0ZKfL26NHCrGdITKb2dvVtUSrYpZicck,1079
|
|
177
177
|
cycode/cli/printers/utils/sca_ossf.py,sha256=KZRrLZAhCRJFo8aO4ldMcuCLUBUET1MJMM3hQqnPbc8,701
|
|
178
|
-
cycode/cli/printers/utils/sca_policy_details.py,sha256=
|
|
178
|
+
cycode/cli/printers/utils/sca_policy_details.py,sha256=poMGNcRfObFJyvTtK86_rmTvBlOeRJsPYMjLyFDBydQ,3103
|
|
179
179
|
cycode/cli/user_settings/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
180
180
|
cycode/cli/user_settings/base_file_manager.py,sha256=SLA5xRMTqSY-PtbeKCtVc9rP_ljxUYe3z3ZU-XE2x0w,844
|
|
181
181
|
cycode/cli/user_settings/config_file_manager.py,sha256=VszlQsWwNCX93uN4h9d7wFA9Ww1sWudMTr9IgtRuPmE,5600
|
|
@@ -224,8 +224,8 @@ cycode/cyclient/report_client.py,sha256=PaKEo6Q0GFVdpNC18vvR4uBoUX1MnllVmKkS72eA
|
|
|
224
224
|
cycode/cyclient/scan_client.py,sha256=AZ-3G9eC8Y_-jjivllP7ESPpdLds0Dkl4-KIxe5jNyE,16944
|
|
225
225
|
cycode/cyclient/scan_config_base.py,sha256=mXsPZGYCtp85rv5GIige40yQZXuRcEKUW-VQJ0vgFzk,1201
|
|
226
226
|
cycode/logger.py,sha256=OHmfkf4dnyZgfixGqkWf3js3uysrOXU_4cS8TChtAzc,2079
|
|
227
|
-
cycode-3.
|
|
228
|
-
cycode-3.
|
|
229
|
-
cycode-3.
|
|
230
|
-
cycode-3.
|
|
231
|
-
cycode-3.
|
|
227
|
+
cycode-3.27.0.dist-info/METADATA,sha256=Bji4pCYpWJeDe0KikVXKaWm0jD1k88Fs0f1E0Y7dabM,97027
|
|
228
|
+
cycode-3.27.0.dist-info/WHEEL,sha256=L-WvLdSBvJWHXv5zrQxDvNRnIgoBzLUpcbuiw19KCuQ,88
|
|
229
|
+
cycode-3.27.0.dist-info/entry_points.txt,sha256=iDcVJM8ByLElVgvBgtYxDjw1kT7O8Mo0LcWZIT5L3Ig,45
|
|
230
|
+
cycode-3.27.0.dist-info/licenses/LICENCE,sha256=2Wx4N6mD_4xB7-E3hPkZ3MPhpJy__k_I8MaCSO-PDRo,1068
|
|
231
|
+
cycode-3.27.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|