cycode 3.17.3.dev4__py3-none-any.whl → 3.17.3.dev6__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 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.17.3.dev4' # DON'T TOUCH. Placeholder. Will be filled automatically on poetry build from Git Tag
8
+ __version__ = '3.17.3.dev6' # DON'T TOUCH. Placeholder. Will be filled automatically on poetry build from Git Tag
@@ -26,6 +26,7 @@ from cycode.cli.apps.ai_guardrails.scan.utils import is_denied_path, truncate_ut
26
26
  from cycode.cli.apps.scan.code_scanner import _get_scan_documents_thread_func
27
27
  from cycode.cli.apps.scan.scan_parameters import get_scan_parameters
28
28
  from cycode.cli.cli_types import ScanTypeOption, SeverityOption
29
+ from cycode.cli.files_collector.file_excluder import is_path_configured_in_exclusions
29
30
  from cycode.cli.models import Document
30
31
  from cycode.cli.utils.progress_bar import DummyProgressBar, ScanProgressBarSection
31
32
  from cycode.cli.utils.scan_utils import build_violation_summary
@@ -337,7 +338,7 @@ def _perform_scan(
337
338
 
338
339
  scan_id = local_scan_result.scan_id
339
340
 
340
- if local_scan_result.detections_count > 0:
341
+ if local_scan_result.issue_detected:
341
342
  violation_summary = build_violation_summary([local_scan_result])
342
343
  return violation_summary, scan_id
343
344
 
@@ -360,6 +361,10 @@ def _scan_path_for_secrets(ctx: typer.Context, file_path: str, policy: dict) ->
360
361
  if not file_path or not os.path.isfile(file_path):
361
362
  return None, None
362
363
 
364
+ if is_path_configured_in_exclusions(str(ScanTypeOption.SECRET), os.path.abspath(file_path)):
365
+ logger.debug('Skipping scan; the path is in the ignore paths list, %s', {'file_path': file_path})
366
+ return None, None
367
+
363
368
  max_bytes = get_policy_value(policy, 'secrets', 'max_bytes', default=200000)
364
369
 
365
370
  with open(file_path, encoding='utf-8', errors='replace') as f:
@@ -25,7 +25,7 @@ def _is_subpath_of_cycode_configuration_folder(filename: str) -> bool:
25
25
  )
26
26
 
27
27
 
28
- def _is_path_configured_in_exclusions(scan_type: str, file_path: str) -> bool:
28
+ def is_path_configured_in_exclusions(scan_type: str, file_path: str) -> bool:
29
29
  exclusions_by_path = configuration_manager.get_exclusions_by_scan_type(scan_type).get(
30
30
  consts.EXCLUSIONS_BY_PATH_SECTION_NAME, []
31
31
  )
@@ -106,7 +106,7 @@ class Excluder:
106
106
  )
107
107
  return False
108
108
 
109
- if _is_path_configured_in_exclusions(scan_type, filename):
109
+ if is_path_configured_in_exclusions(scan_type, filename):
110
110
  logger.debug(
111
111
  'The document is irrelevant because its path is in the ignore paths list, %s', {'filename': filename}
112
112
  )
