cycode 3.5.2__tar.gz → 3.6.1.dev4__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.
Files changed (172) hide show
  1. cycode-3.5.2/README.md → cycode-3.6.1.dev4/PKG-INFO +85 -2
  2. cycode-3.5.2/PKG-INFO → cycode-3.6.1.dev4/README.md +41 -47
  3. cycode-3.6.1.dev4/cycode/__init__.py +1 -0
  4. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/app.py +2 -1
  5. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/apps/report/sbom/path/path_command.py +6 -1
  6. cycode-3.6.1.dev4/cycode/cli/apps/report_import/__init__.py +8 -0
  7. cycode-3.6.1.dev4/cycode/cli/apps/report_import/report_import_command.py +13 -0
  8. cycode-3.6.1.dev4/cycode/cli/apps/report_import/sbom/__init__.py +6 -0
  9. cycode-3.6.1.dev4/cycode/cli/apps/report_import/sbom/sbom_command.py +76 -0
  10. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/apps/scan/code_scanner.py +12 -2
  11. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/apps/scan/commit_range_scanner.py +43 -5
  12. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/apps/scan/repository/repository_command.py +5 -0
  13. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/apps/scan/scan_command.py +8 -1
  14. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/cli_types.py +6 -0
  15. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/consts.py +2 -0
  16. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/files_collector/commit_range_documents.py +1 -16
  17. cycode-3.6.1.dev4/cycode/cli/files_collector/documents_walk_ignore.py +124 -0
  18. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/files_collector/path_documents.py +24 -7
  19. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/files_collector/walk_ignore.py +14 -5
  20. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/utils/get_api_client.py +8 -1
  21. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/utils/scan_utils.py +7 -1
  22. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cyclient/client_creator.py +6 -0
  23. cycode-3.6.1.dev4/cycode/cyclient/import_sbom_client.py +81 -0
  24. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cyclient/models.py +40 -2
  25. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cyclient/scan_client.py +10 -3
  26. {cycode-3.5.2 → cycode-3.6.1.dev4}/pyproject.toml +15 -9
  27. cycode-3.5.2/cycode/__init__.py +0 -1
  28. {cycode-3.5.2 → cycode-3.6.1.dev4}/LICENCE +0 -0
  29. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/__main__.py +0 -0
  30. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/__init__.py +0 -0
  31. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/apps/__init__.py +0 -0
  32. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/apps/ai_remediation/__init__.py +0 -0
  33. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/apps/ai_remediation/ai_remediation_command.py +0 -0
  34. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/apps/ai_remediation/apply_fix.py +0 -0
  35. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/apps/ai_remediation/print_remediation.py +0 -0
  36. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/apps/auth/__init__.py +0 -0
  37. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/apps/auth/auth_command.py +0 -0
  38. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/apps/auth/auth_common.py +0 -0
  39. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/apps/auth/auth_manager.py +0 -0
  40. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/apps/auth/models.py +0 -0
  41. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/apps/configure/__init__.py +0 -0
  42. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/apps/configure/configure_command.py +0 -0
  43. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/apps/configure/consts.py +0 -0
  44. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/apps/configure/messages.py +0 -0
  45. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/apps/configure/prompts.py +0 -0
  46. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/apps/ignore/__init__.py +0 -0
  47. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/apps/ignore/ignore_command.py +0 -0
  48. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/apps/mcp/__init__.py +0 -0
  49. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/apps/mcp/mcp_command.py +0 -0
  50. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/apps/report/__init__.py +0 -0
  51. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/apps/report/report_command.py +0 -0
  52. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/apps/report/sbom/__init__.py +0 -0
  53. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/apps/report/sbom/common.py +0 -0
  54. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/apps/report/sbom/path/__init__.py +0 -0
  55. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/apps/report/sbom/repository_url/__init__.py +0 -0
  56. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/apps/report/sbom/repository_url/repository_url_command.py +0 -0
  57. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/apps/report/sbom/sbom_command.py +0 -0
  58. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/apps/report/sbom/sbom_report_file.py +0 -0
  59. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/apps/scan/__init__.py +0 -0
  60. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/apps/scan/aggregation_report.py +0 -0
  61. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/apps/scan/commit_history/__init__.py +0 -0
  62. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/apps/scan/commit_history/commit_history_command.py +0 -0
  63. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/apps/scan/detection_excluder.py +0 -0
  64. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/apps/scan/path/__init__.py +0 -0
  65. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/apps/scan/path/path_command.py +0 -0
  66. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/apps/scan/pre_commit/__init__.py +0 -0
  67. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/apps/scan/pre_commit/pre_commit_command.py +0 -0
  68. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/apps/scan/pre_push/__init__.py +0 -0
  69. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/apps/scan/pre_push/pre_push_command.py +0 -0
  70. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/apps/scan/pre_receive/__init__.py +0 -0
  71. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/apps/scan/pre_receive/pre_receive_command.py +0 -0
  72. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/apps/scan/remote_url_resolver.py +0 -0
  73. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/apps/scan/repository/__init__.py +0 -0
  74. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/apps/scan/scan_ci/__init__.py +0 -0
  75. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/apps/scan/scan_ci/ci_integrations.py +0 -0
  76. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/apps/scan/scan_ci/scan_ci_command.py +0 -0
  77. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/apps/scan/scan_parameters.py +0 -0
  78. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/apps/scan/scan_result.py +0 -0
  79. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/apps/status/__init__.py +0 -0
  80. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/apps/status/get_cli_status.py +0 -0
  81. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/apps/status/models.py +0 -0
  82. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/apps/status/status_command.py +0 -0
  83. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/apps/status/version_command.py +0 -0
  84. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/config.py +0 -0
  85. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/console.py +0 -0
  86. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/exceptions/__init__.py +0 -0
  87. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/exceptions/custom_exceptions.py +0 -0
  88. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/exceptions/handle_ai_remediation_errors.py +0 -0
  89. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/exceptions/handle_auth_errors.py +0 -0
  90. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/exceptions/handle_errors.py +0 -0
  91. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/exceptions/handle_report_sbom_errors.py +0 -0
  92. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/exceptions/handle_scan_errors.py +0 -0
  93. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/files_collector/__init__.py +0 -0
  94. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/files_collector/file_excluder.py +0 -0
  95. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/files_collector/iac/__init__.py +0 -0
  96. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/files_collector/iac/tf_content_generator.py +0 -0
  97. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/files_collector/models/__init__.py +0 -0
  98. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/files_collector/models/in_memory_zip.py +0 -0
  99. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/files_collector/repository_documents.py +0 -0
  100. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/files_collector/sca/__init__.py +0 -0
  101. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/files_collector/sca/base_restore_dependencies.py +0 -0
  102. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/files_collector/sca/go/__init__.py +0 -0
  103. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/files_collector/sca/go/restore_go_dependencies.py +0 -0
  104. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/files_collector/sca/maven/__init__.py +0 -0
  105. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/files_collector/sca/maven/restore_gradle_dependencies.py +0 -0
  106. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/files_collector/sca/maven/restore_maven_dependencies.py +0 -0
  107. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/files_collector/sca/npm/__init__.py +0 -0
  108. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/files_collector/sca/npm/restore_npm_dependencies.py +0 -0
  109. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/files_collector/sca/nuget/__init__.py +0 -0
  110. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/files_collector/sca/nuget/restore_nuget_dependencies.py +0 -0
  111. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/files_collector/sca/ruby/__init__.py +0 -0
  112. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/files_collector/sca/ruby/restore_ruby_dependencies.py +0 -0
  113. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/files_collector/sca/sbt/__init__.py +0 -0
  114. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/files_collector/sca/sbt/restore_sbt_dependencies.py +0 -0
  115. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/files_collector/sca/sca_file_collector.py +0 -0
  116. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/files_collector/zip_documents.py +0 -0
  117. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/logger.py +0 -0
  118. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/main.py +0 -0
  119. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/models.py +0 -0
  120. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/printers/__init__.py +0 -0
  121. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/printers/console_printer.py +0 -0
  122. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/printers/json_printer.py +0 -0
  123. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/printers/printer_base.py +0 -0
  124. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/printers/rich_printer.py +0 -0
  125. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/printers/tables/__init__.py +0 -0
  126. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/printers/tables/sca_table_printer.py +0 -0
  127. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/printers/tables/table.py +0 -0
  128. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/printers/tables/table_models.py +0 -0
  129. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/printers/tables/table_printer.py +0 -0
  130. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/printers/tables/table_printer_base.py +0 -0
  131. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/printers/text_printer.py +0 -0
  132. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/printers/utils/__init__.py +0 -0
  133. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/printers/utils/code_snippet_syntax.py +0 -0
  134. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/printers/utils/detection_data.py +0 -0
  135. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/printers/utils/detection_ordering/__init__.py +0 -0
  136. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/printers/utils/detection_ordering/common_ordering.py +0 -0
  137. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/printers/utils/detection_ordering/sca_ordering.py +0 -0
  138. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/printers/utils/rich_helpers.py +0 -0
  139. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/user_settings/__init__.py +0 -0
  140. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/user_settings/base_file_manager.py +0 -0
  141. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/user_settings/config_file_manager.py +0 -0
  142. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/user_settings/configuration_manager.py +0 -0
  143. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/user_settings/credentials_manager.py +0 -0
  144. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/user_settings/jwt_creator.py +0 -0
  145. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/utils/__init__.py +0 -0
  146. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/utils/enum_utils.py +0 -0
  147. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/utils/git_proxy.py +0 -0
  148. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/utils/ignore_utils.py +0 -0
  149. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/utils/jwt_utils.py +0 -0
  150. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/utils/path_utils.py +0 -0
  151. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/utils/progress_bar.py +0 -0
  152. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/utils/scan_batch.py +0 -0
  153. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/utils/sentry.py +0 -0
  154. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/utils/shell_executor.py +0 -0
  155. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/utils/string_utils.py +0 -0
  156. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/utils/task_timer.py +0 -0
  157. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/utils/version_checker.py +0 -0
  158. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cli/utils/yaml_utils.py +0 -0
  159. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/config.py +0 -0
  160. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cyclient/__init__.py +0 -0
  161. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cyclient/auth_client.py +0 -0
  162. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cyclient/config.py +0 -0
  163. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cyclient/config_dev.py +0 -0
  164. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cyclient/cycode_client.py +0 -0
  165. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cyclient/cycode_client_base.py +0 -0
  166. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cyclient/cycode_dev_based_client.py +0 -0
  167. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cyclient/cycode_token_based_client.py +0 -0
  168. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cyclient/headers.py +0 -0
  169. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cyclient/logger.py +0 -0
  170. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cyclient/report_client.py +0 -0
  171. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/cyclient/scan_config_base.py +0 -0
  172. {cycode-3.5.2 → cycode-3.6.1.dev4}/cycode/logger.py +0 -0
