cycode 3.24.2.dev1__tar.gz → 3.24.3.dev2__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.
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/PKG-INFO +12 -13
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/README.md +11 -12
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/__init__.py +1 -1
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/scan/pre_push/pre_push_command.py +27 -10
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/scan/scan_result.py +14 -3
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/consts.py +30 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/exceptions/custom_exceptions.py +5 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/exceptions/handle_scan_errors.py +6 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/files_collector/commit_range_documents.py +34 -3
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/printers/utils/code_snippet_syntax.py +2 -1
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/utils/path_utils.py +26 -9
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/pyproject.toml +1 -1
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/LICENCE +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/__main__.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/__init__.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/app.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/__init__.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/activation_manager.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/ai_guardrails/__init__.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/ai_guardrails/command_utils.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/ai_guardrails/consts.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/ai_guardrails/hooks_manager.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/ai_guardrails/ides/__init__.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/ai_guardrails/ides/_plugin_utils.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/ai_guardrails/ides/_skill_utils.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/ai_guardrails/ides/base.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/ai_guardrails/ides/claude_code.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/ai_guardrails/ides/codex.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/ai_guardrails/ides/copilot.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/ai_guardrails/ides/cursor.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/ai_guardrails/install_command.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/ai_guardrails/scan/__init__.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/ai_guardrails/scan/consts.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/ai_guardrails/scan/detach.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/ai_guardrails/scan/guardrail_config.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/ai_guardrails/scan/handlers.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/ai_guardrails/scan/payload.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/ai_guardrails/scan/policy.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/ai_guardrails/scan/scan_command.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/ai_guardrails/scan/types.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/ai_guardrails/scan/utils.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/ai_guardrails/session_start_command.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/ai_guardrails/status_command.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/ai_guardrails/uninstall_command.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/ai_remediation/__init__.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/ai_remediation/ai_remediation_command.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/ai_remediation/apply_fix.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/ai_remediation/print_remediation.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/api/__init__.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/api/api_command.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/api/openapi_spec.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/auth/__init__.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/auth/auth_command.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/auth/auth_common.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/auth/auth_manager.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/auth/models.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/configure/__init__.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/configure/configure_command.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/configure/consts.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/configure/messages.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/configure/prompts.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/ignore/__init__.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/ignore/ignore_command.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/mcp/__init__.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/mcp/mcp_command.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/report/__init__.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/report/report_command.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/report/sbom/__init__.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/report/sbom/common.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/report/sbom/path/__init__.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/report/sbom/path/path_command.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/report/sbom/repository_url/__init__.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/report/sbom/repository_url/repository_url_command.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/report/sbom/sbom_command.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/report/sbom/sbom_report_file.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/report_import/__init__.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/report_import/report_import_command.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/report_import/sbom/__init__.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/report_import/sbom/sbom_command.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/sca_options.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/scan/__init__.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/scan/aggregation_report.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/scan/code_scanner.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/scan/commit_history/__init__.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/scan/commit_history/commit_history_command.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/scan/commit_range_scanner.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/scan/detection_excluder.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/scan/path/__init__.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/scan/path/path_command.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/scan/pre_commit/__init__.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/scan/pre_commit/pre_commit_command.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/scan/pre_push/__init__.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/scan/pre_receive/__init__.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/scan/pre_receive/pre_receive_command.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/scan/remote_url_resolver.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/scan/repository/__init__.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/scan/repository/repository_command.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/scan/scan_ci/__init__.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/scan/scan_ci/ci_integrations.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/scan/scan_ci/scan_ci_command.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/scan/scan_command.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/scan/scan_parameters.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/status/__init__.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/status/get_cli_status.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/status/models.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/status/status_command.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/status/version_command.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/cli_types.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/config.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/console.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/exceptions/__init__.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/exceptions/handle_ai_remediation_errors.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/exceptions/handle_auth_errors.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/exceptions/handle_errors.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/exceptions/handle_report_sbom_errors.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/files_collector/__init__.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/files_collector/documents_walk_ignore.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/files_collector/file_excluder.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/files_collector/iac/__init__.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/files_collector/iac/tf_content_generator.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/files_collector/models/__init__.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/files_collector/models/in_memory_zip.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/files_collector/path_documents.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/files_collector/repository_documents.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/files_collector/sca/__init__.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/files_collector/sca/base_restore_dependencies.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/files_collector/sca/go/__init__.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/files_collector/sca/go/restore_go_dependencies.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/files_collector/sca/maven/__init__.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/files_collector/sca/maven/restore_gradle_dependencies.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/files_collector/sca/maven/restore_maven_dependencies.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/files_collector/sca/npm/__init__.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/files_collector/sca/npm/restore_bun_dependencies.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/files_collector/sca/npm/restore_deno_dependencies.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/files_collector/sca/npm/restore_npm_dependencies.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/files_collector/sca/npm/restore_pnpm_dependencies.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/files_collector/sca/npm/restore_yarn_dependencies.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/files_collector/sca/nuget/__init__.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/files_collector/sca/nuget/restore_nuget_dependencies.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/files_collector/sca/php/__init__.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/files_collector/sca/php/restore_composer_dependencies.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/files_collector/sca/python/__init__.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/files_collector/sca/python/restore_pip_dependencies.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/files_collector/sca/python/restore_pipenv_dependencies.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/files_collector/sca/python/restore_poetry_dependencies.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/files_collector/sca/python/restore_uv_dependencies.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/files_collector/sca/ruby/__init__.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/files_collector/sca/ruby/restore_ruby_dependencies.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/files_collector/sca/sbt/__init__.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/files_collector/sca/sbt/restore_sbt_dependencies.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/files_collector/sca/sca_file_collector.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/files_collector/walk_ignore.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/files_collector/zip_documents.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/logger.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/main.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/models.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/printers/__init__.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/printers/console_printer.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/printers/json_printer.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/printers/printer_base.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/printers/rich_printer.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/printers/tables/__init__.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/printers/tables/sca_table_printer.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/printers/tables/table.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/printers/tables/table_models.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/printers/tables/table_printer.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/printers/tables/table_printer_base.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/printers/text_printer.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/printers/utils/__init__.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/printers/utils/detection_data.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/printers/utils/detection_ordering/__init__.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/printers/utils/detection_ordering/common_ordering.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/printers/utils/detection_ordering/sca_ordering.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/printers/utils/rich_helpers.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/printers/utils/sca_ossf.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/printers/utils/sca_policy_details.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/user_settings/__init__.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/user_settings/base_file_manager.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/user_settings/config_file_manager.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/user_settings/configuration_manager.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/user_settings/credentials_manager.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/user_settings/jwt_creator.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/utils/__init__.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/utils/binary_utils.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/utils/enum_utils.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/utils/get_api_client.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/utils/git_proxy.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/utils/host_info.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/utils/ignore_utils.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/utils/jwt_utils.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/utils/progress_bar.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/utils/scan_batch.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/utils/scan_utils.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/utils/shell_executor.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/utils/string_utils.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/utils/task_timer.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/utils/trust_store.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/utils/url_utils.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/utils/version_checker.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/utils/yaml_utils.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/config.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cyclient/__init__.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cyclient/ai_security_manager_client.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cyclient/ai_security_manager_service_config.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cyclient/auth_client.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cyclient/base_token_auth_client.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cyclient/cli_activation_client.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cyclient/client_creator.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cyclient/config.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cyclient/config_dev.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cyclient/cycode_client.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cyclient/cycode_client_base.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cyclient/cycode_dev_based_client.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cyclient/cycode_oidc_based_client.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cyclient/cycode_token_based_client.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cyclient/headers.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cyclient/import_sbom_client.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cyclient/logger.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cyclient/models.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cyclient/report_client.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cyclient/scan_client.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cyclient/scan_config_base.py +0 -0
- {cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/logger.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cycode
|
|
3
|
-
Version: 3.24.
|
|
3
|
+
Version: 3.24.3.dev2
|
|
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
|
|
@@ -304,7 +304,7 @@ Perform the following steps to install the pre-commit hook:
|
|
|
304
304
|
```yaml
|
|
305
305
|
repos:
|
|
306
306
|
- repo: https://github.com/cycodehq/cycode-cli
|
|
307
|
-
rev: v3.
|
|
307
|
+
rev: v3.25.0
|
|
308
308
|
hooks:
|
|
309
309
|
- id: cycode
|
|
310
310
|
stages: [pre-commit]
|
|
@@ -315,7 +315,7 @@ Perform the following steps to install the pre-commit hook:
|
|
|
315
315
|
```yaml
|
|
316
316
|
repos:
|
|
317
317
|
- repo: https://github.com/cycodehq/cycode-cli
|
|
318
|
-
rev: v3.
|
|
318
|
+
rev: v3.25.0
|
|
319
319
|
hooks:
|
|
320
320
|
- id: cycode
|
|
321
321
|
stages: [pre-commit]
|
|
@@ -354,7 +354,7 @@ To install the pre-push hook in addition to or instead of the pre-commit hook:
|
|
|
354
354
|
```yaml
|
|
355
355
|
repos:
|
|
356
356
|
- repo: https://github.com/cycodehq/cycode-cli
|
|
357
|
-
rev: v3.
|
|
357
|
+
rev: v3.25.0
|
|
358
358
|
hooks:
|
|
359
359
|
- id: cycode-pre-push
|
|
360
360
|
stages: [pre-push]
|
|
@@ -1155,7 +1155,7 @@ To set up the pre-push hook using the pre-commit framework:
|
|
|
1155
1155
|
```yaml
|
|
1156
1156
|
repos:
|
|
1157
1157
|
- repo: https://github.com/cycodehq/cycode-cli
|
|
1158
|
-
rev: v3.
|
|
1158
|
+
rev: v3.25.0
|
|
1159
1159
|
hooks:
|
|
1160
1160
|
- id: cycode-pre-push
|
|
1161
1161
|
stages: [pre-push]
|
|
@@ -1166,7 +1166,7 @@ To set up the pre-push hook using the pre-commit framework:
|
|
|
1166
1166
|
```yaml
|
|
1167
1167
|
repos:
|
|
1168
1168
|
- repo: https://github.com/cycodehq/cycode-cli
|
|
1169
|
-
rev: v3.
|
|
1169
|
+
rev: v3.25.0
|
|
1170
1170
|
hooks:
|
|
1171
1171
|
- id: cycode-pre-push # Secrets scan
|
|
1172
1172
|
stages: [pre-push]
|
|
@@ -1192,16 +1192,15 @@ To set up the pre-push hook using the pre-commit framework:
|
|
|
1192
1192
|
|
|
1193
1193
|
#### How Pre-Push Scanning Works
|
|
1194
1194
|
|
|
1195
|
-
The pre-push hook
|
|
1196
|
-
|
|
1197
|
-
-
|
|
1198
|
-
|
|
1199
|
-
-
|
|
1200
|
-
- Runs the same comprehensive scanning as other Cycode scan modes
|
|
1195
|
+
The hook scans every commit being pushed, one commit at a time, so a secret added in one commit and removed in a later one is still caught. When installed through the pre-commit framework, the pushed range is taken from the framework: new commits since the remote branch for existing branches, and the commits not yet on the remote for new branches (all commits when pushing to an empty remote). When run from a hand-written `.git/hooks/pre-push`, the range is read from git's hook input, and new branches are scanned from their merge base with the default branch (see below).
|
|
1196
|
+
|
|
1197
|
+
Pushes with nothing to scan, such as tags, branch deletions, and up-to-date pushes, pass without a scan. If the hook cannot determine what is being pushed, it fails and blocks the push instead of passing silently.
|
|
1198
|
+
|
|
1199
|
+
The Cycode pre-push hooks set `always_run: true` and `pass_filenames: false`, because the scan covers the pushed commits rather than a list of files. Without `always_run`, the pre-commit framework skips the hook when the pushed commits add up to no changed files, such as a secret added in one commit and deleted in the next. Without `pass_filenames: false`, the framework passes changed file names the scan does not use, and on large pushes it splits them into batches and runs the full scan once per batch. If you define the hook yourself (for example, as a `repo: local` hook), set both options.
|
|
1201
1200
|
|
|
1202
1201
|
#### Smart Default Branch Detection
|
|
1203
1202
|
|
|
1204
|
-
|
|
1203
|
+
When run from a hand-written hook, the pre-push scan detects the default branch for merge base calculation using this priority order:
|
|
1205
1204
|
|
|
1206
1205
|
1. **Environment Variable**: `CYCODE_DEFAULT_BRANCH` - allows manual override
|
|
1207
1206
|
2. **Git Remote HEAD**: Uses `git symbolic-ref refs/remotes/origin/HEAD` to detect the actual remote default branch
|
|
@@ -258,7 +258,7 @@ Perform the following steps to install the pre-commit hook:
|
|
|
258
258
|
```yaml
|
|
259
259
|
repos:
|
|
260
260
|
- repo: https://github.com/cycodehq/cycode-cli
|
|
261
|
-
rev: v3.
|
|
261
|
+
rev: v3.25.0
|
|
262
262
|
hooks:
|
|
263
263
|
- id: cycode
|
|
264
264
|
stages: [pre-commit]
|
|
@@ -269,7 +269,7 @@ Perform the following steps to install the pre-commit hook:
|
|
|
269
269
|
```yaml
|
|
270
270
|
repos:
|
|
271
271
|
- repo: https://github.com/cycodehq/cycode-cli
|
|
272
|
-
rev: v3.
|
|
272
|
+
rev: v3.25.0
|
|
273
273
|
hooks:
|
|
274
274
|
- id: cycode
|
|
275
275
|
stages: [pre-commit]
|
|
@@ -308,7 +308,7 @@ To install the pre-push hook in addition to or instead of the pre-commit hook:
|
|
|
308
308
|
```yaml
|
|
309
309
|
repos:
|
|
310
310
|
- repo: https://github.com/cycodehq/cycode-cli
|
|
311
|
-
rev: v3.
|
|
311
|
+
rev: v3.25.0
|
|
312
312
|
hooks:
|
|
313
313
|
- id: cycode-pre-push
|
|
314
314
|
stages: [pre-push]
|
|
@@ -1109,7 +1109,7 @@ To set up the pre-push hook using the pre-commit framework:
|
|
|
1109
1109
|
```yaml
|
|
1110
1110
|
repos:
|
|
1111
1111
|
- repo: https://github.com/cycodehq/cycode-cli
|
|
1112
|
-
rev: v3.
|
|
1112
|
+
rev: v3.25.0
|
|
1113
1113
|
hooks:
|
|
1114
1114
|
- id: cycode-pre-push
|
|
1115
1115
|
stages: [pre-push]
|
|
@@ -1120,7 +1120,7 @@ To set up the pre-push hook using the pre-commit framework:
|
|
|
1120
1120
|
```yaml
|
|
1121
1121
|
repos:
|
|
1122
1122
|
- repo: https://github.com/cycodehq/cycode-cli
|
|
1123
|
-
rev: v3.
|
|
1123
|
+
rev: v3.25.0
|
|
1124
1124
|
hooks:
|
|
1125
1125
|
- id: cycode-pre-push # Secrets scan
|
|
1126
1126
|
stages: [pre-push]
|
|
@@ -1146,16 +1146,15 @@ To set up the pre-push hook using the pre-commit framework:
|
|
|
1146
1146
|
|
|
1147
1147
|
#### How Pre-Push Scanning Works
|
|
1148
1148
|
|
|
1149
|
-
The pre-push hook
|
|
1150
|
-
|
|
1151
|
-
-
|
|
1152
|
-
|
|
1153
|
-
-
|
|
1154
|
-
- Runs the same comprehensive scanning as other Cycode scan modes
|
|
1149
|
+
The hook scans every commit being pushed, one commit at a time, so a secret added in one commit and removed in a later one is still caught. When installed through the pre-commit framework, the pushed range is taken from the framework: new commits since the remote branch for existing branches, and the commits not yet on the remote for new branches (all commits when pushing to an empty remote). When run from a hand-written `.git/hooks/pre-push`, the range is read from git's hook input, and new branches are scanned from their merge base with the default branch (see below).
|
|
1150
|
+
|
|
1151
|
+
Pushes with nothing to scan, such as tags, branch deletions, and up-to-date pushes, pass without a scan. If the hook cannot determine what is being pushed, it fails and blocks the push instead of passing silently.
|
|
1152
|
+
|
|
1153
|
+
The Cycode pre-push hooks set `always_run: true` and `pass_filenames: false`, because the scan covers the pushed commits rather than a list of files. Without `always_run`, the pre-commit framework skips the hook when the pushed commits add up to no changed files, such as a secret added in one commit and deleted in the next. Without `pass_filenames: false`, the framework passes changed file names the scan does not use, and on large pushes it splits them into batches and runs the full scan once per batch. If you define the hook yourself (for example, as a `repo: local` hook), set both options.
|
|
1155
1154
|
|
|
1156
1155
|
#### Smart Default Branch Detection
|
|
1157
1156
|
|
|
1158
|
-
|
|
1157
|
+
When run from a hand-written hook, the pre-push scan detects the default branch for merge base calculation using this priority order:
|
|
1159
1158
|
|
|
1160
1159
|
1. **Environment Variable**: `CYCODE_DEFAULT_BRANCH` - allows manual override
|
|
1161
1160
|
2. **Git Remote HEAD**: Uses `git symbolic-ref refs/remotes/origin/HEAD` to detect the actual remote default branch
|
|
@@ -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.24.
|
|
8
|
+
__version__ = '3.24.3.dev2' # DON'T TOUCH. Placeholder. Will be filled automatically on poetry build from Git Tag
|
|
@@ -12,9 +12,12 @@ from cycode.cli.apps.scan.commit_range_scanner import (
|
|
|
12
12
|
)
|
|
13
13
|
from cycode.cli.config import configuration_manager
|
|
14
14
|
from cycode.cli.console import console
|
|
15
|
+
from cycode.cli.exceptions.custom_exceptions import PrePushInputNotFoundError
|
|
15
16
|
from cycode.cli.exceptions.handle_scan_errors import handle_scan_exception
|
|
16
17
|
from cycode.cli.files_collector.commit_range_documents import (
|
|
17
18
|
calculate_pre_push_commit_range,
|
|
19
|
+
get_pre_commit_framework_push_range,
|
|
20
|
+
is_invoked_by_pre_commit_framework,
|
|
18
21
|
parse_pre_push_input,
|
|
19
22
|
)
|
|
20
23
|
from cycode.cli.logger import logger
|
|
@@ -43,17 +46,8 @@ def pre_push_command(
|
|
|
43
46
|
command_scan_type = ctx.info_name
|
|
44
47
|
timeout = configuration_manager.get_pre_push_command_timeout(command_scan_type)
|
|
45
48
|
with TimeoutAfter(timeout):
|
|
46
|
-
|
|
47
|
-
if not push_update_details:
|
|
48
|
-
logger.info('No pre-push input found, nothing to scan')
|
|
49
|
-
return
|
|
50
|
-
|
|
51
|
-
commit_range = calculate_pre_push_commit_range(push_update_details)
|
|
49
|
+
commit_range = _get_pre_push_commit_range()
|
|
52
50
|
if not commit_range:
|
|
53
|
-
logger.info(
|
|
54
|
-
'No new commits found for pushed branch, %s',
|
|
55
|
-
{'push_update_details': push_update_details},
|
|
56
|
-
)
|
|
57
51
|
return
|
|
58
52
|
|
|
59
53
|
scan_commit_range(
|
|
@@ -67,3 +61,26 @@ def pre_push_command(
|
|
|
67
61
|
console.print(consts.PRE_RECEIVE_AND_PUSH_REMEDIATION_MESSAGE)
|
|
68
62
|
except Exception as e:
|
|
69
63
|
handle_scan_exception(ctx, e)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def _get_pre_push_commit_range() -> Optional[str]:
|
|
67
|
+
commit_range = get_pre_commit_framework_push_range()
|
|
68
|
+
if commit_range:
|
|
69
|
+
logger.debug('Using push details from the pre-commit framework, %s', {'commit_range': commit_range})
|
|
70
|
+
return commit_range
|
|
71
|
+
|
|
72
|
+
if is_invoked_by_pre_commit_framework():
|
|
73
|
+
# the framework consumed git's stdin but did not tell us what is being pushed
|
|
74
|
+
raise PrePushInputNotFoundError
|
|
75
|
+
|
|
76
|
+
push_update_details = parse_pre_push_input()
|
|
77
|
+
if not push_update_details:
|
|
78
|
+
# git runs the hook with empty input when everything is up-to-date
|
|
79
|
+
logger.info('No pre-push input found, nothing to scan')
|
|
80
|
+
return None
|
|
81
|
+
|
|
82
|
+
commit_range = calculate_pre_push_commit_range(push_update_details)
|
|
83
|
+
if not commit_range:
|
|
84
|
+
logger.info('No new commits found for pushed branch, %s', {'push_update_details': push_update_details})
|
|
85
|
+
|
|
86
|
+
return commit_range
|
|
@@ -7,7 +7,7 @@ from cycode.cli import consts
|
|
|
7
7
|
from cycode.cli.apps.scan.aggregation_report import try_get_aggregation_report_url_if_needed
|
|
8
8
|
from cycode.cli.apps.scan.detection_excluder import exclude_irrelevant_document_detections
|
|
9
9
|
from cycode.cli.models import Document, DocumentDetections, LocalScanResult
|
|
10
|
-
from cycode.cli.utils.path_utils import
|
|
10
|
+
from cycode.cli.utils.path_utils import concat_unique_id, normalize_file_path
|
|
11
11
|
from cycode.cyclient.models import (
|
|
12
12
|
Detection,
|
|
13
13
|
DetectionSchema,
|
|
@@ -28,8 +28,15 @@ logger = get_logger('Scan Results')
|
|
|
28
28
|
def _get_document_by_file_name(
|
|
29
29
|
documents: list[Document], file_name: str, unique_id: Optional[str] = None
|
|
30
30
|
) -> Optional[Document]:
|
|
31
|
+
normalized_file_name = normalize_file_path(file_name)
|
|
31
32
|
for document in documents:
|
|
32
|
-
if normalize_file_path(document.path) ==
|
|
33
|
+
if normalize_file_path(document.path) == normalized_file_name and document.unique_id == unique_id:
|
|
34
|
+
return document
|
|
35
|
+
|
|
36
|
+
if (
|
|
37
|
+
document.unique_id
|
|
38
|
+
and normalize_file_path(concat_unique_id(document.path, document.unique_id)) == normalized_file_name
|
|
39
|
+
):
|
|
33
40
|
return document
|
|
34
41
|
|
|
35
42
|
return None
|
|
@@ -42,7 +49,7 @@ def _get_document_detections(
|
|
|
42
49
|
|
|
43
50
|
document_detections = []
|
|
44
51
|
for detections_per_file in scan_result.detections_per_file:
|
|
45
|
-
file_name =
|
|
52
|
+
file_name = detections_per_file.file_name
|
|
46
53
|
commit_id = detections_per_file.commit_id
|
|
47
54
|
|
|
48
55
|
logger.debug(
|
|
@@ -50,6 +57,10 @@ def _get_document_detections(
|
|
|
50
57
|
)
|
|
51
58
|
|
|
52
59
|
document = _get_document_by_file_name(documents_to_scan, file_name, commit_id)
|
|
60
|
+
if document is None:
|
|
61
|
+
logger.debug('Failed to find the document of the violated file, %s', {'file_name': file_name})
|
|
62
|
+
document = Document(file_name, '', unique_id=commit_id)
|
|
63
|
+
|
|
53
64
|
document_detections.append(DocumentDetections(document=document, detections=detections_per_file.detections))
|
|
54
65
|
|
|
55
66
|
return document_detections
|
|
@@ -1,11 +1,33 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
from enum import Enum
|
|
3
|
+
|
|
1
4
|
PROGRAM_NAME = 'cycode'
|
|
2
5
|
APP_NAME = 'CycodeCLI'
|
|
3
6
|
CLI_CONTEXT_SETTINGS = {'terminal_width': 10**9, 'max_content_width': 10**9, 'help_option_names': ['-h', '--help']}
|
|
4
7
|
|
|
8
|
+
|
|
9
|
+
class OperatingSystem(str, Enum):
|
|
10
|
+
WINDOWS = 'windows'
|
|
11
|
+
MACOS = 'macos'
|
|
12
|
+
LINUX = 'linux'
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def _detect_operating_system() -> OperatingSystem:
|
|
16
|
+
if sys.platform == 'win32':
|
|
17
|
+
return OperatingSystem.WINDOWS
|
|
18
|
+
if sys.platform == 'darwin':
|
|
19
|
+
return OperatingSystem.MACOS
|
|
20
|
+
return OperatingSystem.LINUX
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
OPERATING_SYSTEM = _detect_operating_system()
|
|
24
|
+
|
|
5
25
|
PRE_COMMIT_COMMAND_SCAN_TYPE = 'pre-commit'
|
|
6
26
|
PRE_COMMIT_COMMAND_SCAN_TYPE_OLD = 'pre_commit'
|
|
7
27
|
PRE_RECEIVE_COMMAND_SCAN_TYPE = 'pre-receive'
|
|
8
28
|
PRE_RECEIVE_COMMAND_SCAN_TYPE_OLD = 'pre_receive'
|
|
29
|
+
PRE_PUSH_COMMAND_SCAN_TYPE = 'pre-push'
|
|
30
|
+
PRE_PUSH_COMMAND_SCAN_TYPE_OLD = 'pre_push'
|
|
9
31
|
COMMIT_HISTORY_COMMAND_SCAN_TYPE = 'commit-history'
|
|
10
32
|
COMMIT_HISTORY_COMMAND_SCAN_TYPE_OLD = 'commit_history'
|
|
11
33
|
|
|
@@ -193,6 +215,8 @@ COMMIT_RANGE_BASED_COMMAND_SCAN_TYPES = [
|
|
|
193
215
|
PRE_COMMIT_COMMAND_SCAN_TYPE_OLD,
|
|
194
216
|
PRE_RECEIVE_COMMAND_SCAN_TYPE,
|
|
195
217
|
PRE_RECEIVE_COMMAND_SCAN_TYPE_OLD,
|
|
218
|
+
PRE_PUSH_COMMAND_SCAN_TYPE,
|
|
219
|
+
PRE_PUSH_COMMAND_SCAN_TYPE_OLD,
|
|
196
220
|
COMMIT_HISTORY_COMMAND_SCAN_TYPE,
|
|
197
221
|
COMMIT_HISTORY_COMMAND_SCAN_TYPE_OLD,
|
|
198
222
|
]
|
|
@@ -311,6 +335,12 @@ EMPTY_COMMIT_SHA = '0000000000000000000000000000000000000000'
|
|
|
311
335
|
GIT_PUSH_OPTION_COUNT_ENV_VAR_NAME = 'GIT_PUSH_OPTION_COUNT'
|
|
312
336
|
GIT_PUSH_OPTION_ENV_VAR_PREFIX = 'GIT_PUSH_OPTION_'
|
|
313
337
|
|
|
338
|
+
# the pre-commit framework consumes git's pre-push stdin and exposes the push details via env vars instead
|
|
339
|
+
PRE_COMMIT_FRAMEWORK_ENV_VAR_NAME = 'PRE_COMMIT'
|
|
340
|
+
PRE_COMMIT_FROM_REF_ENV_VAR_NAME = 'PRE_COMMIT_FROM_REF'
|
|
341
|
+
PRE_COMMIT_TO_REF_ENV_VAR_NAME = 'PRE_COMMIT_TO_REF'
|
|
342
|
+
PRE_COMMIT_REMOTE_BRANCH_ENV_VAR_NAME = 'PRE_COMMIT_REMOTE_BRANCH'
|
|
343
|
+
|
|
314
344
|
SKIP_SCAN_FLAG = 'skip-cycode-scan'
|
|
315
345
|
VERBOSE_SCAN_FLAG = 'verbose'
|
|
316
346
|
|
|
@@ -80,6 +80,11 @@ class FileCollectionError(CycodeError):
|
|
|
80
80
|
return self.error_message
|
|
81
81
|
|
|
82
82
|
|
|
83
|
+
class PrePushInputNotFoundError(CycodeError):
|
|
84
|
+
def __str__(self) -> str:
|
|
85
|
+
return 'Neither git pre-push input nor pre-commit framework push details were found'
|
|
86
|
+
|
|
87
|
+
|
|
83
88
|
class AuthProcessError(CycodeError):
|
|
84
89
|
def __init__(self, error_message: str) -> None:
|
|
85
90
|
self.error_message = error_message
|
|
@@ -40,6 +40,12 @@ def handle_scan_exception(ctx: typer.Context, err: Exception, *, return_exceptio
|
|
|
40
40
|
message='File collection failed. '
|
|
41
41
|
'Use --no-restore to skip dependency restoration, or fix the underlying issue.',
|
|
42
42
|
),
|
|
43
|
+
custom_exceptions.PrePushInputNotFoundError: CliError(
|
|
44
|
+
soft_fail=False,
|
|
45
|
+
code='pre_push_input_not_found',
|
|
46
|
+
message='Could not determine which commits are being pushed, so nothing was scanned. '
|
|
47
|
+
'Run this command from a git pre-push hook',
|
|
48
|
+
),
|
|
43
49
|
custom_exceptions.TfplanKeyError: CliError(
|
|
44
50
|
soft_fail=True,
|
|
45
51
|
code='key_error',
|
{cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/files_collector/commit_range_documents.py
RENAMED
|
@@ -85,7 +85,11 @@ def collect_commit_range_diff_documents(
|
|
|
85
85
|
|
|
86
86
|
repo = git_proxy.get_repo(path)
|
|
87
87
|
|
|
88
|
-
|
|
88
|
+
if commit_range == consts.COMMIT_RANGE_ALL_COMMITS:
|
|
89
|
+
# everything reachable from HEAD, including the root commit
|
|
90
|
+
normalized_commit_range = consts.GIT_HEAD_COMMIT_REV
|
|
91
|
+
else:
|
|
92
|
+
normalized_commit_range = normalize_commit_range(commit_range, path)
|
|
89
93
|
|
|
90
94
|
total_commits_count = int(repo.git.rev_list('--count', normalized_commit_range))
|
|
91
95
|
logger.debug(
|
|
@@ -104,8 +108,10 @@ def collect_commit_range_diff_documents(
|
|
|
104
108
|
|
|
105
109
|
commit_id = commit.hexsha
|
|
106
110
|
commit_ids_to_scan.append(commit_id)
|
|
107
|
-
|
|
108
|
-
|
|
111
|
+
if commit.parents:
|
|
112
|
+
diff_index = commit.diff(commit.parents[0], create_patch=True, R=True)
|
|
113
|
+
else:
|
|
114
|
+
diff_index = commit.diff(git_proxy.get_null_tree(), create_patch=True)
|
|
109
115
|
for diff in diff_index:
|
|
110
116
|
commit_documents_to_scan.append(
|
|
111
117
|
Document(
|
|
@@ -264,6 +270,31 @@ def parse_pre_push_input() -> Optional[str]:
|
|
|
264
270
|
return pre_push_input.splitlines()[0]
|
|
265
271
|
|
|
266
272
|
|
|
273
|
+
def is_invoked_by_pre_commit_framework() -> bool:
|
|
274
|
+
return os.getenv(consts.PRE_COMMIT_FRAMEWORK_ENV_VAR_NAME) == '1'
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
def get_pre_commit_framework_push_range() -> Optional[str]:
|
|
278
|
+
"""Get the commit range to scan when invoked as a pre-push hook by the pre-commit framework.
|
|
279
|
+
|
|
280
|
+
The pre-commit framework reads git's pre-push stdin itself and never forwards it to hooks.
|
|
281
|
+
Instead, it exposes the already resolved push details via environment variables.
|
|
282
|
+
|
|
283
|
+
Returns:
|
|
284
|
+
Commit range string for scanning, or None if not invoked by the pre-commit framework
|
|
285
|
+
"""
|
|
286
|
+
from_ref = os.getenv(consts.PRE_COMMIT_FROM_REF_ENV_VAR_NAME)
|
|
287
|
+
to_ref = os.getenv(consts.PRE_COMMIT_TO_REF_ENV_VAR_NAME)
|
|
288
|
+
if from_ref and to_ref:
|
|
289
|
+
return f'{from_ref}..{to_ref}'
|
|
290
|
+
|
|
291
|
+
# the framework omits the refs when the pushed history includes the root commit
|
|
292
|
+
if os.getenv(consts.PRE_COMMIT_REMOTE_BRANCH_ENV_VAR_NAME):
|
|
293
|
+
return consts.COMMIT_RANGE_ALL_COMMITS
|
|
294
|
+
|
|
295
|
+
return None
|
|
296
|
+
|
|
297
|
+
|
|
267
298
|
def _read_hook_input_from_stdin() -> str:
|
|
268
299
|
"""Read input from stdin when called from a hook.
|
|
269
300
|
|
|
@@ -89,7 +89,8 @@ def _get_code_snippet_syntax_from_git_diff(
|
|
|
89
89
|
detection_position = detection_details.get('start_position', -1)
|
|
90
90
|
violation_length = detection_details.get('length', -1)
|
|
91
91
|
|
|
92
|
-
|
|
92
|
+
document_content_lines = document.content.splitlines()
|
|
93
|
+
line_content = document_content_lines[detection_line] if 0 <= detection_line < len(document_content_lines) else ''
|
|
93
94
|
detection_position_in_line = get_position_in_line(document.content, detection_position)
|
|
94
95
|
if scan_type == consts.SECRET_SCAN_TYPE and obfuscate:
|
|
95
96
|
violation = line_content[detection_position_in_line : detection_position_in_line + violation_length]
|
|
@@ -2,10 +2,12 @@ import json
|
|
|
2
2
|
import os
|
|
3
3
|
import tempfile
|
|
4
4
|
from functools import cache
|
|
5
|
+
from pathlib import PurePath, PurePosixPath, PureWindowsPath
|
|
5
6
|
from typing import TYPE_CHECKING, AnyStr, Optional, Union
|
|
6
7
|
|
|
7
8
|
import typer
|
|
8
9
|
|
|
10
|
+
from cycode.cli.consts import OPERATING_SYSTEM, OperatingSystem
|
|
9
11
|
from cycode.cli.logger import logger
|
|
10
12
|
from cycode.cli.utils.binary_utils import is_binary_string
|
|
11
13
|
|
|
@@ -125,12 +127,29 @@ def change_filename_extension(filename: str, extension: str) -> str:
|
|
|
125
127
|
return f'{base_name}.{extension}'
|
|
126
128
|
|
|
127
129
|
|
|
130
|
+
def _to_relative_posix_parts(path: str, operating_system: OperatingSystem = OPERATING_SYSTEM) -> tuple[str, ...]:
|
|
131
|
+
"""Split a path into OS-agnostic components: drop the root, keep the UNC server and share.
|
|
132
|
+
|
|
133
|
+
The archive entry name is read back by the server as ``<unique id>/<path>``, so it must use forward slashes
|
|
134
|
+
and must never start with a root. The flavor comes from the running OS rather than from the path itself, so
|
|
135
|
+
a colon in a POSIX file name is not mistaken for a drive letter.
|
|
136
|
+
"""
|
|
137
|
+
pure: PurePath = PureWindowsPath(path) if operating_system is OperatingSystem.WINDOWS else PurePosixPath(path)
|
|
138
|
+
if not pure.anchor:
|
|
139
|
+
return pure.parts
|
|
140
|
+
|
|
141
|
+
# the anchor is 'C:\\', '/' or '\\\\server\\share\\': keep the names it carries, drop the drive and separators
|
|
142
|
+
anchor_parts = tuple(p for p in pure.anchor.replace('\\', '/').split('/') if p and not p.endswith(':'))
|
|
143
|
+
return anchor_parts + pure.parts[1:]
|
|
144
|
+
|
|
145
|
+
|
|
128
146
|
def concat_unique_id(filename: str, unique_id: str) -> str:
|
|
129
|
-
|
|
130
|
-
# remove leading slash to join the path correctly
|
|
131
|
-
filename = filename[len(os.sep) :]
|
|
147
|
+
"""Prefix the file name with the unique id (e.g. a commit SHA) to build the name of the archive entry.
|
|
132
148
|
|
|
133
|
-
|
|
149
|
+
The server reads the unique id back from the first path component, so the file name must become relative
|
|
150
|
+
before joining; otherwise the prefix is lost and a Windows drive letter is reported as the commit id.
|
|
151
|
+
"""
|
|
152
|
+
return str(PurePosixPath(unique_id, *_to_relative_posix_parts(filename)))
|
|
134
153
|
|
|
135
154
|
|
|
136
155
|
def get_path_from_context(ctx: typer.Context) -> Optional[str]:
|
|
@@ -141,8 +160,6 @@ def get_path_from_context(ctx: typer.Context) -> Optional[str]:
|
|
|
141
160
|
|
|
142
161
|
|
|
143
162
|
def normalize_file_path(path: str) -> str:
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
if
|
|
147
|
-
return path[2:]
|
|
148
|
-
return path
|
|
163
|
+
"""Make a path comparable with the file name the server reports back: no drive, no root, forward slashes."""
|
|
164
|
+
parts = _to_relative_posix_parts(path)
|
|
165
|
+
return str(PurePosixPath(*parts)) if parts else ''
|
|
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
|
{cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/ai_guardrails/ides/_plugin_utils.py
RENAMED
|
File without changes
|
{cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/ai_guardrails/ides/_skill_utils.py
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
|
{cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/ai_guardrails/scan/guardrail_config.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/ai_guardrails/scan/scan_command.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/ai_guardrails/session_start_command.py
RENAMED
|
File without changes
|
|
File without changes
|
{cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/ai_guardrails/uninstall_command.py
RENAMED
|
File without changes
|
|
File without changes
|
{cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/ai_remediation/ai_remediation_command.py
RENAMED
|
File without changes
|
|
File without changes
|
{cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/ai_remediation/print_remediation.py
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
|
{cycode-3.24.2.dev1 → cycode-3.24.3.dev2}/cycode/cli/apps/report/sbom/repository_url/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|