@@ -40,6 +40,9 @@ def execute_commands(
40
40
 
41
41
  for command in commands:
42
42
  command_output = shell(command=command, timeout=timeout, working_directory=working_directory)
43
+ if command_output is None: # shell returns None when the command exited non-zero
44
+ logger.debug('Restore command failed, %s', {'command': command})
45
+ return None
43
46
  if command_output:
44
47
  outputs.append(command_output)
45
48
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cycode
3
- Version: 3.17.3.dev4
3
+ Version: 3.17.3.dev6
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
@@ -1,4 +1,4 @@
1
- cycode/__init__.py,sha256=VA0uw_JcyBxIL4fAcfbi56HxYm2tdrH7pzUcUAbFpWQ,396
1
+ cycode/__init__.py,sha256=loUgwGSkPfCezzWLHc-fqG1XQ-Ur6AdPVopoJETqLLg,396
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=AlR2durAEbsa47PDfIj7JtMvJDWA_Dq6wPtVuMJYSCs,10250
@@ -18,7 +18,7 @@ cycode/cli/apps/ai_guardrails/ides/cursor.py,sha256=-Jr76dD8m2xwvb0i93LtwjaloB_o
18
18
  cycode/cli/apps/ai_guardrails/install_command.py,sha256=vGZSIvHHVMS9_zhV_6lEhxqtmr5H6uykSq4AS5nxQYw,4278
19
19
  cycode/cli/apps/ai_guardrails/scan/__init__.py,sha256=qJc82XiQGiAuc1sYY8Ij_A-qXpxgLPuayQq8xWlouMA,48
20
20
  cycode/cli/apps/ai_guardrails/scan/consts.py,sha256=drAslw6vW3kxmbCs2qPCUbUPR7PJouT2lsXtu5sD-lQ,1094
21
- cycode/cli/apps/ai_guardrails/scan/handlers.py,sha256=pf5PrUIVnGLEEE6QKPny9at5V6Ms5u2IEtFP72hKgqA,15523
21
+ cycode/cli/apps/ai_guardrails/scan/handlers.py,sha256=JDdBMFfJrd9o7Rrjv5CmwL7t8s408gIfKc-S5xe8ovA,15833
22
22
  cycode/cli/apps/ai_guardrails/scan/payload.py,sha256=pvT3UUqNMvdK3EVzzPjy4JMlOrF-WgxZ3fHN2AtN5eA,1126
23
23
  cycode/cli/apps/ai_guardrails/scan/policy.py,sha256=BZoNNdDQ9tqnfwhB4X1-bDtudaOQc_gXizm3IVwa28o,3351
24
24
  cycode/cli/apps/ai_guardrails/scan/scan_command.py,sha256=G4pJ-ctTezft55pC0-AGf4HG3gtNp_EhoTiBX1_YP7w,7088
@@ -106,7 +106,7 @@ cycode/cli/exceptions/handle_scan_errors.py,sha256=1KkBFb7LniflYRr0vMl1FPIZDALPZ
106
106
  cycode/cli/files_collector/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
107
107
  cycode/cli/files_collector/commit_range_documents.py,sha256=ZAU9er6m8_IF9y9KxZoiEaDOiZC35SEfv5VtqKp4AZc,20484
108
108
  cycode/cli/files_collector/documents_walk_ignore.py,sha256=G4e-3vfP4WZ7wa9-VbZ66xCKCioTXnPBfbrs4_hh8xY,4705
109
- cycode/cli/files_collector/file_excluder.py,sha256=YSMzmsv1qJFwOIWk6JzXLYPOd2YNHZGqf854n_DSnWI,8233
109
+ cycode/cli/files_collector/file_excluder.py,sha256=atua_L2qDbmhFXj4nB6rDqSn5--MubLGtUPSOXwXUqE,8231
110
110
  cycode/cli/files_collector/iac/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
111
111
  cycode/cli/files_collector/iac/tf_content_generator.py,sha256=a65zA0Ejv_LSA5jac2omHck4IKoNS5MX6v6ltF2wo4E,2873
112
112
  cycode/cli/files_collector/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -114,7 +114,7 @@ cycode/cli/files_collector/models/in_memory_zip.py,sha256=a56bTdOgg7E3PpWRh0ixVX
114
114
  cycode/cli/files_collector/path_documents.py,sha256=7oNLcFZFHC_3sO34iD9FaKdS6_0lCogAl-nh11ejT_w,5040
115
115
  cycode/cli/files_collector/repository_documents.py,sha256=53QQsfCzXXSV6F3EcInaN8G6aCwEVzceWiYwasG8CgM,860
116
116
  cycode/cli/files_collector/sca/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
117
- cycode/cli/files_collector/sca/base_restore_dependencies.py,sha256=hCQyjQW5hPhBwKqqssjCaFRhvSAN7Xqha0XJCaQM4Xo,6458
117
+ cycode/cli/files_collector/sca/base_restore_dependencies.py,sha256=EzW8Dt9U8eDGLC2uEhdazr4LsV7sYV4fzqBpKTH6494,6661
118
118
  cycode/cli/files_collector/sca/go/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
119
119
  cycode/cli/files_collector/sca/go/restore_go_dependencies.py,sha256=LXUjslfdHO3umz36WtQyRpKa_fVaRgEjewVkZ0QvnYU,1899
120
120
  cycode/cli/files_collector/sca/maven/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -210,8 +210,8 @@ cycode/cyclient/report_client.py,sha256=Scq30NeJPzgXv0hPLO1U05AdE9i_2iu6cIrSKpEJ
210
210
  cycode/cyclient/scan_client.py,sha256=6TK5FQkfrvV7PHqRnUzEn1PBNd2oPYVamvIixcUfe3c,16755
211
211
  cycode/cyclient/scan_config_base.py,sha256=mXsPZGYCtp85rv5GIige40yQZXuRcEKUW-VQJ0vgFzk,1201
212
212
  cycode/logger.py,sha256=EfZGRK6VC5rE_LAjIcRrHFiQCueylCDXoG6bvGkrIME,2111
213
- cycode-3.17.3.dev4.dist-info/METADATA,sha256=oXPq8qCG2UBNS4GDCmUbkVKo9pSTcopKjTETFKDwf1I,89246
214
- cycode-3.17.3.dev4.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
215
- cycode-3.17.3.dev4.dist-info/entry_points.txt,sha256=iDcVJM8ByLElVgvBgtYxDjw1kT7O8Mo0LcWZIT5L3Ig,45
216
- cycode-3.17.3.dev4.dist-info/licenses/LICENCE,sha256=2Wx4N6mD_4xB7-E3hPkZ3MPhpJy__k_I8MaCSO-PDRo,1068
217
- cycode-3.17.3.dev4.dist-info/RECORD,,
213
+ cycode-3.17.3.dev6.dist-info/METADATA,sha256=vorRsOLOIhbBpQxLmbNRJH2WRLNuX5gTUm9UcfPk7oI,89246
214
+ cycode-3.17.3.dev6.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
215
+ cycode-3.17.3.dev6.dist-info/entry_points.txt,sha256=iDcVJM8ByLElVgvBgtYxDjw1kT7O8Mo0LcWZIT5L3Ig,45
216
+ cycode-3.17.3.dev6.dist-info/licenses/LICENCE,sha256=2Wx4N6mD_4xB7-E3hPkZ3MPhpJy__k_I8MaCSO-PDRo,1068
217
+ cycode-3.17.3.dev6.dist-info/RECORD,,