@@ -1,3 +1,46 @@
1
+ Metadata-Version: 2.4
2
+ Name: cycode
3
+ Version: 3.6.1.dev4
4
+ Summary: Boost security in your dev lifecycle via SAST, SCA, Secrets & IaC scanning.
5
+ License-Expression: MIT
6
+ License-File: LICENCE
7
+ Keywords: secret-scan,cycode,devops,token,secret,security,code
8
+ Author: Cycode
9
+ Author-email: support@cycode.com
10
+ Requires-Python: >=3.9
11
+ Classifier: Development Status :: 5 - Production/Stable
12
+ Classifier: Environment :: Console
13
+ Classifier: Natural Language :: English
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python
16
+ Classifier: Programming Language :: Python :: 3 :: Only
17
+ Classifier: Programming Language :: Python :: 3.9
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Programming Language :: Python :: 3.14
23
+ Requires-Dist: arrow (>=1.0.0,<1.4.0)
24
+ Requires-Dist: binaryornot (>=0.4.4,<0.5.0)
25
+ Requires-Dist: click (>=8.1.0,<8.2.0)
26
+ Requires-Dist: colorama (>=0.4.3,<0.5.0)
27
+ Requires-Dist: gitpython (>=3.1.30,<3.2.0)
28
+ Requires-Dist: marshmallow (>=3.15.0,<3.23.0)
29
+ Requires-Dist: mcp (>=1.9.3,<2.0.0) ; python_version >= "3.10"
30
+ Requires-Dist: patch-ng (==1.18.1)
31
+ Requires-Dist: pathvalidate (>=3.3.1,<4.0.0)
32
+ Requires-Dist: pydantic (>=2.11.5,<3.0.0)
33
+ Requires-Dist: pyjwt (>=2.8.0,<3.0)
34
+ Requires-Dist: pyyaml (>=6.0,<7.0)
35
+ Requires-Dist: requests (>=2.32.4,<3.0)
36
+ Requires-Dist: rich (>=13.9.4,<14)
37
+ Requires-Dist: sentry-sdk (>=2.8.0,<3.0)
38
+ Requires-Dist: tenacity (>=9.0.0,<9.1.0)
39
+ Requires-Dist: typer (>=0.15.3,<0.16.0)
40
+ Requires-Dist: urllib3 (==1.26.19)
41
+ Project-URL: Repository, https://github.com/cycodehq/cycode-cli
42
+ Description-Content-Type: text/markdown
43
+
1
44
  # Cycode CLI User Guide
