cycode 3.9.1.dev1__py3-none-any.whl → 3.9.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- cycode/__init__.py +1 -1
- cycode/cli/app.py +0 -4
- cycode/cli/apps/ai_guardrails/install_command.py +1 -4
- cycode/cli/apps/ai_guardrails/scan/payload.py +3 -3
- cycode/cli/apps/ai_guardrails/scan/response_builders.py +2 -5
- cycode/cli/apps/ai_guardrails/scan/scan_command.py +1 -4
- cycode/cli/apps/ai_guardrails/status_command.py +1 -4
- cycode/cli/apps/ai_guardrails/uninstall_command.py +1 -4
- cycode/cli/apps/auth/auth_command.py +0 -2
- cycode/cli/apps/configure/configure_command.py +0 -3
- cycode/cli/apps/ignore/ignore_command.py +0 -3
- cycode/cli/apps/mcp/mcp_command.py +0 -3
- cycode/cli/apps/report/report_command.py +0 -2
- cycode/cli/apps/report/sbom/path/path_command.py +0 -3
- cycode/cli/apps/report/sbom/repository_url/repository_url_command.py +0 -3
- cycode/cli/apps/report/sbom/sbom_command.py +0 -3
- cycode/cli/apps/report_import/report_import_command.py +0 -3
- cycode/cli/apps/report_import/sbom/sbom_command.py +0 -3
- cycode/cli/apps/scan/commit_history/commit_history_command.py +0 -3
- cycode/cli/apps/scan/path/path_command.py +0 -3
- cycode/cli/apps/scan/pre_commit/pre_commit_command.py +0 -3
- cycode/cli/apps/scan/pre_push/pre_push_command.py +0 -3
- cycode/cli/apps/scan/pre_receive/pre_receive_command.py +0 -3
- cycode/cli/apps/scan/repository/repository_command.py +0 -3
- cycode/cli/apps/scan/scan_ci/scan_ci_command.py +0 -2
- cycode/cli/apps/scan/scan_command.py +0 -4
- cycode/cli/consts.py +0 -8
- cycode/cli/exceptions/handle_errors.py +0 -3
- cycode/cli/user_settings/credentials_manager.py +0 -5
- cycode/cyclient/headers.py +0 -3
- {cycode-3.9.1.dev1.dist-info → cycode-3.9.2.dist-info}/METADATA +1 -2
- {cycode-3.9.1.dev1.dist-info → cycode-3.9.2.dist-info}/RECORD +35 -36
- cycode/cli/utils/sentry.py +0 -112
- {cycode-3.9.1.dev1.dist-info → cycode-3.9.2.dist-info}/WHEEL +0 -0
- {cycode-3.9.1.dev1.dist-info → cycode-3.9.2.dist-info}/entry_points.txt +0 -0
- {cycode-3.9.1.dev1.dist-info → cycode-3.9.2.dist-info}/licenses/LICENCE +0 -0
cycode/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = '3.9.
|
|
1
|
+
__version__ = '3.9.2' # DON'T TOUCH. Placeholder. Will be filled automatically on poetry build from Git Tag
|
cycode/cli/app.py
CHANGED
|
@@ -19,7 +19,6 @@ from cycode.cli.consts import CLI_CONTEXT_SETTINGS
|
|
|
19
19
|
from cycode.cli.printers import ConsolePrinter
|
|
20
20
|
from cycode.cli.user_settings.configuration_manager import ConfigurationManager
|
|
21
21
|
from cycode.cli.utils.progress_bar import SCAN_PROGRESS_BAR_SECTIONS, get_progress_bar
|
|
22
|
-
from cycode.cli.utils.sentry import add_breadcrumb, init_sentry
|
|
23
22
|
from cycode.cli.utils.version_checker import version_checker
|
|
24
23
|
from cycode.cyclient.cycode_client_base import CycodeClientBase
|
|
25
24
|
from cycode.cyclient.models import UserAgentOptionScheme
|
|
@@ -143,9 +142,6 @@ def app_callback(
|
|
|
143
142
|
] = None,
|
|
144
143
|
) -> None:
|
|
145
144
|
"""[bold cyan]Cycode CLI - Command Line Interface for Cycode.[/]"""
|
|
146
|
-
init_sentry()
|
|
147
|
-
add_breadcrumb('cycode')
|
|
148
|
-
|
|
149
145
|
ctx.ensure_object(dict)
|
|
150
146
|
configuration_manager = ConfigurationManager()
|
|
151
147
|
|
|
@@ -13,7 +13,6 @@ from cycode.cli.apps.ai_guardrails.command_utils import (
|
|
|
13
13
|
)
|
|
14
14
|
from cycode.cli.apps.ai_guardrails.consts import IDE_CONFIGS, AIIDEType
|
|
15
15
|
from cycode.cli.apps.ai_guardrails.hooks_manager import install_hooks
|
|
16
|
-
from cycode.cli.utils.sentry import add_breadcrumb
|
|
17
16
|
|
|
18
17
|
|
|
19
18
|
def install_command(
|
|
@@ -32,7 +31,7 @@ def install_command(
|
|
|
32
31
|
'--ide',
|
|
33
32
|
help='IDE to install hooks for (e.g., "cursor", "claude-code", or "all" for all IDEs). Defaults to cursor.',
|
|
34
33
|
),
|
|
35
|
-
] = AIIDEType.CURSOR,
|
|
34
|
+
] = AIIDEType.CURSOR.value,
|
|
36
35
|
repo_path: Annotated[
|
|
37
36
|
Optional[Path],
|
|
38
37
|
typer.Option(
|
|
@@ -57,8 +56,6 @@ def install_command(
|
|
|
57
56
|
cycode ai-guardrails install --ide all # Install for all supported IDEs
|
|
58
57
|
cycode ai-guardrails install --scope repo --repo-path /path/to/repo
|
|
59
58
|
"""
|
|
60
|
-
add_breadcrumb('ai-guardrails-install')
|
|
61
|
-
|
|
62
59
|
# Validate inputs
|
|
63
60
|
validate_scope(scope)
|
|
64
61
|
repo_path = resolve_repo_path(scope, repo_path)
|
|
@@ -155,7 +155,7 @@ class AIHookPayload:
|
|
|
155
155
|
generation_id=payload.get('generation_id'),
|
|
156
156
|
ide_user_email=payload.get('user_email'),
|
|
157
157
|
model=payload.get('model'),
|
|
158
|
-
ide_provider=AIIDEType.CURSOR,
|
|
158
|
+
ide_provider=AIIDEType.CURSOR.value,
|
|
159
159
|
ide_version=payload.get('cursor_version'),
|
|
160
160
|
prompt=payload.get('prompt', ''),
|
|
161
161
|
file_path=payload.get('file_path') or payload.get('path'),
|
|
@@ -213,7 +213,7 @@ class AIHookPayload:
|
|
|
213
213
|
generation_id=generation_id,
|
|
214
214
|
ide_user_email=None, # Claude Code doesn't provide this in hook payload
|
|
215
215
|
model=model,
|
|
216
|
-
ide_provider=AIIDEType.CLAUDE_CODE,
|
|
216
|
+
ide_provider=AIIDEType.CLAUDE_CODE.value,
|
|
217
217
|
ide_version=ide_version,
|
|
218
218
|
prompt=payload.get('prompt', ''),
|
|
219
219
|
file_path=file_path,
|
|
@@ -248,7 +248,7 @@ class AIHookPayload:
|
|
|
248
248
|
return True
|
|
249
249
|
|
|
250
250
|
@classmethod
|
|
251
|
-
def from_payload(cls, payload: dict, tool: str = AIIDEType.CURSOR) -> 'AIHookPayload':
|
|
251
|
+
def from_payload(cls, payload: dict, tool: str = AIIDEType.CURSOR.value) -> 'AIHookPayload':
|
|
252
252
|
"""Create AIHookPayload from any tool's payload.
|
|
253
253
|
|
|
254
254
|
Args:
|
|
@@ -117,7 +117,7 @@ _RESPONSE_BUILDERS: dict[str, IDEResponseBuilder] = {
|
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
|
|
120
|
-
def get_response_builder(ide: str = AIIDEType.CURSOR) -> IDEResponseBuilder:
|
|
120
|
+
def get_response_builder(ide: str = AIIDEType.CURSOR.value) -> IDEResponseBuilder:
|
|
121
121
|
"""Get the response builder for a specific IDE.
|
|
122
122
|
|
|
123
123
|
Args:
|
|
@@ -129,10 +129,7 @@ def get_response_builder(ide: str = AIIDEType.CURSOR) -> IDEResponseBuilder:
|
|
|
129
129
|
Raises:
|
|
130
130
|
ValueError: If the IDE is not supported
|
|
131
131
|
"""
|
|
132
|
-
|
|
133
|
-
if isinstance(ide, str):
|
|
134
|
-
ide = ide.lower()
|
|
135
|
-
builder = _RESPONSE_BUILDERS.get(ide)
|
|
132
|
+
builder = _RESPONSE_BUILDERS.get(ide.lower())
|
|
136
133
|
if not builder:
|
|
137
134
|
raise ValueError(f'Unsupported IDE: {ide}. Supported IDEs: {list(_RESPONSE_BUILDERS.keys())}')
|
|
138
135
|
return builder
|
|
@@ -25,7 +25,6 @@ from cycode.cli.apps.ai_guardrails.scan.types import AiHookEventType
|
|
|
25
25
|
from cycode.cli.apps.ai_guardrails.scan.utils import output_json, safe_json_parse
|
|
26
26
|
from cycode.cli.exceptions.custom_exceptions import HttpUnauthorizedError
|
|
27
27
|
from cycode.cli.utils.get_api_client import get_ai_security_manager_client, get_scan_cycode_client
|
|
28
|
-
from cycode.cli.utils.sentry import add_breadcrumb
|
|
29
28
|
from cycode.logger import get_logger
|
|
30
29
|
|
|
31
30
|
logger = get_logger('AI Guardrails')
|
|
@@ -70,7 +69,7 @@ def scan_command(
|
|
|
70
69
|
help='IDE that sent the payload (e.g., "cursor"). Defaults to cursor.',
|
|
71
70
|
hidden=True,
|
|
72
71
|
),
|
|
73
|
-
] = AIIDEType.CURSOR,
|
|
72
|
+
] = AIIDEType.CURSOR.value,
|
|
74
73
|
) -> None:
|
|
75
74
|
"""Scan content from AI IDE hooks for secrets.
|
|
76
75
|
|
|
@@ -84,8 +83,6 @@ def scan_command(
|
|
|
84
83
|
Example usage (from IDE hooks configuration):
|
|
85
84
|
{ "command": "cycode ai-guardrails scan" }
|
|
86
85
|
"""
|
|
87
|
-
add_breadcrumb('ai-guardrails-scan')
|
|
88
|
-
|
|
89
86
|
stdin_data = sys.stdin.read().strip()
|
|
90
87
|
payload = safe_json_parse(stdin_data)
|
|
91
88
|
|
|
@@ -10,7 +10,6 @@ from rich.table import Table
|
|
|
10
10
|
from cycode.cli.apps.ai_guardrails.command_utils import console, validate_and_parse_ide, validate_scope
|
|
11
11
|
from cycode.cli.apps.ai_guardrails.consts import IDE_CONFIGS, AIIDEType
|
|
12
12
|
from cycode.cli.apps.ai_guardrails.hooks_manager import get_hooks_status
|
|
13
|
-
from cycode.cli.utils.sentry import add_breadcrumb
|
|
14
13
|
|
|
15
14
|
|
|
16
15
|
def status_command(
|
|
@@ -29,7 +28,7 @@ def status_command(
|
|
|
29
28
|
'--ide',
|
|
30
29
|
help='IDE to check status for (e.g., "cursor", "claude-code", or "all" for all IDEs). Defaults to cursor.',
|
|
31
30
|
),
|
|
32
|
-
] = AIIDEType.CURSOR,
|
|
31
|
+
] = AIIDEType.CURSOR.value,
|
|
33
32
|
repo_path: Annotated[
|
|
34
33
|
Optional[Path],
|
|
35
34
|
typer.Option(
|
|
@@ -53,8 +52,6 @@ def status_command(
|
|
|
53
52
|
cycode ai-guardrails status --ide cursor # Check status for Cursor IDE
|
|
54
53
|
cycode ai-guardrails status --ide all # Check status for all supported IDEs
|
|
55
54
|
"""
|
|
56
|
-
add_breadcrumb('ai-guardrails-status')
|
|
57
|
-
|
|
58
55
|
# Validate inputs (status allows 'all' scope)
|
|
59
56
|
validate_scope(scope, allowed_scopes=('user', 'repo', 'all'))
|
|
60
57
|
if repo_path is None:
|
|
@@ -13,7 +13,6 @@ from cycode.cli.apps.ai_guardrails.command_utils import (
|
|
|
13
13
|
)
|
|
14
14
|
from cycode.cli.apps.ai_guardrails.consts import IDE_CONFIGS, AIIDEType
|
|
15
15
|
from cycode.cli.apps.ai_guardrails.hooks_manager import uninstall_hooks
|
|
16
|
-
from cycode.cli.utils.sentry import add_breadcrumb
|
|
17
16
|
|
|
18
17
|
|
|
19
18
|
def uninstall_command(
|
|
@@ -32,7 +31,7 @@ def uninstall_command(
|
|
|
32
31
|
'--ide',
|
|
33
32
|
help='IDE to uninstall hooks from (e.g., "cursor", "claude-code", "all"). Defaults to cursor.',
|
|
34
33
|
),
|
|
35
|
-
] = AIIDEType.CURSOR,
|
|
34
|
+
] = AIIDEType.CURSOR.value,
|
|
36
35
|
repo_path: Annotated[
|
|
37
36
|
Optional[Path],
|
|
38
37
|
typer.Option(
|
|
@@ -56,8 +55,6 @@ def uninstall_command(
|
|
|
56
55
|
cycode ai-guardrails uninstall --ide cursor # Uninstall from Cursor IDE
|
|
57
56
|
cycode ai-guardrails uninstall --ide all # Uninstall from all supported IDEs
|
|
58
57
|
"""
|
|
59
|
-
add_breadcrumb('ai-guardrails-uninstall')
|
|
60
|
-
|
|
61
58
|
# Validate inputs
|
|
62
59
|
validate_scope(scope)
|
|
63
60
|
repo_path = resolve_repo_path(scope, repo_path)
|
|
@@ -4,7 +4,6 @@ from cycode.cli.apps.auth.auth_manager import AuthManager
|
|
|
4
4
|
from cycode.cli.exceptions.handle_auth_errors import handle_auth_exception
|
|
5
5
|
from cycode.cli.logger import logger
|
|
6
6
|
from cycode.cli.models import CliResult
|
|
7
|
-
from cycode.cli.utils.sentry import add_breadcrumb
|
|
8
7
|
|
|
9
8
|
|
|
10
9
|
def auth_command(ctx: typer.Context) -> None:
|
|
@@ -16,7 +15,6 @@ def auth_command(ctx: typer.Context) -> None:
|
|
|
16
15
|
* `cycode auth`: Start interactive authentication
|
|
17
16
|
* `cycode auth --help`: View authentication options
|
|
18
17
|
"""
|
|
19
|
-
add_breadcrumb('auth')
|
|
20
18
|
printer = ctx.obj.get('console_printer')
|
|
21
19
|
|
|
22
20
|
try:
|
|
@@ -10,7 +10,6 @@ from cycode.cli.apps.configure.prompts import (
|
|
|
10
10
|
get_id_token_input,
|
|
11
11
|
)
|
|
12
12
|
from cycode.cli.console import console
|
|
13
|
-
from cycode.cli.utils.sentry import add_breadcrumb
|
|
14
13
|
|
|
15
14
|
|
|
16
15
|
def _should_update_value(
|
|
@@ -39,8 +38,6 @@ def configure_command() -> None:
|
|
|
39
38
|
* `cycode configure`: Start interactive configuration
|
|
40
39
|
* `cycode configure --help`: View configuration options
|
|
41
40
|
"""
|
|
42
|
-
add_breadcrumb('configure')
|
|
43
|
-
|
|
44
41
|
global_config_manager = CONFIGURATION_MANAGER.global_config_file_manager
|
|
45
42
|
|
|
46
43
|
current_api_url = global_config_manager.get_api_url()
|
|
@@ -9,7 +9,6 @@ from cycode.cli.cli_types import ScanTypeOption
|
|
|
9
9
|
from cycode.cli.config import configuration_manager
|
|
10
10
|
from cycode.cli.logger import logger
|
|
11
11
|
from cycode.cli.utils.path_utils import get_absolute_path, is_path_exists
|
|
12
|
-
from cycode.cli.utils.sentry import add_breadcrumb
|
|
13
12
|
from cycode.cli.utils.string_utils import hash_string_to_sha256
|
|
14
13
|
|
|
15
14
|
_FILTER_BY_RICH_HELP_PANEL = 'Filter options'
|
|
@@ -97,8 +96,6 @@ def ignore_command( # noqa: C901
|
|
|
97
96
|
* `cycode ignore --by-rule GUID`: Ignore rule with the specified GUID
|
|
98
97
|
* `cycode ignore --by-package lodash@4.17.21`: Ignore lodash version 4.17.21
|
|
99
98
|
"""
|
|
100
|
-
add_breadcrumb('ignore')
|
|
101
|
-
|
|
102
99
|
all_by_values = [by_value, by_sha, by_path, by_rule, by_package, by_cve]
|
|
103
100
|
if all(by is None for by in all_by_values):
|
|
104
101
|
raise click.ClickException('Ignore by type is missing')
|
|
@@ -13,7 +13,6 @@ from pathvalidate import sanitize_filepath
|
|
|
13
13
|
from pydantic import Field
|
|
14
14
|
|
|
15
15
|
from cycode.cli.cli_types import McpTransportOption, ScanTypeOption
|
|
16
|
-
from cycode.cli.utils.sentry import add_breadcrumb
|
|
17
16
|
from cycode.logger import LoggersManager, get_logger
|
|
18
17
|
|
|
19
18
|
try:
|
|
@@ -381,8 +380,6 @@ def mcp_command(
|
|
|
381
380
|
cycode mcp # Start with default transport (stdio)
|
|
382
381
|
cycode mcp -t sse -p 8080 # Start with Server-Sent Events (SSE) transport on port 8080
|
|
383
382
|
"""
|
|
384
|
-
add_breadcrumb('mcp')
|
|
385
|
-
|
|
386
383
|
try:
|
|
387
384
|
_run_mcp_server(transport, host, port)
|
|
388
385
|
except Exception as e:
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import typer
|
|
2
2
|
|
|
3
3
|
from cycode.cli.utils.progress_bar import SBOM_REPORT_PROGRESS_BAR_SECTIONS, get_progress_bar
|
|
4
|
-
from cycode.cli.utils.sentry import add_breadcrumb
|
|
5
4
|
|
|
6
5
|
|
|
7
6
|
def report_command(ctx: typer.Context) -> int:
|
|
@@ -10,6 +9,5 @@ def report_command(ctx: typer.Context) -> int:
|
|
|
10
9
|
Example usage:
|
|
11
10
|
* `cycode report sbom`: Generate SBOM report
|
|
12
11
|
"""
|
|
13
|
-
add_breadcrumb('report')
|
|
14
12
|
ctx.obj['progress_bar'] = get_progress_bar(hidden=False, sections=SBOM_REPORT_PROGRESS_BAR_SECTIONS)
|
|
15
13
|
return 1
|
|
@@ -13,7 +13,6 @@ 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
15
|
from cycode.cli.utils.scan_utils import is_cycodeignore_allowed_by_scan_config
|
|
16
|
-
from cycode.cli.utils.sentry import add_breadcrumb
|
|
17
16
|
|
|
18
17
|
|
|
19
18
|
def path_command(
|
|
@@ -23,8 +22,6 @@ def path_command(
|
|
|
23
22
|
typer.Argument(exists=True, resolve_path=True, help='Path to generate SBOM report for.', show_default=False),
|
|
24
23
|
],
|
|
25
24
|
) -> None:
|
|
26
|
-
add_breadcrumb('path')
|
|
27
|
-
|
|
28
25
|
client = get_report_cycode_client(ctx)
|
|
29
26
|
report_parameters = ctx.obj['report_parameters']
|
|
30
27
|
output_format = report_parameters.output_format
|
|
@@ -7,7 +7,6 @@ from cycode.cli.apps.report.sbom.common import create_sbom_report, send_report_f
|
|
|
7
7
|
from cycode.cli.exceptions.handle_report_sbom_errors import handle_report_exception
|
|
8
8
|
from cycode.cli.utils.get_api_client import get_report_cycode_client
|
|
9
9
|
from cycode.cli.utils.progress_bar import SbomReportProgressBarSection
|
|
10
|
-
from cycode.cli.utils.sentry import add_breadcrumb
|
|
11
10
|
from cycode.cli.utils.url_utils import sanitize_repository_url
|
|
12
11
|
from cycode.logger import get_logger
|
|
13
12
|
|
|
@@ -18,8 +17,6 @@ def repository_url_command(
|
|
|
18
17
|
ctx: typer.Context,
|
|
19
18
|
uri: Annotated[str, typer.Argument(help='Repository URL to generate SBOM report for.', show_default=False)],
|
|
20
19
|
) -> None:
|
|
21
|
-
add_breadcrumb('repository_url')
|
|
22
|
-
|
|
23
20
|
progress_bar = ctx.obj['progress_bar']
|
|
24
21
|
progress_bar.start()
|
|
25
22
|
progress_bar.set_section_length(SbomReportProgressBarSection.PREPARE_LOCAL_FILES)
|
|
@@ -5,7 +5,6 @@ import click
|
|
|
5
5
|
import typer
|
|
6
6
|
|
|
7
7
|
from cycode.cli.cli_types import SbomFormatOption, SbomOutputFormatOption
|
|
8
|
-
from cycode.cli.utils.sentry import add_breadcrumb
|
|
9
8
|
from cycode.cyclient.report_client import ReportParameters
|
|
10
9
|
|
|
11
10
|
_OUTPUT_RICH_HELP_PANEL = 'Output options'
|
|
@@ -50,8 +49,6 @@ def sbom_command(
|
|
|
50
49
|
] = False,
|
|
51
50
|
) -> int:
|
|
52
51
|
"""Generate SBOM report."""
|
|
53
|
-
add_breadcrumb('sbom')
|
|
54
|
-
|
|
55
52
|
sbom_format_parts = sbom_format.split('-')
|
|
56
53
|
if len(sbom_format_parts) != 2:
|
|
57
54
|
raise click.ClickException('Invalid SBOM format.')
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import typer
|
|
2
2
|
|
|
3
|
-
from cycode.cli.utils.sentry import add_breadcrumb
|
|
4
|
-
|
|
5
3
|
|
|
6
4
|
def report_import_command(ctx: typer.Context) -> int:
|
|
7
5
|
""":bar_chart: [bold cyan]Import security reports.[/]
|
|
@@ -9,5 +7,4 @@ def report_import_command(ctx: typer.Context) -> int:
|
|
|
9
7
|
Example usage:
|
|
10
8
|
* `cycode import sbom`: Import SBOM report
|
|
11
9
|
"""
|
|
12
|
-
add_breadcrumb('import')
|
|
13
10
|
return 1
|
|
@@ -6,7 +6,6 @@ import typer
|
|
|
6
6
|
from cycode.cli.cli_types import BusinessImpactOption
|
|
7
7
|
from cycode.cli.exceptions.handle_report_sbom_errors import handle_report_exception
|
|
8
8
|
from cycode.cli.utils.get_api_client import get_import_sbom_cycode_client
|
|
9
|
-
from cycode.cli.utils.sentry import add_breadcrumb
|
|
10
9
|
from cycode.cyclient.import_sbom_client import ImportSbomParameters
|
|
11
10
|
|
|
12
11
|
|
|
@@ -52,8 +51,6 @@ def sbom_command(
|
|
|
52
51
|
] = BusinessImpactOption.MEDIUM,
|
|
53
52
|
) -> None:
|
|
54
53
|
"""Import SBOM."""
|
|
55
|
-
add_breadcrumb('sbom')
|
|
56
|
-
|
|
57
54
|
client = get_import_sbom_cycode_client(ctx)
|
|
58
55
|
|
|
59
56
|
import_parameters = ImportSbomParameters(
|
|
@@ -6,7 +6,6 @@ import typer
|
|
|
6
6
|
from cycode.cli.apps.scan.commit_range_scanner import scan_commit_range
|
|
7
7
|
from cycode.cli.exceptions.handle_scan_errors import handle_scan_exception
|
|
8
8
|
from cycode.cli.logger import logger
|
|
9
|
-
from cycode.cli.utils.sentry import add_breadcrumb
|
|
10
9
|
|
|
11
10
|
|
|
12
11
|
def commit_history_command(
|
|
@@ -25,8 +24,6 @@ def commit_history_command(
|
|
|
25
24
|
] = '--all',
|
|
26
25
|
) -> None:
|
|
27
26
|
try:
|
|
28
|
-
add_breadcrumb('commit_history')
|
|
29
|
-
|
|
30
27
|
logger.debug('Starting commit history scan process, %s', {'path': path, 'commit_range': commit_range})
|
|
31
28
|
scan_commit_range(ctx, repo_path=str(path), commit_range=commit_range)
|
|
32
29
|
except Exception as e:
|
|
@@ -5,7 +5,6 @@ import typer
|
|
|
5
5
|
|
|
6
6
|
from cycode.cli.apps.scan.code_scanner import scan_disk_files
|
|
7
7
|
from cycode.cli.logger import logger
|
|
8
|
-
from cycode.cli.utils.sentry import add_breadcrumb
|
|
9
8
|
|
|
10
9
|
|
|
11
10
|
def path_command(
|
|
@@ -14,8 +13,6 @@ def path_command(
|
|
|
14
13
|
list[Path], typer.Argument(exists=True, resolve_path=True, help='Paths to scan', show_default=False)
|
|
15
14
|
],
|
|
16
15
|
) -> None:
|
|
17
|
-
add_breadcrumb('path')
|
|
18
|
-
|
|
19
16
|
progress_bar = ctx.obj['progress_bar']
|
|
20
17
|
progress_bar.start()
|
|
21
18
|
|
|
@@ -4,15 +4,12 @@ from typing import Annotated, Optional
|
|
|
4
4
|
import typer
|
|
5
5
|
|
|
6
6
|
from cycode.cli.apps.scan.commit_range_scanner import scan_pre_commit
|
|
7
|
-
from cycode.cli.utils.sentry import add_breadcrumb
|
|
8
7
|
|
|
9
8
|
|
|
10
9
|
def pre_commit_command(
|
|
11
10
|
ctx: typer.Context,
|
|
12
11
|
_: Annotated[Optional[list[str]], typer.Argument(help='Ignored arguments', hidden=True)] = None,
|
|
13
12
|
) -> None:
|
|
14
|
-
add_breadcrumb('pre_commit')
|
|
15
|
-
|
|
16
13
|
repo_path = os.getcwd() # change locally for easy testing
|
|
17
14
|
|
|
18
15
|
progress_bar = ctx.obj['progress_bar']
|
|
@@ -19,7 +19,6 @@ from cycode.cli.files_collector.commit_range_documents import (
|
|
|
19
19
|
)
|
|
20
20
|
from cycode.cli.logger import logger
|
|
21
21
|
from cycode.cli.utils import scan_utils
|
|
22
|
-
from cycode.cli.utils.sentry import add_breadcrumb
|
|
23
22
|
from cycode.cli.utils.task_timer import TimeoutAfter
|
|
24
23
|
from cycode.logger import set_logging_level
|
|
25
24
|
|
|
@@ -29,8 +28,6 @@ def pre_push_command(
|
|
|
29
28
|
_: Annotated[Optional[list[str]], typer.Argument(help='Ignored arguments', hidden=True)] = None,
|
|
30
29
|
) -> None:
|
|
31
30
|
try:
|
|
32
|
-
add_breadcrumb('pre_push')
|
|
33
|
-
|
|
34
31
|
if should_skip_pre_receive_scan():
|
|
35
32
|
logger.info(
|
|
36
33
|
'A scan has been skipped as per your request. '
|
|
@@ -19,7 +19,6 @@ from cycode.cli.files_collector.commit_range_documents import (
|
|
|
19
19
|
)
|
|
20
20
|
from cycode.cli.logger import logger
|
|
21
21
|
from cycode.cli.utils import scan_utils
|
|
22
|
-
from cycode.cli.utils.sentry import add_breadcrumb
|
|
23
22
|
from cycode.cli.utils.task_timer import TimeoutAfter
|
|
24
23
|
from cycode.logger import set_logging_level
|
|
25
24
|
|
|
@@ -29,8 +28,6 @@ def pre_receive_command(
|
|
|
29
28
|
_: Annotated[Optional[list[str]], typer.Argument(help='Ignored arguments', hidden=True)] = None,
|
|
30
29
|
) -> None:
|
|
31
30
|
try:
|
|
32
|
-
add_breadcrumb('pre_receive')
|
|
33
|
-
|
|
34
31
|
if should_skip_pre_receive_scan():
|
|
35
32
|
logger.info(
|
|
36
33
|
'A scan has been skipped as per your request. '
|
|
@@ -17,7 +17,6 @@ from cycode.cli.models import Document
|
|
|
17
17
|
from cycode.cli.utils.path_utils import get_path_by_os
|
|
18
18
|
from cycode.cli.utils.progress_bar import ScanProgressBarSection
|
|
19
19
|
from cycode.cli.utils.scan_utils import is_cycodeignore_allowed_by_scan_config
|
|
20
|
-
from cycode.cli.utils.sentry import add_breadcrumb
|
|
21
20
|
|
|
22
21
|
|
|
23
22
|
def repository_command(
|
|
@@ -30,8 +29,6 @@ def repository_command(
|
|
|
30
29
|
] = None,
|
|
31
30
|
) -> None:
|
|
32
31
|
try:
|
|
33
|
-
add_breadcrumb('repository')
|
|
34
|
-
|
|
35
32
|
logger.debug('Starting repository scan process, %s', {'path': path, 'branch': branch})
|
|
36
33
|
|
|
37
34
|
scan_type = ctx.obj['scan_type']
|
|
@@ -5,7 +5,6 @@ import typer
|
|
|
5
5
|
|
|
6
6
|
from cycode.cli.apps.scan.commit_range_scanner import scan_commit_range
|
|
7
7
|
from cycode.cli.apps.scan.scan_ci.ci_integrations import get_commit_range
|
|
8
|
-
from cycode.cli.utils.sentry import add_breadcrumb
|
|
9
8
|
|
|
10
9
|
# This command is not finished yet. It is not used in the codebase.
|
|
11
10
|
|
|
@@ -16,5 +15,4 @@ from cycode.cli.utils.sentry import add_breadcrumb
|
|
|
16
15
|
)
|
|
17
16
|
@click.pass_context
|
|
18
17
|
def scan_ci_command(ctx: typer.Context) -> None:
|
|
19
|
-
add_breadcrumb('ci')
|
|
20
18
|
scan_commit_range(ctx, repo_path=os.getcwd(), commit_range=get_commit_range())
|
|
@@ -14,7 +14,6 @@ from cycode.cli.consts import (
|
|
|
14
14
|
from cycode.cli.files_collector.file_excluder import excluder
|
|
15
15
|
from cycode.cli.utils import scan_utils
|
|
16
16
|
from cycode.cli.utils.get_api_client import get_scan_cycode_client
|
|
17
|
-
from cycode.cli.utils.sentry import add_breadcrumb
|
|
18
17
|
|
|
19
18
|
_EXPORT_RICH_HELP_PANEL = 'Export options'
|
|
20
19
|
_SCA_RICH_HELP_PANEL = 'SCA options'
|
|
@@ -136,8 +135,6 @@ def scan_command(
|
|
|
136
135
|
* `cycode scan commit-history <PATH>`: Scan the commit history of a local Git repository.
|
|
137
136
|
|
|
138
137
|
"""
|
|
139
|
-
add_breadcrumb('scan')
|
|
140
|
-
|
|
141
138
|
if export_file and export_type is None:
|
|
142
139
|
raise typer.BadParameter(
|
|
143
140
|
'Export type must be specified when --export-file is provided.',
|
|
@@ -186,7 +183,6 @@ def _sca_scan_to_context(ctx: typer.Context, sca_scan_user_selected: list[str])
|
|
|
186
183
|
|
|
187
184
|
@click.pass_context
|
|
188
185
|
def scan_command_result_callback(ctx: click.Context, *_, **__) -> None:
|
|
189
|
-
add_breadcrumb('scan_finalized')
|
|
190
186
|
ctx.obj['scan_finalized'] = True
|
|
191
187
|
|
|
192
188
|
progress_bar = ctx.obj.get('progress_bar')
|
cycode/cli/consts.py
CHANGED
|
@@ -210,14 +210,6 @@ SCAN_BATCH_MAX_FILES_COUNT_ENV_VAR_NAME = 'SCAN_BATCH_MAX_FILES_COUNT'
|
|
|
210
210
|
SCAN_BATCH_MAX_PARALLEL_SCANS = 5
|
|
211
211
|
SCAN_BATCH_SCANS_PER_CPU = 1
|
|
212
212
|
|
|
213
|
-
# sentry
|
|
214
|
-
SENTRY_DSN = 'https://5e26b304b30ced3a34394b6f81f1076d@o1026942.ingest.us.sentry.io/4507543840096256'
|
|
215
|
-
SENTRY_DEBUG = False
|
|
216
|
-
SENTRY_SAMPLE_RATE = 1.0
|
|
217
|
-
SENTRY_SEND_DEFAULT_PII = False
|
|
218
|
-
SENTRY_INCLUDE_LOCAL_VARIABLES = False
|
|
219
|
-
SENTRY_MAX_REQUEST_BODY_SIZE = 'never'
|
|
220
|
-
|
|
221
213
|
# sync scans
|
|
222
214
|
SYNC_SCAN_TIMEOUT_IN_SECONDS_ENV_VAR_NAME = 'SYNC_SCAN_TIMEOUT_IN_SECONDS'
|
|
223
215
|
DEFAULT_SYNC_SCAN_TIMEOUT_IN_SECONDS = 180
|
|
@@ -4,7 +4,6 @@ import click
|
|
|
4
4
|
import typer
|
|
5
5
|
|
|
6
6
|
from cycode.cli.models import CliError, CliErrors
|
|
7
|
-
from cycode.cli.utils.sentry import capture_exception
|
|
8
7
|
|
|
9
8
|
|
|
10
9
|
def handle_errors(
|
|
@@ -28,8 +27,6 @@ def handle_errors(
|
|
|
28
27
|
if isinstance(err, click.ClickException):
|
|
29
28
|
raise err
|
|
30
29
|
|
|
31
|
-
capture_exception(err)
|
|
32
|
-
|
|
33
30
|
unknown_error = CliError(code='unknown_error', message=str(err))
|
|
34
31
|
if return_exception:
|
|
35
32
|
return unknown_error
|
|
@@ -9,7 +9,6 @@ from cycode.cli.config import (
|
|
|
9
9
|
)
|
|
10
10
|
from cycode.cli.user_settings.base_file_manager import BaseFileManager
|
|
11
11
|
from cycode.cli.user_settings.jwt_creator import JwtCreator
|
|
12
|
-
from cycode.cli.utils.sentry import setup_scope_from_access_token
|
|
13
12
|
|
|
14
13
|
|
|
15
14
|
class CredentialsManager(BaseFileManager):
|
|
@@ -77,8 +76,6 @@ class CredentialsManager(BaseFileManager):
|
|
|
77
76
|
if hashed_creator:
|
|
78
77
|
creator = JwtCreator(hashed_creator)
|
|
79
78
|
|
|
80
|
-
setup_scope_from_access_token(access_token)
|
|
81
|
-
|
|
82
79
|
return access_token, expires_in, creator
|
|
83
80
|
|
|
84
81
|
def update_access_token(
|
|
@@ -91,7 +88,5 @@ class CredentialsManager(BaseFileManager):
|
|
|
91
88
|
}
|
|
92
89
|
self.write_content_to_file(file_content_to_update)
|
|
93
90
|
|
|
94
|
-
setup_scope_from_access_token(access_token)
|
|
95
|
-
|
|
96
91
|
def get_filename(self) -> str:
|
|
97
92
|
return os.path.join(self.HOME_PATH, self.CYCODE_HIDDEN_DIRECTORY, self.FILE_NAME)
|
cycode/cyclient/headers.py
CHANGED
|
@@ -5,7 +5,6 @@ from uuid import uuid4
|
|
|
5
5
|
from cycode import __version__
|
|
6
6
|
from cycode.cli import consts
|
|
7
7
|
from cycode.cli.user_settings.configuration_manager import ConfigurationManager
|
|
8
|
-
from cycode.cli.utils.sentry import add_correlation_id_to_scope
|
|
9
8
|
from cycode.cyclient.logger import logger
|
|
10
9
|
|
|
11
10
|
|
|
@@ -42,8 +41,6 @@ class _CorrelationId:
|
|
|
42
41
|
self._id = str(uuid4())
|
|
43
42
|
logger.debug('Correlation ID: %s', self._id)
|
|
44
43
|
|
|
45
|
-
add_correlation_id_to_scope(self._id)
|
|
46
|
-
|
|
47
44
|
return self._id
|
|
48
45
|
|
|
49
46
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cycode
|
|
3
|
-
Version: 3.9.
|
|
3
|
+
Version: 3.9.2
|
|
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
|
|
@@ -34,7 +34,6 @@ Requires-Dist: pyjwt (>=2.8.0,<3.0)
|
|
|
34
34
|
Requires-Dist: pyyaml (>=6.0,<7.0)
|
|
35
35
|
Requires-Dist: requests (>=2.32.4,<3.0)
|
|
36
36
|
Requires-Dist: rich (>=13.9.4,<14)
|
|
37
|
-
Requires-Dist: sentry-sdk (>=2.8.0,<3.0)
|
|
38
37
|
Requires-Dist: tenacity (>=9.0.0,<9.1.0)
|
|
39
38
|
Requires-Dist: typer (>=0.15.3,<0.16.0)
|
|
40
39
|
Requires-Dist: urllib3 (==1.26.19)
|
|
@@ -1,78 +1,78 @@
|
|
|
1
|
-
cycode/__init__.py,sha256=
|
|
1
|
+
cycode/__init__.py,sha256=8VlhVLYkh9TA1H2vCt3Oyi-iHhrRW4SHmZUosEJjRPo,109
|
|
2
2
|
cycode/__main__.py,sha256=Z3bD5yrA7yPvAChcADQrqCaZd0ChGI1gdiwALwbWJ6U,104
|
|
3
3
|
cycode/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
-
cycode/cli/app.py,sha256=
|
|
4
|
+
cycode/cli/app.py,sha256=euQuMmLSM7Flq-mIPrie1ogdk09t1l6R_B6PQE_ib8w,6348
|
|
5
5
|
cycode/cli/apps/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
6
|
cycode/cli/apps/ai_guardrails/__init__.py,sha256=7VsEUYYyqiuJJAV-_Ti_Wudr4SWQZGnoVLBuq8NTvVQ,902
|
|
7
7
|
cycode/cli/apps/ai_guardrails/command_utils.py,sha256=itWoARiiqC-kCJuppBxBwKDjCSnci2m0EG95GQPy3r4,1924
|
|
8
8
|
cycode/cli/apps/ai_guardrails/consts.py,sha256=6V6jdT2R5wR-_lI7h3pJuWkcTWlVsSnssc0K9KOpOA4,3580
|
|
9
9
|
cycode/cli/apps/ai_guardrails/hooks_manager.py,sha256=YiLY8AnNSmPerMCJpjbJkybnkmhZZ_A93TM3glNZpIM,7448
|
|
10
|
-
cycode/cli/apps/ai_guardrails/install_command.py,sha256=
|
|
10
|
+
cycode/cli/apps/ai_guardrails/install_command.py,sha256=hlf1L1jWCmNsE4kxHnAfFSn7uTUOhKzEBzrz1W4hTak,3349
|
|
11
11
|
cycode/cli/apps/ai_guardrails/scan/__init__.py,sha256=qJc82XiQGiAuc1sYY8Ij_A-qXpxgLPuayQq8xWlouMA,48
|
|
12
12
|
cycode/cli/apps/ai_guardrails/scan/consts.py,sha256=drAslw6vW3kxmbCs2qPCUbUPR7PJouT2lsXtu5sD-lQ,1094
|
|
13
13
|
cycode/cli/apps/ai_guardrails/scan/handlers.py,sha256=nVFMGtxNFkfiWlhQlIHmx2T1J4jJcOe-WIFiqxxMgu4,14902
|
|
14
|
-
cycode/cli/apps/ai_guardrails/scan/payload.py,sha256
|
|
14
|
+
cycode/cli/apps/ai_guardrails/scan/payload.py,sha256=-r8BsvP-VPD3XibyIPKreCjJNVXGpe_9ENPF78NlnkQ,10178
|
|
15
15
|
cycode/cli/apps/ai_guardrails/scan/policy.py,sha256=39s8hnxgjny1l6XAO59wsRcAlpW-LG00GUnO0PfqvuY,2566
|
|
16
|
-
cycode/cli/apps/ai_guardrails/scan/response_builders.py,sha256=
|
|
17
|
-
cycode/cli/apps/ai_guardrails/scan/scan_command.py,sha256=
|
|
16
|
+
cycode/cli/apps/ai_guardrails/scan/response_builders.py,sha256=tVFJCnGdqSmyileg-idypOihygct7F6T4KHXYlX8y_c,4653
|
|
17
|
+
cycode/cli/apps/ai_guardrails/scan/scan_command.py,sha256=d6xA6aGAdPAPWqmKmv0iIkR6mtUGy4sCxcFmrVcpNng,5633
|
|
18
18
|
cycode/cli/apps/ai_guardrails/scan/types.py,sha256=H25MKJhAXmp7Mz1YeCIRmAY1Zg5GSpgBq8G1TEI9PFk,1868
|
|
19
19
|
cycode/cli/apps/ai_guardrails/scan/utils.py,sha256=KVfX-NrcM-QW4quLtoNqfmz4GF0FlDs-TkqUOu1hAWM,2057
|
|
20
|
-
cycode/cli/apps/ai_guardrails/status_command.py,sha256=
|
|
21
|
-
cycode/cli/apps/ai_guardrails/uninstall_command.py,sha256=
|
|
20
|
+
cycode/cli/apps/ai_guardrails/status_command.py,sha256=UerHtjIGi6sY4RXGR06Es6jQFQAEWTx2Dvhk784WQIM,3539
|
|
21
|
+
cycode/cli/apps/ai_guardrails/uninstall_command.py,sha256=0qhXNC4PQPqrtt5JmexcM4W6i-VyvObB3DQT_DINM1Q,2969
|
|
22
22
|
cycode/cli/apps/ai_remediation/__init__.py,sha256=8vYthY9RQeJqEni3AIF5sryz8n-XJQ6VNqG4aEFBAdY,553
|
|
23
23
|
cycode/cli/apps/ai_remediation/ai_remediation_command.py,sha256=u1EdebaKCEmzv9fXmnIN0xDSLcCmGyjueYKvYfLOj_8,1549
|
|
24
24
|
cycode/cli/apps/ai_remediation/apply_fix.py,sha256=9zgqiqF9HBQXi7Oz9ZIiANIAuKAMTji1PlNncCEOf5Q,817
|
|
25
25
|
cycode/cli/apps/ai_remediation/print_remediation.py,sha256=nEVkR7gnGIryGEo0NOKzrmqsh4CjLr2QfVt9elsrzGY,590
|
|
26
26
|
cycode/cli/apps/auth/__init__.py,sha256=rjf_rEBS1aS6rzY4Qh75BzOOX9SEHPdJMah-1FJM4DY,447
|
|
27
|
-
cycode/cli/apps/auth/auth_command.py,sha256=
|
|
27
|
+
cycode/cli/apps/auth/auth_command.py,sha256=_N28ahWQxAXZuKhM6PSX_XB0u1w4wdYp-_i8SV9UkqA,926
|
|
28
28
|
cycode/cli/apps/auth/auth_common.py,sha256=bfQXqfv5bcYmc7njWOnG1VGzRU-C7spBv48gxHROCGU,2420
|
|
29
29
|
cycode/cli/apps/auth/auth_manager.py,sha256=ePRI1Nl8HVwcST77LAMuzu4tm4TTIX5b-MACB59LUrQ,4286
|
|
30
30
|
cycode/cli/apps/auth/models.py,sha256=XVWq_9e6tQ9farEs_ks2Hv8B_qJdbuZciO7oe8wdgoY,96
|
|
31
31
|
cycode/cli/apps/configure/__init__.py,sha256=J-XJyC3zFt8vP5LrMoHCExkR8MWFfegt-PE0T28cr40,539
|
|
32
|
-
cycode/cli/apps/configure/configure_command.py,sha256=
|
|
32
|
+
cycode/cli/apps/configure/configure_command.py,sha256=GzhdI4dmZuIxkhlf8pc579xm6YP4IqQz9PZONB-bwZw,3005
|
|
33
33
|
cycode/cli/apps/configure/consts.py,sha256=wm3FV5eHRrg77zQnCRExAvBMfqnWdxb33sIdJeTgOK0,1130
|
|
34
34
|
cycode/cli/apps/configure/messages.py,sha256=hZ4gFyvzPsjXKkYADmdtWl_OcIdZQLIsUSzUrThWMW8,1455
|
|
35
35
|
cycode/cli/apps/configure/prompts.py,sha256=z1KZiVJOlFeWKawFE_RyMOitekzuZqKu9aV6KYGbuBU,1889
|
|
36
36
|
cycode/cli/apps/ignore/__init__.py,sha256=hk1jyJ5ecDeNxHu7gbbbugNiMMS5Y0wmFhi2FiokSHo,220
|
|
37
|
-
cycode/cli/apps/ignore/ignore_command.py,sha256=
|
|
37
|
+
cycode/cli/apps/ignore/ignore_command.py,sha256=eHKR9AKvUqwLi_q1M4cM8iYqhW8yb-y37xPMyUI1qUc,5767
|
|
38
38
|
cycode/cli/apps/mcp/__init__.py,sha256=FMXPnuSH7RV0ZckJt5HgVvTvH8QWApyVOpFzRpAH104,460
|
|
39
|
-
cycode/cli/apps/mcp/mcp_command.py,sha256=
|
|
39
|
+
cycode/cli/apps/mcp/mcp_command.py,sha256=tZzvuQFHpWe4nej5lIxOVFkGiM27tAuQ8AIofeMkZ6I,14289
|
|
40
40
|
cycode/cli/apps/report/__init__.py,sha256=SyrLy-D6-WOCVnieXW0dTZKy3yqCxMaqEcJLjo81nPQ,320
|
|
41
|
-
cycode/cli/apps/report/report_command.py,sha256=
|
|
41
|
+
cycode/cli/apps/report/report_command.py,sha256=k_7vx_QsHmDKjlW_vibmv9_55ML4-A7ObMGp67jWCFQ,412
|
|
42
42
|
cycode/cli/apps/report/sbom/__init__.py,sha256=fZAryQHrn1V8KVKJvB97Virls1eEs4jHd5bvdIQv0ds,753
|
|
43
43
|
cycode/cli/apps/report/sbom/common.py,sha256=TefLoLxbxi4yDq6b-639udlGqfgLDznGGRwTjQwObAk,3444
|
|
44
44
|
cycode/cli/apps/report/sbom/path/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
45
|
-
cycode/cli/apps/report/sbom/path/path_command.py,sha256=
|
|
45
|
+
cycode/cli/apps/report/sbom/path/path_command.py,sha256=VWmDvYbZbBT8ncswdkro4i-DKaDBmTEVarY_xVDMuM4,3031
|
|
46
46
|
cycode/cli/apps/report/sbom/repository_url/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
47
|
-
cycode/cli/apps/report/sbom/repository_url/repository_url_command.py,sha256=
|
|
48
|
-
cycode/cli/apps/report/sbom/sbom_command.py,sha256=
|
|
47
|
+
cycode/cli/apps/report/sbom/repository_url/repository_url_command.py,sha256=wgbMaCSmC6PqizkkzshmT4Pf_HaQH3xNQffFrU7_r4U,2491
|
|
48
|
+
cycode/cli/apps/report/sbom/sbom_command.py,sha256=2T54KUv7041VGQ9fmk3SkmAM1AwG5EPl10aiUL7QhiU,2150
|
|
49
49
|
cycode/cli/apps/report/sbom/sbom_report_file.py,sha256=uyaJRvmg1K4DvJaMppbCf6yCj6UU-NdvNg-ZVZk0jx4,1576
|
|
50
50
|
cycode/cli/apps/report_import/__init__.py,sha256=T9KSL2TwQKQTNbck7JBlQAf7w8W3Q3VQLn_BCzVLWrA,424
|
|
51
|
-
cycode/cli/apps/report_import/report_import_command.py,sha256=
|
|
51
|
+
cycode/cli/apps/report_import/report_import_command.py,sha256=otDBvoQZFlchf6R6SU8CSA6Vrfh6fVTAhXQGaIH7z3Q,215
|
|
52
52
|
cycode/cli/apps/report_import/sbom/__init__.py,sha256=5E9x4UqWsk333RlklV9cCo7Q9o019zIhx-uac109YcU,210
|
|
53
|
-
cycode/cli/apps/report_import/sbom/sbom_command.py,sha256=
|
|
53
|
+
cycode/cli/apps/report_import/sbom/sbom_command.py,sha256=uWvBhVdROHcHsjoR3l44h3sHOLWTQoldiDROtx4cgc0,2276
|
|
54
54
|
cycode/cli/apps/scan/__init__.py,sha256=-q1AIBnrQ4GP0CVKFLr_2CdWf9TBQC90ejSL4I7rxuA,2444
|
|
55
55
|
cycode/cli/apps/scan/aggregation_report.py,sha256=8f9kPfO7biNf5OsDZG6UhMPqG6ymoFrX5GBtlEIfFAg,1540
|
|
56
56
|
cycode/cli/apps/scan/code_scanner.py,sha256=JTGJoJ0wAYiYK7wBfxgYrA0kA2U0OjvkFw2lKvdzTjE,12211
|
|
57
57
|
cycode/cli/apps/scan/commit_history/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
58
|
-
cycode/cli/apps/scan/commit_history/commit_history_command.py,sha256=
|
|
58
|
+
cycode/cli/apps/scan/commit_history/commit_history_command.py,sha256=zTVmN8yeLXGAiCbyDL-EyEzSPNLzcRpP2q6Qq7p4uZA,1011
|
|
59
59
|
cycode/cli/apps/scan/commit_range_scanner.py,sha256=g3joPg0P1suQ2KDxb7SopjecLOlMKFf_xopah6SPHQ0,14740
|
|
60
60
|
cycode/cli/apps/scan/detection_excluder.py,sha256=0zaNa1PxVshATHv8axp4e-xWvmuNQdg_r5DYsdQ9EVo,6432
|
|
61
61
|
cycode/cli/apps/scan/path/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
62
|
-
cycode/cli/apps/scan/path/path_command.py,sha256=
|
|
62
|
+
cycode/cli/apps/scan/path/path_command.py,sha256=x4HXqq1Wy6onziKMc6ELQxqeI5k-m3t_T3RG9kQxrq0,591
|
|
63
63
|
cycode/cli/apps/scan/pre_commit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
64
|
-
cycode/cli/apps/scan/pre_commit/pre_commit_command.py,sha256=
|
|
64
|
+
cycode/cli/apps/scan/pre_commit/pre_commit_command.py,sha256=49vnVAIiLtcG7lsBX2vKhS-5kqC8wKqCUP-3G8ClPVs,465
|
|
65
65
|
cycode/cli/apps/scan/pre_push/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
66
|
-
cycode/cli/apps/scan/pre_push/pre_push_command.py,sha256=
|
|
66
|
+
cycode/cli/apps/scan/pre_push/pre_push_command.py,sha256=tyOghRITb7FPyxAkT68Akk48jNVub28cLFKy0gAtkgo,2418
|
|
67
67
|
cycode/cli/apps/scan/pre_receive/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
68
|
-
cycode/cli/apps/scan/pre_receive/pre_receive_command.py,sha256=
|
|
68
|
+
cycode/cli/apps/scan/pre_receive/pre_receive_command.py,sha256=v1sXjl9EKTG65065DzJRJ78we96cqLztzDWw89KUb0o,2522
|
|
69
69
|
cycode/cli/apps/scan/remote_url_resolver.py,sha256=JCjaAzDMxGFDT7twBpZzjgEHGwlaGIxWG_Y7DSehsb0,5651
|
|
70
70
|
cycode/cli/apps/scan/repository/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
71
|
-
cycode/cli/apps/scan/repository/repository_command.py,sha256=
|
|
71
|
+
cycode/cli/apps/scan/repository/repository_command.py,sha256=03C93JYvyN_W-vstsl5-OJp2VdPPKsWQGqzZibUcx4g,3343
|
|
72
72
|
cycode/cli/apps/scan/scan_ci/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
73
73
|
cycode/cli/apps/scan/scan_ci/ci_integrations.py,sha256=3ZUv1uLsHC13KTNQ4erQKKDXAkmaSm5jow2Utwr4mCw,1634
|
|
74
|
-
cycode/cli/apps/scan/scan_ci/scan_ci_command.py,sha256
|
|
75
|
-
cycode/cli/apps/scan/scan_command.py,sha256=
|
|
74
|
+
cycode/cli/apps/scan/scan_ci/scan_ci_command.py,sha256=37I6YTs5UWYtbnDe1EeYZnhV1twFTDUrniZ4Sf2_6Kk,562
|
|
75
|
+
cycode/cli/apps/scan/scan_command.py,sha256=3JGUntzhHzymR95Aos22hxUTESqIVwnVNV3SiqCwaKI,7171
|
|
76
76
|
cycode/cli/apps/scan/scan_parameters.py,sha256=66Ft8c_L6_BxDvRgJoXP5ItUQfzSHGF_XJWBdQismrg,1341
|
|
77
77
|
cycode/cli/apps/scan/scan_result.py,sha256=05RFtFgdKDi5_ekzWqRhxlRSu2JduBixm4JkgGhMcW8,8497
|
|
78
78
|
cycode/cli/apps/status/__init__.py,sha256=uxfkEBafO7Da0mPc1fZhwoO0RTtyXp2a5T3LJTZxubU,371
|
|
@@ -83,12 +83,12 @@ cycode/cli/apps/status/version_command.py,sha256=c6Iko_rmZo9T_kQSd3HUloBi40Qv7cj
|
|
|
83
83
|
cycode/cli/cli_types.py,sha256=ago61pEEofLTiRk3HS0mY7GoT2zj3WkgYjbvXwJwwsc,3318
|
|
84
84
|
cycode/cli/config.py,sha256=Op-lX_neanJtvPvoOEx4ByBdveh5ygElIga1FdSHhOI,299
|
|
85
85
|
cycode/cli/console.py,sha256=vp-DHwlkwpwdsPyfwGdjsPF-6-Bi3f8W7G-W_YXCMH8,1914
|
|
86
|
-
cycode/cli/consts.py,sha256=
|
|
86
|
+
cycode/cli/consts.py,sha256=d8w8z4zpw_RVTeBSADlE0iiigQL06B6Jvyu6UOZ94ZI,8701
|
|
87
87
|
cycode/cli/exceptions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
88
88
|
cycode/cli/exceptions/custom_exceptions.py,sha256=Uh4Lqp4moTIFRTRtnT5b8dqb07L3wSAnAuFonS6-omQ,3610
|
|
89
89
|
cycode/cli/exceptions/handle_ai_remediation_errors.py,sha256=mA70upSYXK3rL_fmanzKYeUzLENhpXdkW8k3aIHrKzU,785
|
|
90
90
|
cycode/cli/exceptions/handle_auth_errors.py,sha256=m3q9keRUKAg6OnFlOlzpNUFzdQHGEeyq8N2Ywqs-QQ4,597
|
|
91
|
-
cycode/cli/exceptions/handle_errors.py,sha256=
|
|
91
|
+
cycode/cli/exceptions/handle_errors.py,sha256=za3vQcM_eFTvbT-53tTc6ky-J0wav6lupD1hXWw0e54,881
|
|
92
92
|
cycode/cli/exceptions/handle_report_sbom_errors.py,sha256=bi0EizHtQLL-ovhHRH98CZ7qXdDPLTYnI59Jn1Y5c0E,926
|
|
93
93
|
cycode/cli/exceptions/handle_scan_errors.py,sha256=-QIYvbBXmZVOvAdNwGYwAdmBma6Z_pPpS0a77aDICp8,1916
|
|
94
94
|
cycode/cli/files_collector/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -145,7 +145,7 @@ cycode/cli/user_settings/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZ
|
|
|
145
145
|
cycode/cli/user_settings/base_file_manager.py,sha256=SLA5xRMTqSY-PtbeKCtVc9rP_ljxUYe3z3ZU-XE2x0w,844
|
|
146
146
|
cycode/cli/user_settings/config_file_manager.py,sha256=KqMogXjtgO-ZbEGW0eN_ZUHn3tLQFJteV8zYDgEhIks,4954
|
|
147
147
|
cycode/cli/user_settings/configuration_manager.py,sha256=8nTogrLRAMXKM13Zd_lvaL9nsfhYRK-IPii25v6ONck,9277
|
|
148
|
-
cycode/cli/user_settings/credentials_manager.py,sha256=
|
|
148
|
+
cycode/cli/user_settings/credentials_manager.py,sha256=gDCyaBTT4qaayKmRBk65kPB2pRG6GalrO5GvnVL3NiI,3958
|
|
149
149
|
cycode/cli/user_settings/jwt_creator.py,sha256=xEkFLFqhwbNJnXuIi02XDxoj2E-4Nw-m10uJaHl3luA,745
|
|
150
150
|
cycode/cli/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
151
151
|
cycode/cli/utils/enum_utils.py,sha256=h_VTCfJ-0hnhwDsEznmx56rJrCb5FQ8u6PrI6p8MP3E,187
|
|
@@ -157,7 +157,6 @@ cycode/cli/utils/path_utils.py,sha256=OmAOtZwvPmYqqhBnB4jI6hkSnCkGpSOibY7PtP213C
|
|
|
157
157
|
cycode/cli/utils/progress_bar.py,sha256=bKBWHHdZsVkdDdWMJLfgLGR0cBYeB44P_DpRM8pvWqU,9528
|
|
158
158
|
cycode/cli/utils/scan_batch.py,sha256=jIG3jPYBptcwPHcTze0goFs4etCAOyKahdhUNPBsufw,5106
|
|
159
159
|
cycode/cli/utils/scan_utils.py,sha256=j3nkm7KxO1nCjPDppdTWzmo7gNw1XfRUlhfeY66xGNw,2100
|
|
160
|
-
cycode/cli/utils/sentry.py,sha256=hHWYtiGKD6vRi8S6Jx9hycs5JpJvGlkBImXZfWfWB1o,3612
|
|
161
160
|
cycode/cli/utils/shell_executor.py,sha256=CuHeXoYM6VaYtDernWtf49_s1EfuU8nWxj4MPIAciww,1290
|
|
162
161
|
cycode/cli/utils/string_utils.py,sha256=0kvu_apAfHjwd7dUhZl8k1pr57aCiO1MhzBYnA2keK4,2434
|
|
163
162
|
cycode/cli/utils/task_timer.py,sha256=wxfM2TtJGjc1F17CIja_Qmt6zd4a1qdMwuz0ltgTDAg,2722
|
|
@@ -178,7 +177,7 @@ cycode/cyclient/cycode_client_base.py,sha256=qkOwul-H4cF3-ffX2iA6BKXkoQthDSO9unw
|
|
|
178
177
|
cycode/cyclient/cycode_dev_based_client.py,sha256=8LxeUWizXzZ0ilpwb6Q0W4ZMLZyZdKPzgpl5xcRmT8c,664
|
|
179
178
|
cycode/cyclient/cycode_oidc_based_client.py,sha256=AVKBlqFOLYUQVxyPquvFwqnYpD6xgU_R6GJiQCWEdJw,857
|
|
180
179
|
cycode/cyclient/cycode_token_based_client.py,sha256=frbrv1jzF388SXqHNNkZ95Hbx7Vjd3UXwWnq7nVxYN8,848
|
|
181
|
-
cycode/cyclient/headers.py,sha256=
|
|
180
|
+
cycode/cyclient/headers.py,sha256=NMlVH9hAxZ-CyWaZJio29Mc5KFcFvNvnJTshueM3hFI,1337
|
|
182
181
|
cycode/cyclient/import_sbom_client.py,sha256=M0RAn2dDh9woI3SUkgSHCQxhbARoLpyAM3amOausz8E,2749
|
|
183
182
|
cycode/cyclient/logger.py,sha256=oTkay7QzoOIVQ71cGOy4ukkijYGA3IKJlHkL24Px5ds,70
|
|
184
183
|
cycode/cyclient/models.py,sha256=U_37PROmaat5ehliH1YZ71iVecF7dPvXPTNOoj67Thg,15017
|
|
@@ -186,8 +185,8 @@ cycode/cyclient/report_client.py,sha256=Scq30NeJPzgXv0hPLO1U05AdE9i_2iu6cIrSKpEJ
|
|
|
186
185
|
cycode/cyclient/scan_client.py,sha256=uTBEjgfaCVuJREo73p_zkIVA23NQfdJ1d1-bzc7nSKk,12682
|
|
187
186
|
cycode/cyclient/scan_config_base.py,sha256=mXsPZGYCtp85rv5GIige40yQZXuRcEKUW-VQJ0vgFzk,1201
|
|
188
187
|
cycode/logger.py,sha256=xAzpkWLZhixO4egRcYn4HXM9lIfx5wHdpkHxNc5jrX8,2225
|
|
189
|
-
cycode-3.9.
|
|
190
|
-
cycode-3.9.
|
|
191
|
-
cycode-3.9.
|
|
192
|
-
cycode-3.9.
|
|
193
|
-
cycode-3.9.
|
|
188
|
+
cycode-3.9.2.dist-info/METADATA,sha256=DjPYAJ9dXXqf8gb8L2XHIdBY3uDFpqEQ-vonVle4nFg,78991
|
|
189
|
+
cycode-3.9.2.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
|
|
190
|
+
cycode-3.9.2.dist-info/entry_points.txt,sha256=iDcVJM8ByLElVgvBgtYxDjw1kT7O8Mo0LcWZIT5L3Ig,45
|
|
191
|
+
cycode-3.9.2.dist-info/licenses/LICENCE,sha256=2Wx4N6mD_4xB7-E3hPkZ3MPhpJy__k_I8MaCSO-PDRo,1068
|
|
192
|
+
cycode-3.9.2.dist-info/RECORD,,
|
cycode/cli/utils/sentry.py
DELETED
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import logging
|
|
2
|
-
from dataclasses import dataclass
|
|
3
|
-
from typing import Optional
|
|
4
|
-
|
|
5
|
-
import sentry_sdk
|
|
6
|
-
from sentry_sdk.integrations.atexit import AtexitIntegration
|
|
7
|
-
from sentry_sdk.integrations.dedupe import DedupeIntegration
|
|
8
|
-
from sentry_sdk.integrations.excepthook import ExcepthookIntegration
|
|
9
|
-
from sentry_sdk.integrations.logging import LoggingIntegration
|
|
10
|
-
from sentry_sdk.scrubber import DEFAULT_DENYLIST, EventScrubber
|
|
11
|
-
|
|
12
|
-
from cycode import __version__
|
|
13
|
-
from cycode.cli import consts
|
|
14
|
-
from cycode.cli.logger import logger
|
|
15
|
-
from cycode.cli.utils.jwt_utils import get_user_and_tenant_ids_from_access_token
|
|
16
|
-
from cycode.cyclient.config import on_premise_installation
|
|
17
|
-
|
|
18
|
-
# when Sentry is blocked on the machine, we want to keep clean output without retries warnings
|
|
19
|
-
logging.getLogger('urllib3.connectionpool').setLevel(logging.ERROR)
|
|
20
|
-
logging.getLogger('sentry_sdk').setLevel(logging.ERROR)
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
@dataclass
|
|
24
|
-
class _SentrySession:
|
|
25
|
-
user_id: Optional[str] = None
|
|
26
|
-
tenant_id: Optional[str] = None
|
|
27
|
-
correlation_id: Optional[str] = None
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
_SENTRY_SESSION = _SentrySession()
|
|
31
|
-
_DENY_LIST = [*DEFAULT_DENYLIST, 'access_token']
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
def _get_sentry_release() -> str:
|
|
35
|
-
return f'{consts.APP_NAME}@{__version__}'
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
def _get_sentry_local_release() -> str:
|
|
39
|
-
return f'{consts.APP_NAME}@0.0.0'
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
_SENTRY_LOCAL_RELEASE = _get_sentry_local_release()
|
|
43
|
-
_SENTRY_DISABLED = on_premise_installation
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
def _before_sentry_event_send(event: dict, _: dict) -> Optional[dict]:
|
|
47
|
-
if _SENTRY_DISABLED:
|
|
48
|
-
# drop all events when Sentry is disabled
|
|
49
|
-
return None
|
|
50
|
-
|
|
51
|
-
if event.get('release') == _SENTRY_LOCAL_RELEASE:
|
|
52
|
-
logger.debug('Dropping Sentry event due to local development setup')
|
|
53
|
-
return None
|
|
54
|
-
|
|
55
|
-
return event
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
def init_sentry() -> None:
|
|
59
|
-
sentry_sdk.init(
|
|
60
|
-
dsn=consts.SENTRY_DSN,
|
|
61
|
-
debug=consts.SENTRY_DEBUG,
|
|
62
|
-
release=_get_sentry_release(),
|
|
63
|
-
server_name='',
|
|
64
|
-
before_send=_before_sentry_event_send,
|
|
65
|
-
sample_rate=consts.SENTRY_SAMPLE_RATE,
|
|
66
|
-
send_default_pii=consts.SENTRY_SEND_DEFAULT_PII,
|
|
67
|
-
include_local_variables=consts.SENTRY_INCLUDE_LOCAL_VARIABLES,
|
|
68
|
-
max_request_body_size=consts.SENTRY_MAX_REQUEST_BODY_SIZE,
|
|
69
|
-
event_scrubber=EventScrubber(denylist=_DENY_LIST, recursive=True),
|
|
70
|
-
default_integrations=False,
|
|
71
|
-
integrations=[
|
|
72
|
-
AtexitIntegration(lambda _, __: None), # disable output to stderr about pending events
|
|
73
|
-
ExcepthookIntegration(),
|
|
74
|
-
DedupeIntegration(),
|
|
75
|
-
LoggingIntegration(),
|
|
76
|
-
],
|
|
77
|
-
)
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
def setup_scope_from_access_token(access_token: Optional[str]) -> None:
|
|
81
|
-
if not access_token:
|
|
82
|
-
return
|
|
83
|
-
|
|
84
|
-
user_id, tenant_id = get_user_and_tenant_ids_from_access_token(access_token)
|
|
85
|
-
|
|
86
|
-
_SENTRY_SESSION.user_id = user_id
|
|
87
|
-
_SENTRY_SESSION.tenant_id = tenant_id
|
|
88
|
-
|
|
89
|
-
_setup_scope(user_id, tenant_id, _SENTRY_SESSION.correlation_id)
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
def add_correlation_id_to_scope(correlation_id: str) -> None:
|
|
93
|
-
_setup_scope(_SENTRY_SESSION.user_id, _SENTRY_SESSION.tenant_id, correlation_id)
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
def _setup_scope(user_id: str, tenant_id: str, correlation_id: Optional[str] = None) -> None:
|
|
97
|
-
scope = sentry_sdk.Scope.get_current_scope()
|
|
98
|
-
sentry_sdk.set_tag('tenant_id', tenant_id)
|
|
99
|
-
|
|
100
|
-
user = {'id': user_id, 'tenant_id': tenant_id}
|
|
101
|
-
if correlation_id:
|
|
102
|
-
user['correlation_id'] = correlation_id
|
|
103
|
-
|
|
104
|
-
scope.set_user(user)
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
def capture_exception(exception: BaseException) -> None:
|
|
108
|
-
sentry_sdk.capture_exception(exception)
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
def add_breadcrumb(message: str, category: str = 'cli') -> None:
|
|
112
|
-
sentry_sdk.add_breadcrumb(category=category, message=message, level='info')
|
|
File without changes
|
|
File without changes
|
|
File without changes
|