cycode 2.2.1.dev3__tar.gz → 2.2.1.dev5__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-2.2.1.dev3 → cycode-2.2.1.dev5}/PKG-INFO +1 -1
- cycode-2.2.1.dev5/cycode/__init__.py +1 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/commands/scan/scan_command.py +12 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/consts.py +2 -0
- cycode-2.2.1.dev5/cycode/cli/files_collector/sca/maven/restore_gradle_dependencies.py +70 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/utils/scan_batch.py +2 -1
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/pyproject.toml +1 -1
- cycode-2.2.1.dev3/cycode/__init__.py +0 -1
- cycode-2.2.1.dev3/cycode/cli/files_collector/sca/maven/restore_gradle_dependencies.py +0 -28
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/LICENCE +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/README.md +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/__init__.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/commands/__init__.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/commands/ai_remediation/__init__.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/commands/ai_remediation/ai_remediation_command.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/commands/auth/__init__.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/commands/auth/auth_command.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/commands/auth/auth_manager.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/commands/auth_common.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/commands/configure/__init__.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/commands/configure/configure_command.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/commands/ignore/__init__.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/commands/ignore/ignore_command.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/commands/main_cli.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/commands/report/__init__.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/commands/report/report_command.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/commands/report/sbom/__init__.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/commands/report/sbom/common.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/commands/report/sbom/path/__init__.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/commands/report/sbom/path/path_command.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/commands/report/sbom/repository_url/__init__.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/commands/report/sbom/repository_url/repository_url_command.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/commands/report/sbom/sbom_command.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/commands/report/sbom/sbom_report_file.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/commands/scan/__init__.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/commands/scan/code_scanner.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/commands/scan/commit_history/__init__.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/commands/scan/commit_history/commit_history_command.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/commands/scan/path/__init__.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/commands/scan/path/path_command.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/commands/scan/pre_commit/__init__.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/commands/scan/pre_commit/pre_commit_command.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/commands/scan/pre_receive/__init__.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/commands/scan/pre_receive/pre_receive_command.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/commands/scan/repository/__init__.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/commands/scan/repository/repository_command.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/commands/scan/scan_ci/__init__.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/commands/scan/scan_ci/ci_integrations.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/commands/scan/scan_ci/scan_ci_command.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/commands/status/__init__.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/commands/status/status_command.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/commands/version/__init__.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/commands/version/version_checker.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/commands/version/version_command.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/config.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/config.yaml +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/exceptions/__init__.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/exceptions/common.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/exceptions/custom_exceptions.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/exceptions/handle_ai_remediation_errors.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/exceptions/handle_report_sbom_errors.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/exceptions/handle_scan_errors.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/files_collector/__init__.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/files_collector/excluder.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/files_collector/iac/__init__.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/files_collector/iac/tf_content_generator.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/files_collector/models/__init__.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/files_collector/models/in_memory_zip.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/files_collector/path_documents.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/files_collector/repository_documents.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/files_collector/sca/__init__.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/files_collector/sca/base_restore_dependencies.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/files_collector/sca/go/__init__.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/files_collector/sca/go/restore_go_dependencies.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/files_collector/sca/maven/__init__.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/files_collector/sca/maven/restore_maven_dependencies.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/files_collector/sca/npm/__init__.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/files_collector/sca/npm/restore_npm_dependencies.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/files_collector/sca/nuget/__init__.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/files_collector/sca/nuget/restore_nuget_dependencies.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/files_collector/sca/ruby/__init__.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/files_collector/sca/ruby/restore_ruby_dependencies.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/files_collector/sca/sbt/__init__.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/files_collector/sca/sbt/restore_sbt_dependencies.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/files_collector/sca/sca_code_scanner.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/files_collector/walk_ignore.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/files_collector/zip_documents.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/main.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/models.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/printers/__init__.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/printers/console_printer.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/printers/json_printer.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/printers/printer_base.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/printers/tables/__init__.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/printers/tables/sca_table_printer.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/printers/tables/table.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/printers/tables/table_models.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/printers/tables/table_printer.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/printers/tables/table_printer_base.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/printers/text_printer.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/sentry.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/user_settings/__init__.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/user_settings/base_file_manager.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/user_settings/config_file_manager.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/user_settings/configuration_manager.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/user_settings/credentials_manager.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/user_settings/jwt_creator.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/utils/__init__.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/utils/enum_utils.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/utils/get_api_client.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/utils/git_proxy.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/utils/ignore_utils.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/utils/jwt_utils.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/utils/path_utils.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/utils/progress_bar.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/utils/scan_utils.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/utils/shell_executor.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/utils/string_utils.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/utils/task_timer.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/utils/yaml_utils.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cyclient/__init__.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cyclient/auth_client.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cyclient/client_creator.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cyclient/config.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cyclient/config.yaml +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cyclient/config_dev.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cyclient/cycode_client.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cyclient/cycode_client_base.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cyclient/cycode_dev_based_client.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cyclient/cycode_token_based_client.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cyclient/headers.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cyclient/models.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cyclient/report_client.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cyclient/scan_client.py +0 -0
- {cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cyclient/scan_config_base.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = '2.2.1.dev5' # DON'T TOUCH. Placeholder. Will be filled automatically on poetry build from Git Tag
|
|
@@ -13,6 +13,7 @@ from cycode.cli.config import config
|
|
|
13
13
|
from cycode.cli.consts import (
|
|
14
14
|
ISSUE_DETECTED_STATUS_CODE,
|
|
15
15
|
NO_ISSUES_STATUS_CODE,
|
|
16
|
+
SCA_GRADLE_ALL_SUB_PROJECTS_FLAG,
|
|
16
17
|
SCA_SKIP_RESTORE_DEPENDENCIES_FLAG,
|
|
17
18
|
)
|
|
18
19
|
from cycode.cli.models import Severity
|
|
@@ -110,6 +111,15 @@ from cycode.cli.utils.get_api_client import get_scan_cycode_client
|
|
|
110
111
|
type=bool,
|
|
111
112
|
required=False,
|
|
112
113
|
)
|
|
114
|
+
@click.option(
|
|
115
|
+
f'--{SCA_GRADLE_ALL_SUB_PROJECTS_FLAG}',
|
|
116
|
+
is_flag=True,
|
|
117
|
+
default=False,
|
|
118
|
+
help='When specified, Cycode will run gradle restore command for all sub projects. '
|
|
119
|
+
'Should run from root project directory ONLY!',
|
|
120
|
+
type=bool,
|
|
121
|
+
required=False,
|
|
122
|
+
)
|
|
113
123
|
@click.pass_context
|
|
114
124
|
def scan_command(
|
|
115
125
|
context: click.Context,
|
|
@@ -124,6 +134,7 @@ def scan_command(
|
|
|
124
134
|
report: bool,
|
|
125
135
|
no_restore: bool,
|
|
126
136
|
sync: bool,
|
|
137
|
+
gradle_all_sub_projects: bool,
|
|
127
138
|
) -> int:
|
|
128
139
|
"""Scans for Secrets, IaC, SCA or SAST violations."""
|
|
129
140
|
add_breadcrumb('scan')
|
|
@@ -145,6 +156,7 @@ def scan_command(
|
|
|
145
156
|
context.obj['monitor'] = monitor
|
|
146
157
|
context.obj['report'] = report
|
|
147
158
|
context.obj[SCA_SKIP_RESTORE_DEPENDENCIES_FLAG] = no_restore
|
|
159
|
+
context.obj[SCA_GRADLE_ALL_SUB_PROJECTS_FLAG] = gradle_all_sub_projects
|
|
148
160
|
|
|
149
161
|
_sca_scan_to_context(context, sca_scan)
|
|
150
162
|
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import re
|
|
3
|
+
from typing import List, Optional, Set
|
|
4
|
+
|
|
5
|
+
import click
|
|
6
|
+
|
|
7
|
+
from cycode.cli.consts import SCA_GRADLE_ALL_SUB_PROJECTS_FLAG
|
|
8
|
+
from cycode.cli.files_collector.sca.base_restore_dependencies import BaseRestoreDependencies
|
|
9
|
+
from cycode.cli.models import Document
|
|
10
|
+
from cycode.cli.utils.path_utils import get_path_from_context
|
|
11
|
+
from cycode.cli.utils.shell_executor import shell
|
|
12
|
+
|
|
13
|
+
BUILD_GRADLE_FILE_NAME = 'build.gradle'
|
|
14
|
+
BUILD_GRADLE_KTS_FILE_NAME = 'build.gradle.kts'
|
|
15
|
+
BUILD_GRADLE_DEP_TREE_FILE_NAME = 'gradle-dependencies-generated.txt'
|
|
16
|
+
BUILD_GRADLE_ALL_PROJECTS_TIMEOUT = 180
|
|
17
|
+
BUILD_GRADLE_ALL_PROJECTS_COMMAND = ['gradle', 'projects']
|
|
18
|
+
ALL_PROJECTS_REGEX = r"[+-]{3} Project '(.*?)'"
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class RestoreGradleDependencies(BaseRestoreDependencies):
|
|
22
|
+
def __init__(
|
|
23
|
+
self, context: click.Context, is_git_diff: bool, command_timeout: int, projects: Optional[Set[str]] = None
|
|
24
|
+
) -> None:
|
|
25
|
+
super().__init__(context, is_git_diff, command_timeout, create_output_file_manually=True)
|
|
26
|
+
if projects is None:
|
|
27
|
+
projects = set()
|
|
28
|
+
self.projects = self.get_all_projects() if self.is_gradle_sub_projects() else projects
|
|
29
|
+
|
|
30
|
+
def is_gradle_sub_projects(self) -> bool:
|
|
31
|
+
return self.context.obj.get(SCA_GRADLE_ALL_SUB_PROJECTS_FLAG)
|
|
32
|
+
|
|
33
|
+
def is_project(self, document: Document) -> bool:
|
|
34
|
+
return document.path.endswith(BUILD_GRADLE_FILE_NAME) or document.path.endswith(BUILD_GRADLE_KTS_FILE_NAME)
|
|
35
|
+
|
|
36
|
+
def get_commands(self, manifest_file_path: str) -> List[List[str]]:
|
|
37
|
+
return (
|
|
38
|
+
self.get_commands_for_sub_projects(manifest_file_path)
|
|
39
|
+
if self.is_gradle_sub_projects()
|
|
40
|
+
else [['gradle', 'dependencies', '-b', manifest_file_path, '-q', '--console', 'plain']]
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
def get_lock_file_name(self) -> str:
|
|
44
|
+
return BUILD_GRADLE_DEP_TREE_FILE_NAME
|
|
45
|
+
|
|
46
|
+
def verify_restore_file_already_exist(self, restore_file_path: str) -> bool:
|
|
47
|
+
return os.path.isfile(restore_file_path)
|
|
48
|
+
|
|
49
|
+
def get_working_directory(self, document: Document) -> Optional[str]:
|
|
50
|
+
return get_path_from_context(self.context) if self.is_gradle_sub_projects() else None
|
|
51
|
+
|
|
52
|
+
def get_all_projects(self) -> Set[str]:
|
|
53
|
+
projects_output = shell(
|
|
54
|
+
command=BUILD_GRADLE_ALL_PROJECTS_COMMAND,
|
|
55
|
+
timeout=BUILD_GRADLE_ALL_PROJECTS_TIMEOUT,
|
|
56
|
+
working_directory=get_path_from_context(self.context),
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
projects = re.findall(ALL_PROJECTS_REGEX, projects_output)
|
|
60
|
+
|
|
61
|
+
return set(projects)
|
|
62
|
+
|
|
63
|
+
def get_commands_for_sub_projects(self, manifest_file_path: str) -> List[List[str]]:
|
|
64
|
+
project_name = os.path.basename(os.path.dirname(manifest_file_path))
|
|
65
|
+
project_name = f':{project_name}'
|
|
66
|
+
return (
|
|
67
|
+
[['gradle', f'{project_name}:dependencies', '-q', '--console', 'plain']]
|
|
68
|
+
if project_name in self.projects
|
|
69
|
+
else []
|
|
70
|
+
)
|
|
@@ -50,7 +50,8 @@ def run_parallel_batched_scan(
|
|
|
50
50
|
progress_bar: 'BaseProgressBar',
|
|
51
51
|
) -> Tuple[Dict[str, 'CliError'], List['LocalScanResult']]:
|
|
52
52
|
max_size = consts.SCAN_BATCH_MAX_SIZE_IN_BYTES.get(scan_type, consts.DEFAULT_SCAN_BATCH_MAX_SIZE_IN_BYTES)
|
|
53
|
-
|
|
53
|
+
|
|
54
|
+
batches = [documents] if scan_type == consts.SCA_SCAN_TYPE else split_documents_into_batches(documents, max_size)
|
|
54
55
|
|
|
55
56
|
progress_bar.set_section_length(ScanProgressBarSection.SCAN, len(batches)) # * 3
|
|
56
57
|
# TODO(MarshalX): we should multiply the count of batches in SCAN section because each batch has 3 steps:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "cycode"
|
|
3
|
-
version = "2.2.1.
|
|
3
|
+
version = "2.2.1.dev5" # DON'T TOUCH. Placeholder. Will be filled automatically on poetry build from Git Tag
|
|
4
4
|
description = "Boost security in your dev lifecycle via SAST, SCA, Secrets & IaC scanning."
|
|
5
5
|
keywords=["secret-scan", "cycode", "devops", "token", "secret", "security", "cycode", "code"]
|
|
6
6
|
authors = ["Cycode <support@cycode.com>"]
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = '2.2.1.dev3' # DON'T TOUCH. Placeholder. Will be filled automatically on poetry build from Git Tag
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import os
|
|
2
|
-
from typing import List
|
|
3
|
-
|
|
4
|
-
import click
|
|
5
|
-
|
|
6
|
-
from cycode.cli.files_collector.sca.base_restore_dependencies import BaseRestoreDependencies
|
|
7
|
-
from cycode.cli.models import Document
|
|
8
|
-
|
|
9
|
-
BUILD_GRADLE_FILE_NAME = 'build.gradle'
|
|
10
|
-
BUILD_GRADLE_KTS_FILE_NAME = 'build.gradle.kts'
|
|
11
|
-
BUILD_GRADLE_DEP_TREE_FILE_NAME = 'gradle-dependencies-generated.txt'
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
class RestoreGradleDependencies(BaseRestoreDependencies):
|
|
15
|
-
def __init__(self, context: click.Context, is_git_diff: bool, command_timeout: int) -> None:
|
|
16
|
-
super().__init__(context, is_git_diff, command_timeout, create_output_file_manually=True)
|
|
17
|
-
|
|
18
|
-
def is_project(self, document: Document) -> bool:
|
|
19
|
-
return document.path.endswith(BUILD_GRADLE_FILE_NAME) or document.path.endswith(BUILD_GRADLE_KTS_FILE_NAME)
|
|
20
|
-
|
|
21
|
-
def get_commands(self, manifest_file_path: str) -> List[List[str]]:
|
|
22
|
-
return [['gradle', 'dependencies', '-b', manifest_file_path, '-q', '--console', 'plain']]
|
|
23
|
-
|
|
24
|
-
def get_lock_file_name(self) -> str:
|
|
25
|
-
return BUILD_GRADLE_DEP_TREE_FILE_NAME
|
|
26
|
-
|
|
27
|
-
def verify_restore_file_already_exist(self, restore_file_path: str) -> bool:
|
|
28
|
-
return os.path.isfile(restore_file_path)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/commands/ai_remediation/ai_remediation_command.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
|
{cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/commands/report/sbom/path/path_command.py
RENAMED
|
File without changes
|
{cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/commands/report/sbom/repository_url/__init__.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
|
{cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/commands/scan/pre_commit/pre_commit_command.py
RENAMED
|
File without changes
|
|
File without changes
|
{cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/commands/scan/pre_receive/pre_receive_command.py
RENAMED
|
File without changes
|
|
File without changes
|
{cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/commands/scan/repository/repository_command.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
|
{cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/exceptions/handle_ai_remediation_errors.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/files_collector/iac/tf_content_generator.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/files_collector/sca/base_restore_dependencies.py
RENAMED
|
File without changes
|
|
File without changes
|
{cycode-2.2.1.dev3 → cycode-2.2.1.dev5}/cycode/cli/files_collector/sca/go/restore_go_dependencies.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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|