regscale-cli 6.25.1.0__py3-none-any.whl → 6.27.0.0__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.
Potentially problematic release.
This version of regscale-cli might be problematic. Click here for more details.
- regscale/_version.py +1 -1
- regscale/airflow/hierarchy.py +2 -2
- regscale/core/app/application.py +19 -4
- regscale/core/app/internal/evidence.py +419 -2
- regscale/core/app/internal/login.py +0 -1
- regscale/core/app/utils/catalog_utils/common.py +1 -1
- regscale/dev/code_gen.py +24 -20
- regscale/integrations/commercial/jira.py +367 -126
- regscale/integrations/commercial/qualys/__init__.py +7 -8
- regscale/integrations/commercial/qualys/scanner.py +8 -3
- regscale/integrations/commercial/sicura/api.py +14 -13
- regscale/integrations/commercial/sicura/commands.py +8 -2
- regscale/integrations/commercial/sicura/scanner.py +49 -39
- regscale/integrations/commercial/stigv2/ckl_parser.py +5 -5
- regscale/integrations/commercial/synqly/assets.py +17 -0
- regscale/integrations/commercial/synqly/vulnerabilities.py +45 -28
- regscale/integrations/commercial/tenablev2/cis_parsers.py +453 -0
- regscale/integrations/commercial/tenablev2/cis_scanner.py +447 -0
- regscale/integrations/commercial/tenablev2/commands.py +142 -1
- regscale/integrations/commercial/tenablev2/scanner.py +0 -1
- regscale/integrations/commercial/tenablev2/stig_parsers.py +113 -57
- regscale/integrations/commercial/wizv2/WizDataMixin.py +1 -1
- regscale/integrations/commercial/wizv2/click.py +64 -79
- regscale/integrations/commercial/wizv2/compliance/__init__.py +15 -0
- regscale/integrations/commercial/wizv2/{policy_compliance_helpers.py → compliance/helpers.py} +78 -60
- regscale/integrations/commercial/wizv2/compliance_report.py +161 -165
- regscale/integrations/commercial/wizv2/core/__init__.py +133 -0
- regscale/integrations/commercial/wizv2/{async_client.py → core/client.py} +3 -3
- regscale/integrations/commercial/wizv2/{constants.py → core/constants.py} +1 -17
- regscale/integrations/commercial/wizv2/core/file_operations.py +237 -0
- regscale/integrations/commercial/wizv2/fetchers/__init__.py +11 -0
- regscale/integrations/commercial/wizv2/{data_fetcher.py → fetchers/policy_assessment.py} +5 -9
- regscale/integrations/commercial/wizv2/issue.py +1 -1
- regscale/integrations/commercial/wizv2/models/__init__.py +0 -0
- regscale/integrations/commercial/wizv2/parsers/__init__.py +34 -0
- regscale/integrations/commercial/wizv2/{parsers.py → parsers/main.py} +1 -1
- regscale/integrations/commercial/wizv2/processors/__init__.py +11 -0
- regscale/integrations/commercial/wizv2/{finding_processor.py → processors/finding.py} +1 -1
- regscale/integrations/commercial/wizv2/reports.py +1 -1
- regscale/integrations/commercial/wizv2/sbom.py +1 -1
- regscale/integrations/commercial/wizv2/scanner.py +39 -99
- regscale/integrations/commercial/wizv2/utils/__init__.py +48 -0
- regscale/integrations/commercial/wizv2/{utils.py → utils/main.py} +116 -61
- regscale/integrations/commercial/wizv2/variables.py +89 -3
- regscale/integrations/compliance_integration.py +60 -41
- regscale/integrations/control_matcher.py +377 -0
- regscale/integrations/due_date_handler.py +14 -8
- regscale/integrations/milestone_manager.py +291 -0
- regscale/integrations/public/__init__.py +1 -0
- regscale/integrations/public/cci_importer.py +37 -38
- regscale/integrations/public/fedramp/click.py +60 -2
- regscale/integrations/public/fedramp/docx_parser.py +10 -1
- regscale/integrations/public/fedramp/fedramp_cis_crm.py +393 -340
- regscale/integrations/public/fedramp/fedramp_five.py +1 -1
- regscale/integrations/public/fedramp/poam_export_v5.py +888 -0
- regscale/integrations/scanner_integration.py +277 -153
- regscale/models/integration_models/cisa_kev_data.json +282 -9
- regscale/models/integration_models/nexpose.py +36 -10
- regscale/models/integration_models/qualys.py +3 -4
- regscale/models/integration_models/synqly_models/capabilities.json +1 -1
- regscale/models/integration_models/synqly_models/connectors/vulnerabilities.py +24 -7
- regscale/models/integration_models/synqly_models/synqly_model.py +8 -1
- regscale/models/locking.py +12 -8
- regscale/models/platform.py +1 -2
- regscale/models/regscale_models/control_implementation.py +47 -22
- regscale/models/regscale_models/issue.py +256 -95
- regscale/models/regscale_models/milestone.py +1 -1
- regscale/models/regscale_models/regscale_model.py +6 -1
- regscale/templates/__init__.py +0 -0
- {regscale_cli-6.25.1.0.dist-info → regscale_cli-6.27.0.0.dist-info}/METADATA +1 -17
- {regscale_cli-6.25.1.0.dist-info → regscale_cli-6.27.0.0.dist-info}/RECORD +145 -65
- tests/regscale/integrations/commercial/__init__.py +0 -0
- tests/regscale/integrations/commercial/conftest.py +28 -0
- tests/regscale/integrations/commercial/microsoft_defender/__init__.py +1 -0
- tests/regscale/integrations/commercial/microsoft_defender/test_defender.py +1517 -0
- tests/regscale/integrations/commercial/microsoft_defender/test_defender_api.py +1748 -0
- tests/regscale/integrations/commercial/microsoft_defender/test_defender_constants.py +327 -0
- tests/regscale/integrations/commercial/microsoft_defender/test_defender_scanner.py +487 -0
- tests/regscale/integrations/commercial/test_aws.py +3731 -0
- tests/regscale/integrations/commercial/test_burp.py +48 -0
- tests/regscale/integrations/commercial/test_crowdstrike.py +49 -0
- tests/regscale/integrations/commercial/test_dependabot.py +341 -0
- tests/regscale/integrations/commercial/test_gcp.py +1543 -0
- tests/regscale/integrations/commercial/test_gitlab.py +549 -0
- tests/regscale/integrations/commercial/test_ip_mac_address_length.py +84 -0
- tests/regscale/integrations/commercial/test_jira.py +2204 -0
- tests/regscale/integrations/commercial/test_npm_audit.py +42 -0
- tests/regscale/integrations/commercial/test_okta.py +1228 -0
- tests/regscale/integrations/commercial/test_sarif_converter.py +251 -0
- tests/regscale/integrations/commercial/test_sicura.py +350 -0
- tests/regscale/integrations/commercial/test_snow.py +423 -0
- tests/regscale/integrations/commercial/test_sonarcloud.py +394 -0
- tests/regscale/integrations/commercial/test_sqlserver.py +186 -0
- tests/regscale/integrations/commercial/test_stig.py +33 -0
- tests/regscale/integrations/commercial/test_stig_mapper.py +153 -0
- tests/regscale/integrations/commercial/test_stigv2.py +406 -0
- tests/regscale/integrations/commercial/test_wiz.py +1365 -0
- tests/regscale/integrations/commercial/test_wiz_inventory.py +256 -0
- tests/regscale/integrations/commercial/wizv2/__init__.py +339 -0
- tests/regscale/integrations/commercial/wizv2/compliance/__init__.py +1 -0
- tests/regscale/integrations/commercial/wizv2/compliance/test_helpers.py +903 -0
- tests/regscale/integrations/commercial/wizv2/core/__init__.py +1 -0
- tests/regscale/integrations/commercial/wizv2/core/test_auth.py +701 -0
- tests/regscale/integrations/commercial/wizv2/core/test_client.py +1037 -0
- tests/regscale/integrations/commercial/wizv2/core/test_file_operations.py +989 -0
- tests/regscale/integrations/commercial/wizv2/fetchers/__init__.py +1 -0
- tests/regscale/integrations/commercial/wizv2/fetchers/test_policy_assessment.py +805 -0
- tests/regscale/integrations/commercial/wizv2/parsers/__init__.py +1 -0
- tests/regscale/integrations/commercial/wizv2/parsers/test_main.py +1153 -0
- tests/regscale/integrations/commercial/wizv2/processors/__init__.py +1 -0
- tests/regscale/integrations/commercial/wizv2/processors/test_finding.py +671 -0
- tests/regscale/integrations/commercial/wizv2/test_WizDataMixin.py +537 -0
- tests/regscale/integrations/commercial/wizv2/test_click_comprehensive.py +851 -0
- tests/regscale/integrations/commercial/wizv2/test_compliance_report_comprehensive.py +910 -0
- tests/regscale/integrations/commercial/wizv2/test_compliance_report_normalization.py +138 -0
- tests/regscale/integrations/commercial/wizv2/test_file_cleanup.py +283 -0
- tests/regscale/integrations/commercial/wizv2/test_file_operations.py +260 -0
- tests/regscale/integrations/commercial/wizv2/test_issue.py +343 -0
- tests/regscale/integrations/commercial/wizv2/test_issue_comprehensive.py +1203 -0
- tests/regscale/integrations/commercial/wizv2/test_reports.py +497 -0
- tests/regscale/integrations/commercial/wizv2/test_sbom.py +643 -0
- tests/regscale/integrations/commercial/wizv2/test_scanner_comprehensive.py +805 -0
- tests/regscale/integrations/commercial/wizv2/test_wiz_click_client_id.py +165 -0
- tests/regscale/integrations/commercial/wizv2/test_wiz_compliance_report.py +1394 -0
- tests/regscale/integrations/commercial/wizv2/test_wiz_compliance_unit.py +341 -0
- tests/regscale/integrations/commercial/wizv2/test_wiz_control_normalization.py +138 -0
- tests/regscale/integrations/commercial/wizv2/test_wiz_findings_comprehensive.py +364 -0
- tests/regscale/integrations/commercial/wizv2/test_wiz_inventory_comprehensive.py +644 -0
- tests/regscale/integrations/commercial/wizv2/test_wiz_status_mapping.py +149 -0
- tests/regscale/integrations/commercial/wizv2/test_wizv2.py +1132 -0
- tests/regscale/integrations/commercial/wizv2/test_wizv2_utils.py +519 -0
- tests/regscale/integrations/commercial/wizv2/utils/__init__.py +1 -0
- tests/regscale/integrations/commercial/wizv2/utils/test_main.py +1523 -0
- tests/regscale/integrations/public/fedramp/__init__.py +1 -0
- tests/regscale/integrations/public/fedramp/test_poam_export_v5.py +1293 -0
- tests/regscale/integrations/public/test_fedramp.py +301 -0
- tests/regscale/integrations/test_control_matcher.py +1397 -0
- tests/regscale/integrations/test_control_matching.py +155 -0
- tests/regscale/integrations/test_milestone_manager.py +408 -0
- tests/regscale/models/test_issue.py +378 -1
- regscale/integrations/commercial/wizv2/policy_compliance.py +0 -3543
- /regscale/integrations/commercial/wizv2/{wiz_auth.py → core/auth.py} +0 -0
- {regscale_cli-6.25.1.0.dist-info → regscale_cli-6.27.0.0.dist-info}/LICENSE +0 -0
- {regscale_cli-6.25.1.0.dist-info → regscale_cli-6.27.0.0.dist-info}/WHEEL +0 -0
- {regscale_cli-6.25.1.0.dist-info → regscale_cli-6.27.0.0.dist-info}/entry_points.txt +0 -0
- {regscale_cli-6.25.1.0.dist-info → regscale_cli-6.27.0.0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
# -*- coding: utf-8 -*-
|
|
3
|
+
"""Tests for Wiz Click command client_id parameter handling."""
|
|
4
|
+
|
|
5
|
+
import pytest
|
|
6
|
+
from click.testing import CliRunner
|
|
7
|
+
from unittest.mock import patch, MagicMock
|
|
8
|
+
from regscale.integrations.commercial.wizv2.click import wiz
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class TestWizClientIdHandling:
|
|
12
|
+
"""Test that client_id parameters are properly recognized when passed via CLI."""
|
|
13
|
+
|
|
14
|
+
@pytest.fixture
|
|
15
|
+
def runner(self):
|
|
16
|
+
"""Create a Click test runner."""
|
|
17
|
+
return CliRunner()
|
|
18
|
+
|
|
19
|
+
@pytest.fixture
|
|
20
|
+
def mock_wiz_variables(self):
|
|
21
|
+
"""Mock WizVariables to avoid environment dependencies."""
|
|
22
|
+
with patch("regscale.integrations.commercial.wizv2.click.WizVariables") as mock:
|
|
23
|
+
mock.wizClientId = "env_client_id"
|
|
24
|
+
mock.wizClientSecret = "env_client_secret"
|
|
25
|
+
mock.wizInventoryFilterBy = "{}"
|
|
26
|
+
mock.wizIssueFilterBy = "{}"
|
|
27
|
+
yield mock
|
|
28
|
+
|
|
29
|
+
@pytest.fixture
|
|
30
|
+
def mock_scanner(self):
|
|
31
|
+
"""Mock the WizVulnerabilityIntegration scanner."""
|
|
32
|
+
with patch("regscale.integrations.commercial.wizv2.scanner.WizVulnerabilityIntegration") as mock:
|
|
33
|
+
instance = MagicMock()
|
|
34
|
+
mock.return_value = instance
|
|
35
|
+
yield instance
|
|
36
|
+
|
|
37
|
+
def test_inventory_cli_client_id_overrides_env(self, runner, mock_wiz_variables, mock_scanner):
|
|
38
|
+
"""Test that CLI-provided client_id overrides environment variable."""
|
|
39
|
+
result = runner.invoke(
|
|
40
|
+
wiz,
|
|
41
|
+
[
|
|
42
|
+
"inventory",
|
|
43
|
+
"--wiz_project_id",
|
|
44
|
+
"test-project",
|
|
45
|
+
"--regscale_ssp_id",
|
|
46
|
+
"2288",
|
|
47
|
+
"--client_id",
|
|
48
|
+
"cli_provided_client_id",
|
|
49
|
+
"--client_secret",
|
|
50
|
+
"cli_provided_secret",
|
|
51
|
+
],
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
# Check that the command ran
|
|
55
|
+
assert result.exit_code == 0 or "successfully" in result.output.lower()
|
|
56
|
+
|
|
57
|
+
# Verify that sync_assets was called with CLI-provided credentials
|
|
58
|
+
mock_scanner.sync_assets.assert_called_once()
|
|
59
|
+
call_kwargs = mock_scanner.sync_assets.call_args[1]
|
|
60
|
+
assert call_kwargs["client_id"] == "cli_provided_client_id"
|
|
61
|
+
assert call_kwargs["client_secret"] == "cli_provided_secret"
|
|
62
|
+
|
|
63
|
+
def test_inventory_uses_env_when_no_cli_args(self, runner, mock_wiz_variables, mock_scanner):
|
|
64
|
+
"""Test that environment variables are used when CLI args not provided."""
|
|
65
|
+
result = runner.invoke(
|
|
66
|
+
wiz,
|
|
67
|
+
[
|
|
68
|
+
"inventory",
|
|
69
|
+
"--wiz_project_id",
|
|
70
|
+
"test-project",
|
|
71
|
+
"--regscale_ssp_id",
|
|
72
|
+
"2288",
|
|
73
|
+
],
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
# Check that the command ran
|
|
77
|
+
assert result.exit_code == 0 or "successfully" in result.output.lower()
|
|
78
|
+
|
|
79
|
+
# Verify that sync_assets was called with environment credentials
|
|
80
|
+
mock_scanner.sync_assets.assert_called_once()
|
|
81
|
+
call_kwargs = mock_scanner.sync_assets.call_args[1]
|
|
82
|
+
assert call_kwargs["client_id"] == "env_client_id"
|
|
83
|
+
assert call_kwargs["client_secret"] == "env_client_secret"
|
|
84
|
+
|
|
85
|
+
@pytest.fixture
|
|
86
|
+
def mock_wiz_issue(self):
|
|
87
|
+
"""Mock the WizIssue scanner."""
|
|
88
|
+
with patch("regscale.integrations.commercial.wizv2.issue.WizIssue") as mock:
|
|
89
|
+
instance = MagicMock()
|
|
90
|
+
mock.return_value = instance
|
|
91
|
+
yield instance
|
|
92
|
+
|
|
93
|
+
@pytest.fixture
|
|
94
|
+
def mock_wiz_auth(self):
|
|
95
|
+
"""Mock wiz_authenticate."""
|
|
96
|
+
with patch("regscale.integrations.commercial.wizv2.core.auth.wiz_authenticate") as mock:
|
|
97
|
+
yield mock
|
|
98
|
+
|
|
99
|
+
@pytest.fixture
|
|
100
|
+
def mock_check_license(self):
|
|
101
|
+
"""Mock check_license."""
|
|
102
|
+
with patch("regscale.core.app.utils.app_utils.check_license") as mock:
|
|
103
|
+
yield mock
|
|
104
|
+
|
|
105
|
+
def test_issues_cli_client_id_overrides_env(
|
|
106
|
+
self,
|
|
107
|
+
runner,
|
|
108
|
+
mock_wiz_variables,
|
|
109
|
+
mock_wiz_issue,
|
|
110
|
+
mock_wiz_auth,
|
|
111
|
+
mock_check_license,
|
|
112
|
+
):
|
|
113
|
+
"""Test that CLI-provided client_id overrides environment variable for issues command."""
|
|
114
|
+
result = runner.invoke(
|
|
115
|
+
wiz,
|
|
116
|
+
[
|
|
117
|
+
"issues",
|
|
118
|
+
"--wiz_project_id",
|
|
119
|
+
"test-project",
|
|
120
|
+
"--regscale_ssp_id",
|
|
121
|
+
"2288",
|
|
122
|
+
"--client_id",
|
|
123
|
+
"cli_client_id",
|
|
124
|
+
"--client_secret",
|
|
125
|
+
"cli_secret",
|
|
126
|
+
],
|
|
127
|
+
)
|
|
128
|
+
|
|
129
|
+
# Check that the command ran
|
|
130
|
+
assert result.exit_code == 0 or "successfully" in result.output.lower()
|
|
131
|
+
|
|
132
|
+
# Verify that wiz_authenticate was called with CLI credentials
|
|
133
|
+
mock_wiz_auth.assert_called_once_with("cli_client_id", "cli_secret")
|
|
134
|
+
|
|
135
|
+
# Verify that sync_findings was called with CLI credentials
|
|
136
|
+
mock_wiz_issue.sync_findings.assert_called_once()
|
|
137
|
+
call_kwargs = mock_wiz_issue.sync_findings.call_args[1]
|
|
138
|
+
assert call_kwargs["client_id"] == "cli_client_id"
|
|
139
|
+
assert call_kwargs["client_secret"] == "cli_secret"
|
|
140
|
+
|
|
141
|
+
def test_vulnerabilities_cli_client_id_overrides_env(self, runner, mock_wiz_variables, mock_scanner):
|
|
142
|
+
"""Test that CLI-provided client_id overrides environment variable for vulnerabilities command."""
|
|
143
|
+
result = runner.invoke(
|
|
144
|
+
wiz,
|
|
145
|
+
[
|
|
146
|
+
"vulnerabilities",
|
|
147
|
+
"--wiz_project_id",
|
|
148
|
+
"test-project",
|
|
149
|
+
"--regscale_ssp_id",
|
|
150
|
+
"2288",
|
|
151
|
+
"--client_id",
|
|
152
|
+
"cli_vuln_client_id",
|
|
153
|
+
"--client_secret",
|
|
154
|
+
"cli_vuln_secret",
|
|
155
|
+
],
|
|
156
|
+
)
|
|
157
|
+
|
|
158
|
+
# Check that the command ran
|
|
159
|
+
assert result.exit_code == 0 or "successfully" in result.output.lower()
|
|
160
|
+
|
|
161
|
+
# Verify that sync_findings was called with CLI-provided credentials
|
|
162
|
+
mock_scanner.sync_findings.assert_called_once()
|
|
163
|
+
call_kwargs = mock_scanner.sync_findings.call_args[1]
|
|
164
|
+
assert call_kwargs["client_id"] == "cli_vuln_client_id"
|
|
165
|
+
assert call_kwargs["client_secret"] == "cli_vuln_secret"
|