2
45
 
3
46
  The Cycode Command Line Interface (CLI) is an application you can install locally to scan your repositories for secrets, infrastructure as code misconfigurations, software composition analysis vulnerabilities, and static application security testing issues.
@@ -56,8 +99,9 @@ This guide walks you through both installation and usage.
56
99
  6. [Ignoring via a config file](#ignoring-via-a-config-file)
57
100
  6. [Report command](#report-command)
58
101
  1. [Generating SBOM Report](#generating-sbom-report)
59
- 7. [Scan logs](#scan-logs)
60
- 8. [Syntax Help](#syntax-help)
102
+ 7. [Import command](#import-command)
103
+ 8. [Scan logs](#scan-logs)
104
+ 9. [Syntax Help](#syntax-help)
61
105
 
62
106
  # Prerequisites
63
107
 
@@ -917,6 +961,24 @@ git push --no-verify
917
961
  > [!TIP]
918
962
  > The pre-push hook is triggered on `git push` command and scans only the commits that are about to be pushed, making it more efficient than scanning the entire repository.
919
963
 
964
+ ## Exclude Paths From Scans
965
+ You can use a `.cycodeignore` file to tell the Cycode CLI which files and directories to exclude from scans.
966
+ It works just like a `.gitignore` file. This helps you focus scans on your relevant code and prevent certain paths from triggering violations locally.
967
+
968
+ ### How It Works
969
+ 1. Create a file named `.cycodeignore` in your workfolder.
970
+ 2. List the files and directories you want to exclude, using the same patterns as `.gitignore`.
971
+ 3. Place this file in the directory where you plan to run the cycode scan command.
972
+
973
+ > [!WARNING]
974
+ > - **Invalid files**: If the `.cycodeignore` file contains a syntax error, the CLI scan will fail and return an error.
975
+ > - **Ignoring paths vs. violations**: This file is for excluding paths. It's different from the CLI's capability to ignore specific violations (for example, by using the --ignore-violation flag).
976
+
977
+ ### Supported Scanners
978
+ - SAST
979
+ - IaC (comming soon)
980
+ - SCA (comming soon)
981
+
920
982
  ## Scan Results
921
983
 
922
984
  Each scan will complete with a message stating if any issues were found or not.
@@ -1277,6 +1339,26 @@ To create an SBOM report for a path:\
1277
1339
  For example:\
1278
1340
  `cycode report sbom --format spdx-2.3 --include-vulnerabilities --include-dev-dependencies path /path/to/local/project`
1279
1341
 
1342
+ # Import Command
1343
+
1344
+ ## Importing SBOM
1345
+
1346
+ A software bill of materials (SBOM) is an inventory of all constituent components and software dependencies involved in the development and delivery of an application.
1347
+ Using this command, you can import an SBOM file from your file system into Cycode.
1348
+
1349
+ The following options are available for use with this command:
1350
+
1351
+ | Option | Description | Required | Default |
1352
+ |----------------------------------------------------|--------------------------------------------|----------|-------------------------------------------------------|
1353
+ | `-n, --name TEXT` | Display name of the SBOM | Yes | |
1354
+ | `-v, --vendor TEXT` | Name of the entity that provided the SBOM | Yes | |
1355
+ | `-l, --label TEXT` | Attach label to the SBOM | No | |
1356
+ | `-o, --owner TEXT` | Email address of the Cycode user that serves as point of contact for this SBOM | No | |
1357
+ | `-b, --business-impact [High \| Medium \| Low]` | Business Impact | No | Medium |
1358
+
1359
+ For example:\
1360
+ `cycode import sbom --name example-sbom --vendor cycode -label tag1 -label tag2 --owner example@cycode.com /path/to/local/project`
1361
+
1280
1362
  # Scan Logs
1281
1363
 
1282
1364
  All CLI scans are logged in Cycode. The logs can be found under Settings > CLI Logs.
@@ -1312,3 +1394,4 @@ To see the options available for a report, use this command:
1312
1394
  To see the options available for a specific type of report, enter:
1313
1395
 
1314
1396
  `cycode scan {{option}} --help`
1397
+
@@ -1,47 +1,3 @@
1
- Metadata-Version: 2.1
2
- Name: cycode
3
- Version: 3.5.2
4
- Summary: Boost security in your dev lifecycle via SAST, SCA, Secrets & IaC scanning.
5
- Home-page: https://github.com/cycodehq/cycode-cli
6
- License: MIT
7
- Keywords: secret-scan,cycode,devops,token,secret,security,cycode,code
8
- Author: Cycode
9
- Author-email: support@cycode.com
10
- Requires-Python: >=3.9,<3.14
11
- Classifier: Development Status :: 5 - Production/Stable
12
- Classifier: Environment :: Console
13
- Classifier: License :: OSI Approved :: MIT License
14
- Classifier: Natural Language :: English
15
- Classifier: Operating System :: OS Independent
16
- Classifier: Programming Language :: Python
17
- Classifier: Programming Language :: Python :: 3
18
- Classifier: Programming Language :: Python :: 3.9
19
- Classifier: Programming Language :: Python :: 3.10
20
- Classifier: Programming Language :: Python :: 3.11
21
- Classifier: Programming Language :: Python :: 3.12
22
- Classifier: Programming Language :: Python :: 3 :: Only
23
- Classifier: Programming Language :: Python :: 3.13
24
- Requires-Dist: arrow (>=1.0.0,<1.4.0)
25
- Requires-Dist: binaryornot (>=0.4.4,<0.5.0)
26
- Requires-Dist: click (>=8.1.0,<8.2.0)
27
- Requires-Dist: colorama (>=0.4.3,<0.5.0)
28
- Requires-Dist: gitpython (>=3.1.30,<3.2.0)
29
- Requires-Dist: marshmallow (>=3.15.0,<3.23.0)
30
- Requires-Dist: mcp (>=1.9.3,<2.0.0) ; python_version >= "3.10"
31
- Requires-Dist: patch-ng (==1.18.1)
32
- Requires-Dist: pathvalidate (>=3.3.1,<4.0.0)
33
- Requires-Dist: pydantic (>=2.11.5,<3.0.0)
34
- Requires-Dist: pyjwt (>=2.8.0,<3.0)
35
- Requires-Dist: pyyaml (>=6.0,<7.0)
36
- Requires-Dist: requests (>=2.32.4,<3.0)
37
- Requires-Dist: rich (>=13.9.4,<14)
38
- Requires-Dist: sentry-sdk (>=2.8.0,<3.0)
39
- Requires-Dist: tenacity (>=9.0.0,<9.1.0)
40
- Requires-Dist: typer (>=0.15.3,<0.16.0)
41
- Requires-Dist: urllib3 (==1.26.19)
42
- Project-URL: Repository, https://github.com/cycodehq/cycode-cli
43
- Description-Content-Type: text/markdown
44
-
45
1
  # Cycode CLI User Guide
46
2
 
47
3
  The Cycode Command Line Interface (CLI) is an application you can install locally to scan your repositories for secrets, infrastructure as code misconfigurations, software composition analysis vulnerabilities, and static application security testing issues.
@@ -100,8 +56,9 @@ This guide walks you through both installation and usage.
100
56
  6. [Ignoring via a config file](#ignoring-via-a-config-file)
101
57
  6. [Report command](#report-command)
102
58
  1. [Generating SBOM Report](#generating-sbom-report)
103
- 7. [Scan logs](#scan-logs)
104
- 8. [Syntax Help](#syntax-help)
59
+ 7. [Import command](#import-command)
60
+ 8. [Scan logs](#scan-logs)
61
+ 9. [Syntax Help](#syntax-help)
105
62
 
106
63
  # Prerequisites
107
64
 
@@ -961,6 +918,24 @@ git push --no-verify
961
918
  > [!TIP]
962
919
  > The pre-push hook is triggered on `git push` command and scans only the commits that are about to be pushed, making it more efficient than scanning the entire repository.
963
920
 
921
+ ## Exclude Paths From Scans
922
+ You can use a `.cycodeignore` file to tell the Cycode CLI which files and directories to exclude from scans.
923
+ It works just like a `.gitignore` file. This helps you focus scans on your relevant code and prevent certain paths from triggering violations locally.
924
+
925
+ ### How It Works
926
+ 1. Create a file named `.cycodeignore` in your workfolder.
927
+ 2. List the files and directories you want to exclude, using the same patterns as `.gitignore`.
928
+ 3. Place this file in the directory where you plan to run the cycode scan command.
929
+
930
+ > [!WARNING]
931
+ > - **Invalid files**: If the `.cycodeignore` file contains a syntax error, the CLI scan will fail and return an error.
932
+ > - **Ignoring paths vs. violations**: This file is for excluding paths. It's different from the CLI's capability to ignore specific violations (for example, by using the --ignore-violation flag).
933
+
934
+ ### Supported Scanners
935
+ - SAST
936
+ - IaC (comming soon)
937
+ - SCA (comming soon)
938
+
964
939
  ## Scan Results
965
940
 
966
941
  Each scan will complete with a message stating if any issues were found or not.
@@ -1321,6 +1296,26 @@ To create an SBOM report for a path:\
1321
1296
  For example:\
1322
1297
  `cycode report sbom --format spdx-2.3 --include-vulnerabilities --include-dev-dependencies path /path/to/local/project`
1323
1298
 
1299
+ # Import Command
1300
+
1301
+ ## Importing SBOM
1302
+
1303
+ A software bill of materials (SBOM) is an inventory of all constituent components and software dependencies involved in the development and delivery of an application.
1304
+ Using this command, you can import an SBOM file from your file system into Cycode.
1305
+
1306
+ The following options are available for use with this command:
1307
+
1308
+ | Option | Description | Required | Default |
1309
+ |----------------------------------------------------|--------------------------------------------|----------|-------------------------------------------------------|
1310
+ | `-n, --name TEXT` | Display name of the SBOM | Yes | |
1311
+ | `-v, --vendor TEXT` | Name of the entity that provided the SBOM | Yes | |
1312
+ | `-l, --label TEXT` | Attach label to the SBOM | No | |
1313
+ | `-o, --owner TEXT` | Email address of the Cycode user that serves as point of contact for this SBOM | No | |
1314
+ | `-b, --business-impact [High \| Medium \| Low]` | Business Impact | No | Medium |
1315
+
1316
+ For example:\
1317
+ `cycode import sbom --name example-sbom --vendor cycode -label tag1 -label tag2 --owner example@cycode.com /path/to/local/project`
1318
+
1324
1319
  # Scan Logs
1325
1320
 
1326
1321
  All CLI scans are logged in Cycode. The logs can be found under Settings > CLI Logs.
@@ -1356,4 +1351,3 @@ To see the options available for a report, use this command:
1356
1351
  To see the options available for a specific type of report, enter:
1357
1352
 
1358
1353
  `cycode scan {{option}} --help`
1359
-
@@ -0,0 +1 @@
1
+ __version__ = '3.6.1.dev4' # DON'T TOUCH. Placeholder. Will be filled automatically on poetry build from Git Tag
@@ -9,7 +9,7 @@ from typer._completion_shared import Shells
9
9
  from typer.completion import install_callback, show_callback
10
10
 
11
11
  from cycode import __version__
12
- from cycode.cli.apps import ai_remediation, auth, configure, ignore, report, scan, status
12
+ from cycode.cli.apps import ai_remediation, auth, configure, ignore, report, report_import, scan, status
13
13
 
14
14
  if sys.version_info >= (3, 10):
15
15
  from cycode.cli.apps import mcp
@@ -50,6 +50,7 @@ app.add_typer(auth.app)
50
50
  app.add_typer(configure.app)
51
51
  app.add_typer(ignore.app)
52
52
  app.add_typer(report.app)
53
+ app.add_typer(report_import.app)
53
54
  app.add_typer(scan.app)
54
55
  app.add_typer(status.app)
55
56
  if sys.version_info >= (3, 10):
@@ -12,6 +12,7 @@ from cycode.cli.files_collector.sca.sca_file_collector import add_sca_dependenci
12
12
  from cycode.cli.files_collector.zip_documents import zip_documents
13
13
  from cycode.cli.utils.get_api_client import get_report_cycode_client
14
14
  from cycode.cli.utils.progress_bar import SbomReportProgressBarSection
15
+ from cycode.cli.utils.scan_utils import is_cycodeignore_allowed_by_scan_config
15
16
  from cycode.cli.utils.sentry import add_breadcrumb
16
17
 
17
18
 
@@ -37,7 +38,11 @@ def path_command(
37
38
 
38
39
  try:
39
40
  documents = get_relevant_documents(
40
- progress_bar, SbomReportProgressBarSection.PREPARE_LOCAL_FILES, consts.SCA_SCAN_TYPE, (str(path),)
41
+ progress_bar,
42
+ SbomReportProgressBarSection.PREPARE_LOCAL_FILES,
43
+ consts.SCA_SCAN_TYPE,
44
+ (str(path),),
45
+ is_cycodeignore_allowed=is_cycodeignore_allowed_by_scan_config(ctx),
41
46
  )
42
47
  # TODO(MarshalX): combine perform_pre_scan_documents_actions with get_relevant_document.
43
48
  # unhardcode usage of context in perform_pre_scan_documents_actions
@@ -0,0 +1,8 @@
1
+ import typer
2
+
3
+ from cycode.cli.apps.report_import.report_import_command import report_import_command
4
+ from cycode.cli.apps.report_import.sbom import sbom_command
5
+
6
+ app = typer.Typer(name='import', no_args_is_help=True)
7
+ app.callback(short_help='Import report. You`ll need to specify which report type to import.')(report_import_command)
8
+ app.command(name='sbom', short_help='Import SBOM report from a local path.')(sbom_command)
@@ -0,0 +1,13 @@
1
+ import typer
2
+
3
+ from cycode.cli.utils.sentry import add_breadcrumb
4
+
5
+
6
+ def report_import_command(ctx: typer.Context) -> int:
7
+ """:bar_chart: [bold cyan]Import security reports.[/]
8
+
9
+ Example usage:
10
+ * `cycode import sbom`: Import SBOM report
11
+ """
12
+ add_breadcrumb('import')
13
+ return 1
@@ -0,0 +1,6 @@
1
+ import typer
2
+
3
+ from cycode.cli.apps.report_import.sbom.sbom_command import sbom_command
4
+
5
+ app = typer.Typer(name='sbom')
6
+ app.command(name='path', short_help='Import SBOM report from a local path.')(sbom_command)
@@ -0,0 +1,76 @@
1
+ from pathlib import Path
2
+ from typing import Annotated, Optional
3
+
4
+ import typer
5
+
6
+ from cycode.cli.cli_types import BusinessImpactOption
7
+ from cycode.cli.exceptions.handle_report_sbom_errors import handle_report_exception
8
+ from cycode.cli.utils.get_api_client import get_import_sbom_cycode_client
9
+ from cycode.cli.utils.sentry import add_breadcrumb
10
+ from cycode.cyclient.import_sbom_client import ImportSbomParameters
11
+
12
+
13
+ def sbom_command(
14
+ ctx: typer.Context,
15
+ path: Annotated[
16
+ Path,
17
+ typer.Argument(
18
+ exists=True, resolve_path=True, dir_okay=False, readable=True, help='Path to SBOM file.', show_default=False
19
+ ),
20
+ ],
21
+ sbom_name: Annotated[
22
+ str, typer.Option('--name', '-n', help='SBOM Name.', case_sensitive=False, show_default=False)
23
+ ],
24
+ vendor: Annotated[
25
+ str, typer.Option('--vendor', '-v', help='Vendor Name.', case_sensitive=False, show_default=False)
26
+ ],
27
+ labels: Annotated[
28
+ Optional[list[str]],
29
+ typer.Option(
30
+ '--label', '-l', help='Label, can be specified multiple times.', case_sensitive=False, show_default=False
31
+ ),
32
+ ] = None,
33
+ owners: Annotated[
34
+ Optional[list[str]],
35
+ typer.Option(
36
+ '--owner',
37
+ '-o',
38
+ help='Email address of a user in Cycode platform, can be specified multiple times.',
39
+ case_sensitive=True,
40
+ show_default=False,
41
+ ),
42
+ ] = None,
43
+ business_impact: Annotated[
44
+ BusinessImpactOption,
45
+ typer.Option(
46
+ '--business-impact',
47
+ '-b',
48
+ help='Business Impact.',
49
+ case_sensitive=True,
50
+ show_default=True,
51
+ ),
52
+ ] = BusinessImpactOption.MEDIUM,
53
+ ) -> None:
54
+ """Import SBOM."""
55
+ add_breadcrumb('sbom')
56
+
57
+ client = get_import_sbom_cycode_client(ctx)
58
+
59
+ import_parameters = ImportSbomParameters(
60
+ Name=sbom_name,
61
+ Vendor=vendor,
62
+ BusinessImpact=business_impact,
63
+ Labels=labels,
64
+ Owners=owners,
65
+ )
66
+
67
+ try:
68
+ if not path.exists():
69
+ from errno import ENOENT
70
+ from os import strerror
71
+
72
+ raise FileNotFoundError(ENOENT, strerror(ENOENT), path.absolute())
73
+
74
+ client.request_sbom_import_execution(import_parameters, path)
75
+ except Exception as e:
76
+ handle_report_exception(ctx, e)
@@ -23,7 +23,11 @@ from cycode.cli.files_collector.zip_documents import zip_documents
23
23
  from cycode.cli.models import CliError, Document, LocalScanResult
24
24
  from cycode.cli.utils.progress_bar import ScanProgressBarSection
25
25
  from cycode.cli.utils.scan_batch import run_parallel_batched_scan
26
- from cycode.cli.utils.scan_utils import generate_unique_scan_id, set_issue_detected_by_scan_results
26
+ from cycode.cli.utils.scan_utils import (
27
+ generate_unique_scan_id,
28
+ is_cycodeignore_allowed_by_scan_config,
29
+ set_issue_detected_by_scan_results,
30
+ )
27
31
  from cycode.cyclient.models import ZippedFileScanResult
28
32
  from cycode.logger import get_logger
29
33
 
@@ -42,7 +46,13 @@ def scan_disk_files(ctx: typer.Context, paths: tuple[str, ...]) -> None:
42
46
  progress_bar = ctx.obj['progress_bar']
43
47
 
44
48
  try:
45
- documents = get_relevant_documents(progress_bar, ScanProgressBarSection.PREPARE_LOCAL_FILES, scan_type, paths)
49
+ documents = get_relevant_documents(
50
+ progress_bar,
51
+ ScanProgressBarSection.PREPARE_LOCAL_FILES,
52
+ scan_type,
53
+ paths,
54
+ is_cycodeignore_allowed=is_cycodeignore_allowed_by_scan_config(ctx),
55
+ )
46
56
  add_sca_dependencies_tree_documents_if_needed(ctx, scan_type, documents)
47
57
  scan_documents(ctx, documents, get_scan_parameters(ctx, paths))
48
58
  except Exception as e:
@@ -26,9 +26,9 @@ from cycode.cli.files_collector.commit_range_documents import (
26
26
  get_diff_file_path,
27
27
  get_pre_commit_modified_documents,
28
28
  get_safe_head_reference_for_diff,
29
- parse_commit_range_sast,
30
- parse_commit_range_sca,
29
+ parse_commit_range,
31
30
  )
31
+ from cycode.cli.files_collector.documents_walk_ignore import filter_documents_with_cycodeignore
32
32
  from cycode.cli.files_collector.file_excluder import excluder
33
33
  from cycode.cli.files_collector.models.in_memory_zip import InMemoryZip
34
34
  from cycode.cli.files_collector.sca.sca_file_collector import (
@@ -40,7 +40,11 @@ from cycode.cli.models import Document
40
40
  from cycode.cli.utils.git_proxy import git_proxy
41
41
  from cycode.cli.utils.path_utils import get_path_by_os
42
42
  from cycode.cli.utils.progress_bar import ScanProgressBarSection
43
- from cycode.cli.utils.scan_utils import generate_unique_scan_id, set_issue_detected_by_scan_results
43
+ from cycode.cli.utils.scan_utils import (
44
+ generate_unique_scan_id,
45
+ is_cycodeignore_allowed_by_scan_config,
46
+ set_issue_detected_by_scan_results,
47
+ )
44
48
  from cycode.cyclient.models import ZippedFileScanResult
45
49
  from cycode.logger import get_logger
46
50
 
@@ -182,13 +186,19 @@ def _scan_commit_range_documents(
182
186
  def _scan_sca_commit_range(ctx: typer.Context, repo_path: str, commit_range: str, **_) -> None:
183
187
  scan_parameters = get_scan_parameters(ctx, (repo_path,))
184
188
 
185
- from_commit_rev, to_commit_rev = parse_commit_range_sca(commit_range, repo_path)
189
+ from_commit_rev, to_commit_rev = parse_commit_range(commit_range, repo_path)
186
190
  from_commit_documents, to_commit_documents, _ = get_commit_range_modified_documents(
187
191
  ctx.obj['progress_bar'], ScanProgressBarSection.PREPARE_LOCAL_FILES, repo_path, from_commit_rev, to_commit_rev
188
192
  )
189
193
  from_commit_documents = excluder.exclude_irrelevant_documents_to_scan(consts.SCA_SCAN_TYPE, from_commit_documents)
190
194
  to_commit_documents = excluder.exclude_irrelevant_documents_to_scan(consts.SCA_SCAN_TYPE, to_commit_documents)
191
195
 
196
+ is_cycodeignore_allowed = is_cycodeignore_allowed_by_scan_config(ctx)
197
+ from_commit_documents = filter_documents_with_cycodeignore(
198
+ from_commit_documents, repo_path, is_cycodeignore_allowed
199
+ )
200
+ to_commit_documents = filter_documents_with_cycodeignore(to_commit_documents, repo_path, is_cycodeignore_allowed)
201
+
192
202
  perform_sca_pre_commit_range_scan_actions(
193
203
  repo_path, from_commit_documents, from_commit_rev, to_commit_documents, to_commit_rev
194
204
  )
@@ -204,6 +214,11 @@ def _scan_secret_commit_range(
204
214
  consts.SECRET_SCAN_TYPE, commit_diff_documents_to_scan
205
215
  )
206
216
 
217
+ is_cycodeignore_allowed = is_cycodeignore_allowed_by_scan_config(ctx)
218
+ diff_documents_to_scan = filter_documents_with_cycodeignore(
219
+ diff_documents_to_scan, repo_path, is_cycodeignore_allowed
220
+ )
221
+
207
222
  scan_documents(
208
223
  ctx, diff_documents_to_scan, get_scan_parameters(ctx, (repo_path,)), is_git_diff=True, is_commit_range=True
209
224
  )
@@ -212,7 +227,7 @@ def _scan_secret_commit_range(
212
227
  def _scan_sast_commit_range(ctx: typer.Context, repo_path: str, commit_range: str, **_) -> None:
213
228
  scan_parameters = get_scan_parameters(ctx, (repo_path,))
214
229
 
215
- from_commit_rev, to_commit_rev = parse_commit_range_sast(commit_range, repo_path)
230
+ from_commit_rev, to_commit_rev = parse_commit_range(commit_range, repo_path)
216
231
  _, commit_documents, diff_documents = get_commit_range_modified_documents(
217
232
  ctx.obj['progress_bar'],
218
233
  ScanProgressBarSection.PREPARE_LOCAL_FILES,
@@ -221,9 +236,14 @@ def _scan_sast_commit_range(ctx: typer.Context, repo_path: str, commit_range: st
221
236
  to_commit_rev,
222
237
  reverse_diff=False,
223
238
  )
239
+
224
240
  commit_documents = excluder.exclude_irrelevant_documents_to_scan(consts.SAST_SCAN_TYPE, commit_documents)
225
241
  diff_documents = excluder.exclude_irrelevant_documents_to_scan(consts.SAST_SCAN_TYPE, diff_documents)
226
242
 
243
+ is_cycodeignore_allowed = is_cycodeignore_allowed_by_scan_config(ctx)
244
+ commit_documents = filter_documents_with_cycodeignore(commit_documents, repo_path, is_cycodeignore_allowed)
245
+ diff_documents = filter_documents_with_cycodeignore(diff_documents, repo_path, is_cycodeignore_allowed)
246
+
227
247
  _scan_commit_range_documents(ctx, commit_documents, diff_documents, scan_parameters=scan_parameters)
228
248
 
229
249
 
@@ -254,11 +274,18 @@ def _scan_sca_pre_commit(ctx: typer.Context, repo_path: str) -> None:
254
274
  progress_bar_section=ScanProgressBarSection.PREPARE_LOCAL_FILES,
255
275
  repo_path=repo_path,
256
276
  )
277
+
257
278
  git_head_documents = excluder.exclude_irrelevant_documents_to_scan(consts.SCA_SCAN_TYPE, git_head_documents)
258
279
  pre_committed_documents = excluder.exclude_irrelevant_documents_to_scan(
259
280
  consts.SCA_SCAN_TYPE, pre_committed_documents
260
281
  )
261
282
 
283
+ is_cycodeignore_allowed = is_cycodeignore_allowed_by_scan_config(ctx)
284
+ git_head_documents = filter_documents_with_cycodeignore(git_head_documents, repo_path, is_cycodeignore_allowed)
285
+ pre_committed_documents = filter_documents_with_cycodeignore(
286
+ pre_committed_documents, repo_path, is_cycodeignore_allowed
287
+ )
288
+
262
289
  perform_sca_pre_hook_range_scan_actions(repo_path, git_head_documents, pre_committed_documents)
263
290
 
264
291
  _scan_commit_range_documents(
@@ -288,8 +315,12 @@ def _scan_secret_pre_commit(ctx: typer.Context, repo_path: str) -> None:
288
315
  is_git_diff_format=True,
289
316
  )
290
317
  )
318
+
291
319
  documents_to_scan = excluder.exclude_irrelevant_documents_to_scan(consts.SECRET_SCAN_TYPE, documents_to_scan)
292
320
 
321
+ is_cycodeignore_allowed = is_cycodeignore_allowed_by_scan_config(ctx)
322
+ documents_to_scan = filter_documents_with_cycodeignore(documents_to_scan, repo_path, is_cycodeignore_allowed)
323
+
293
324
  scan_documents(ctx, documents_to_scan, get_scan_parameters(ctx), is_git_diff=True)
294
325
 
295
326
 
@@ -301,11 +332,18 @@ def _scan_sast_pre_commit(ctx: typer.Context, repo_path: str, **_) -> None:
301
332
  progress_bar_section=ScanProgressBarSection.PREPARE_LOCAL_FILES,
302
333
  repo_path=repo_path,
303
334
  )
335
+
304
336
  pre_committed_documents = excluder.exclude_irrelevant_documents_to_scan(
305
337
  consts.SAST_SCAN_TYPE, pre_committed_documents
306
338
  )
307
339
  diff_documents = excluder.exclude_irrelevant_documents_to_scan(consts.SAST_SCAN_TYPE, diff_documents)
308
340
 
341
+ is_cycodeignore_allowed = is_cycodeignore_allowed_by_scan_config(ctx)
342
+ pre_committed_documents = filter_documents_with_cycodeignore(
343
+ pre_committed_documents, repo_path, is_cycodeignore_allowed
344
+ )
345
+ diff_documents = filter_documents_with_cycodeignore(diff_documents, repo_path, is_cycodeignore_allowed)
346
+
309
347
  _scan_commit_range_documents(ctx, pre_committed_documents, diff_documents, scan_parameters=scan_parameters)
310
348
 
311
349
 
@@ -8,6 +8,7 @@ from cycode.cli import consts
8
8
  from cycode.cli.apps.scan.code_scanner import scan_documents
9
9
  from cycode.cli.apps.scan.scan_parameters import get_scan_parameters
10
10
  from cycode.cli.exceptions.handle_scan_errors import handle_scan_exception
11
+ from cycode.cli.files_collector.documents_walk_ignore import filter_documents_with_cycodeignore
11
12
  from cycode.cli.files_collector.file_excluder import excluder
12
13
  from cycode.cli.files_collector.repository_documents import get_git_repository_tree_file_entries
13
14
  from cycode.cli.files_collector.sca.sca_file_collector import add_sca_dependencies_tree_documents_if_needed
@@ -15,6 +16,7 @@ from cycode.cli.logger import logger
15
16
  from cycode.cli.models import Document
16
17
  from cycode.cli.utils.path_utils import get_path_by_os
17
18
  from cycode.cli.utils.progress_bar import ScanProgressBarSection
19
+ from cycode.cli.utils.scan_utils import is_cycodeignore_allowed_by_scan_config
18
20
  from cycode.cli.utils.sentry import add_breadcrumb
19
21
 
20
22
 
@@ -60,6 +62,9 @@ def repository_command(
60
62
 
61
63
  documents_to_scan = excluder.exclude_irrelevant_documents_to_scan(scan_type, documents_to_scan)
62
64
 
65
+ is_cycodeignore_allowed = is_cycodeignore_allowed_by_scan_config(ctx)
66
+ documents_to_scan = filter_documents_with_cycodeignore(documents_to_scan, str(path), is_cycodeignore_allowed)
67
+
63
68
  add_sca_dependencies_tree_documents_if_needed(ctx, scan_type, documents_to_scan)
64
69
 
65
70
  logger.debug('Found all relevant files for scanning %s', {'path': path, 'branch': branch})
@@ -1,9 +1,11 @@
1
+ import os
1
2
  from pathlib import Path
2
3
  from typing import Annotated, Optional
3
4
 
4
5
  import click
5
6
  import typer
6
7
 
8
+ from cycode.cli.apps.scan.remote_url_resolver import _try_get_git_remote_url
7
9
  from cycode.cli.cli_types import ExportTypeOption, ScanTypeOption, ScaScanTypeOption, SeverityOption
8
10
  from cycode.cli.consts import (
9
11
  ISSUE_DETECTED_STATUS_CODE,
@@ -161,10 +163,15 @@ def scan_command(
161
163
  scan_client = get_scan_cycode_client(ctx)
162
164
  ctx.obj['client'] = scan_client
163
165
 
164
- remote_scan_config = scan_client.get_scan_configuration_safe(scan_type)
166
+ # Get remote URL from current working directory
167
+ remote_url = _try_get_git_remote_url(os.getcwd())
168
+
169
+ remote_scan_config = scan_client.get_scan_configuration_safe(scan_type, remote_url)
165
170
  if remote_scan_config:
166
171
  excluder.apply_scan_config(str(scan_type), remote_scan_config)
167
172
 
173
+ ctx.obj['scan_config'] = remote_scan_config
174
+
168
175
  if export_type and export_file:
169
176
  console_printer = ctx.obj['console_printer']
170
177
  console_printer.enable_recording(export_type, export_file)
@@ -52,6 +52,12 @@ class SbomOutputFormatOption(StrEnum):
52
52
  JSON = 'json'
53
53
 
54
54
 
55
+ class BusinessImpactOption(StrEnum):
56
+ HIGH = 'High'
57
+ MEDIUM = 'Medium'
58
+ LOW = 'Low'
59
+
60
+
55
61
  class SeverityOption(StrEnum):
56
62
  INFO = 'info'
57
63
  LOW = 'low'
@@ -17,6 +17,8 @@ SAST_SCAN_TYPE = 'sast'
17
17
  IAC_SCAN_SUPPORTED_FILE_EXTENSIONS = ('.tf', '.tf.json', '.json', '.yaml', '.yml', '.dockerfile', '.containerfile')
18
18
  IAC_SCAN_SUPPORTED_FILE_PREFIXES = ('dockerfile', 'containerfile')
19
19
 
20
+ CYCODEIGNORE_FILENAME = '.cycodeignore'
21
+
20
22
  SECRET_SCAN_FILE_EXTENSIONS_TO_IGNORE = (
21
23
  '.DS_Store',
22
24
  '.bmp',
@@ -408,22 +408,7 @@ def get_pre_commit_modified_documents(
408
408
  return git_head_documents, pre_committed_documents, diff_documents
409
409
 
410
410
 
411
- def parse_commit_range_sca(commit_range: str, path: str) -> tuple[Optional[str], Optional[str]]:
412
- # FIXME(MarshalX): i truly believe that this function does NOT work as expected
413
- # it does not handle cases like 'A..B' correctly
414
- # i leave it as it for SCA to not break anything
415
- # the more correct approach is implemented for SAST
416
- from_commit_rev = to_commit_rev = None
417
-
418
- for commit in git_proxy.get_repo(path).iter_commits(rev=commit_range):
419
- if not to_commit_rev:
420
- to_commit_rev = commit.hexsha
421
- from_commit_rev = commit.hexsha
422
-
423
- return from_commit_rev, to_commit_rev
424
-
425
-
426
- def parse_commit_range_sast(commit_range: str, path: str) -> tuple[Optional[str], Optional[str]]:
411
+ def parse_commit_range(commit_range: str, path: str) -> tuple[Optional[str], Optional[str]]:
427
412
  """Parses a git commit range string and returns the full SHAs for the 'from' and 'to' commits.
428
413
 
429
414
  Supports: