regscale-cli 6.21.1.0__py3-none-any.whl → 6.21.2.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.
- regscale/_version.py +1 -1
- regscale/core/app/application.py +7 -0
- regscale/integrations/commercial/__init__.py +8 -8
- regscale/integrations/commercial/import_all/import_all_cmd.py +2 -2
- regscale/integrations/commercial/microsoft_defender/__init__.py +0 -0
- regscale/integrations/commercial/{defender.py → microsoft_defender/defender.py} +38 -612
- regscale/integrations/commercial/microsoft_defender/defender_api.py +286 -0
- regscale/integrations/commercial/microsoft_defender/defender_constants.py +80 -0
- regscale/integrations/commercial/microsoft_defender/defender_scanner.py +168 -0
- regscale/integrations/commercial/qualys/__init__.py +24 -86
- regscale/integrations/commercial/qualys/containers.py +2 -0
- regscale/integrations/commercial/qualys/scanner.py +7 -2
- regscale/integrations/commercial/sonarcloud.py +110 -71
- regscale/integrations/commercial/wizv2/click.py +4 -1
- regscale/integrations/commercial/wizv2/data_fetcher.py +401 -0
- regscale/integrations/commercial/wizv2/finding_processor.py +295 -0
- regscale/integrations/commercial/wizv2/policy_compliance.py +1402 -203
- regscale/integrations/commercial/wizv2/policy_compliance_helpers.py +564 -0
- regscale/integrations/commercial/wizv2/scanner.py +4 -4
- regscale/integrations/compliance_integration.py +212 -60
- regscale/integrations/public/fedramp/fedramp_five.py +92 -7
- regscale/integrations/scanner_integration.py +27 -4
- regscale/models/__init__.py +1 -1
- regscale/models/integration_models/cisa_kev_data.json +33 -3
- regscale/models/integration_models/synqly_models/capabilities.json +1 -1
- regscale/models/regscale_models/issue.py +29 -9
- {regscale_cli-6.21.1.0.dist-info → regscale_cli-6.21.2.0.dist-info}/METADATA +1 -1
- {regscale_cli-6.21.1.0.dist-info → regscale_cli-6.21.2.0.dist-info}/RECORD +32 -27
- tests/regscale/test_authorization.py +0 -65
- tests/regscale/test_init.py +0 -96
- {regscale_cli-6.21.1.0.dist-info → regscale_cli-6.21.2.0.dist-info}/LICENSE +0 -0
- {regscale_cli-6.21.1.0.dist-info → regscale_cli-6.21.2.0.dist-info}/WHEEL +0 -0
- {regscale_cli-6.21.1.0.dist-info → regscale_cli-6.21.2.0.dist-info}/entry_points.txt +0 -0
- {regscale_cli-6.21.1.0.dist-info → regscale_cli-6.21.2.0.dist-info}/top_level.txt +0 -0
|
@@ -447,8 +447,9 @@ class Issue(RegScaleModel):
|
|
|
447
447
|
return "High"
|
|
448
448
|
return ""
|
|
449
449
|
|
|
450
|
-
@
|
|
450
|
+
@classmethod
|
|
451
451
|
def get_due_date(
|
|
452
|
+
cls,
|
|
452
453
|
severity: Union[IssueSeverity, str],
|
|
453
454
|
config: dict,
|
|
454
455
|
key: str,
|
|
@@ -481,18 +482,37 @@ class Issue(RegScaleModel):
|
|
|
481
482
|
severity = IssueSeverity.NotAssigned.value
|
|
482
483
|
|
|
483
484
|
if severity == IssueSeverity.Critical.value:
|
|
484
|
-
days =
|
|
485
|
+
days = cls._get_days_for_values(["critical"], config, key)
|
|
486
|
+
start_date = start_date + datetime.timedelta(days=days)
|
|
485
487
|
elif severity == IssueSeverity.High.value:
|
|
486
|
-
days =
|
|
488
|
+
days = cls._get_days_for_values(["high"], config, key)
|
|
487
489
|
elif severity == IssueSeverity.Moderate.value:
|
|
488
|
-
days =
|
|
490
|
+
days = cls._get_days_for_values(["moderate", "medium"], config, key)
|
|
489
491
|
elif severity == IssueSeverity.Low.value:
|
|
490
|
-
days =
|
|
492
|
+
days = cls._get_days_for_values(["low", "minor"], config, key)
|
|
491
493
|
else:
|
|
492
494
|
days = 60
|
|
493
495
|
due_date = start_date + datetime.timedelta(days=days)
|
|
494
496
|
return due_date.strftime(dt_format)
|
|
495
497
|
|
|
498
|
+
@staticmethod
|
|
499
|
+
def _get_days_for_values(possible_values: List[str], config: dict, key: str, default: Optional[int] = 30) -> int:
|
|
500
|
+
"""
|
|
501
|
+
Get the number of days for the given possible values from the configuration.
|
|
502
|
+
|
|
503
|
+
:param List[str] possible_values: List of possible values to check
|
|
504
|
+
:param dict config: Application config
|
|
505
|
+
:param str key: The key to use for init.yaml from the issues section to determine the due date
|
|
506
|
+
:param Optional[int] default: Default number of days to return if no values match, defaults to 30
|
|
507
|
+
:return: Number of days for the first matching value, or 0 if none match
|
|
508
|
+
:rtype: int
|
|
509
|
+
"""
|
|
510
|
+
for value in possible_values:
|
|
511
|
+
days = config["issues"].get(key, {}).get(value, 0)
|
|
512
|
+
if days > 0:
|
|
513
|
+
return days
|
|
514
|
+
return default
|
|
515
|
+
|
|
496
516
|
@staticmethod
|
|
497
517
|
def assign_severity(value: Optional[Any] = None) -> str:
|
|
498
518
|
"""
|
|
@@ -518,11 +538,11 @@ class Issue(RegScaleModel):
|
|
|
518
538
|
else:
|
|
519
539
|
severity = severity_levels["low"]
|
|
520
540
|
elif isinstance(value, str):
|
|
521
|
-
if value.lower() in ["low", "lowest"]:
|
|
541
|
+
if value.lower() in ["low", "lowest", "minor"]:
|
|
522
542
|
severity = severity_levels["low"]
|
|
523
|
-
elif value.lower() in ["medium", "moderate"]:
|
|
543
|
+
elif value.lower() in ["medium", "moderate", "major"]:
|
|
524
544
|
severity = severity_levels["moderate"]
|
|
525
|
-
elif value.lower() in ["high", "critical", "highest"]:
|
|
545
|
+
elif value.lower() in ["high", "critical", "highest", "critical", "blocker"]:
|
|
526
546
|
severity = severity_levels["high"]
|
|
527
547
|
elif value in list(severity_levels.values()):
|
|
528
548
|
severity = value
|
|
@@ -1275,7 +1295,7 @@ class Issue(RegScaleModel):
|
|
|
1275
1295
|
self,
|
|
1276
1296
|
config: Optional[Dict[str, Any]] = None,
|
|
1277
1297
|
standard: str = "fedramp",
|
|
1278
|
-
current_date: Optional[datetime] = None,
|
|
1298
|
+
current_date: Optional[datetime.datetime] = None,
|
|
1279
1299
|
) -> None:
|
|
1280
1300
|
"""
|
|
1281
1301
|
Sets the isPoam field based on NIST 800-53 or FedRAMP criteria, preserving historical POAM status.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
regscale/__init__.py,sha256=ZygAIkX6Nbjag1czWdQa-yP-GM1mBE_9ss21Xh__JFc,34
|
|
2
|
-
regscale/_version.py,sha256=
|
|
2
|
+
regscale/_version.py,sha256=RSHUslawemipH8yaOMvaSKPUKiKa27EuRFDlAk-t2k4,1198
|
|
3
3
|
regscale/regscale.py,sha256=xcxnTwEwWgfO3Fnp0LVo32SZCJzAswq3WDZgm21nHnI,30914
|
|
4
4
|
regscale/airflow/__init__.py,sha256=yMwN0Bz4JbM0nl5qY_hPegxo_O2ilhTOL9PY5Njhn-s,270
|
|
5
5
|
regscale/airflow/click_dags.py,sha256=H3SUR5jkvInNMv1gu-VG-Ja_H-kH145CpQYNalWNAbE,4520
|
|
@@ -36,7 +36,7 @@ regscale/core/lazy_group.py,sha256=S2-nA5tzm47A929NOTqGkzrzKuZQDlq2OAPbNnG1W1Q,2
|
|
|
36
36
|
regscale/core/login.py,sha256=-8vy1HVAtv1iARnZh6uzYtwmx8VFYPwLYR0QAf1ttCk,2714
|
|
37
37
|
regscale/core/app/__init__.py,sha256=nGcCN1vWBAnZzoccIlt0jwWQdegCOrBWOB7LPhQkQSs,96
|
|
38
38
|
regscale/core/app/api.py,sha256=CSyUCV6haBAQ9IyE1FViJcAfTcoS5GJRaULwnRoAV9U,23499
|
|
39
|
-
regscale/core/app/application.py,sha256
|
|
39
|
+
regscale/core/app/application.py,sha256=R86hqlOG5AI1kpLQr16cDsm9cZvBUz0FY9S9-gcU144,31867
|
|
40
40
|
regscale/core/app/logz.py,sha256=8AdBKmquv45JGi5fCMc38JqQg6-FpUONGmqfd5EGwrI,2583
|
|
41
41
|
regscale/core/app/internal/__init__.py,sha256=rod4nmE7rrYDdbuYF4mCWz49TK_2r-v4tWy1UHW63r0,4808
|
|
42
42
|
regscale/core/app/internal/admin_actions.py,sha256=hOdma7QGwFblmxEj9UTjiWWmZGUS5_ZFtxL2qZdhf-Q,7443
|
|
@@ -111,17 +111,16 @@ regscale/exceptions/validation_exception.py,sha256=_DW_GARtPr_Dyy8tolnvC_AYsHRsU
|
|
|
111
111
|
regscale/integrations/__init__.py,sha256=Sqthp3Jggo7co_go380cLn3OAb0cHwqL609_4QJSFBY,58
|
|
112
112
|
regscale/integrations/api_paginator.py,sha256=73rjaNM9mGv8evHAeoObXEjZPg-bJuGPo60ewCLEil8,33192
|
|
113
113
|
regscale/integrations/api_paginator_example.py,sha256=lEuYI-xEGcjnXuIzbCobCP0YRuukLF0s8S3d382SAH4,12119
|
|
114
|
-
regscale/integrations/compliance_integration.py,sha256=
|
|
114
|
+
regscale/integrations/compliance_integration.py,sha256=8HPu9WRheJjoowP8fnTjJOGIFcB8qEwbP-qEGPDdAsY,68428
|
|
115
115
|
regscale/integrations/integration_override.py,sha256=HjYBCuvNpU3t3FptaqYAkdexLFOZBAFrFE9xU0RD1Nc,5867
|
|
116
116
|
regscale/integrations/jsonl_scanner_integration.py,sha256=l8nq_T3rE1XX-6HxrNHm3xzxCNWbIjxQvGMdtZWs7KQ,57003
|
|
117
|
-
regscale/integrations/scanner_integration.py,sha256=
|
|
117
|
+
regscale/integrations/scanner_integration.py,sha256=JpRr7LgzOdRdrncJ-wJrypgUTVWZ1j3Jbhl0zrNMvts,145540
|
|
118
118
|
regscale/integrations/variables.py,sha256=MfQ34WuYVN5437A9sZ2ssHRkA3gFhMHfk1DVasceGmY,2336
|
|
119
|
-
regscale/integrations/commercial/__init__.py,sha256=
|
|
119
|
+
regscale/integrations/commercial/__init__.py,sha256=LZj1qV5f7RdHIOfedDVELV62ADe5gyNccWayHMF1aVc,14026
|
|
120
120
|
regscale/integrations/commercial/ad.py,sha256=YXSmK8vRf6yi2GnREGa5GrE6GelhFrLj44SY8AO1pK0,15509
|
|
121
121
|
regscale/integrations/commercial/burp.py,sha256=3BLNKLfwL1x7jfhd8MJD6hdHEpj58pOEtrtCkn2hcWA,3344
|
|
122
122
|
regscale/integrations/commercial/cpe.py,sha256=vUHKGdq0UlR38pZWqqHLLTdDfooLtE9zIiFHdoFcUr0,5735
|
|
123
123
|
regscale/integrations/commercial/crowdstrike.py,sha256=6x7_GlYDRCZvPZwqgrDT5KMnXCa6H4RKO-FNkiYxHgU,40194
|
|
124
|
-
regscale/integrations/commercial/defender.py,sha256=yoKFAj4N-kpkKJIjiVDnFv8JbMsXYdyYTtle0BajnZ8,66573
|
|
125
124
|
regscale/integrations/commercial/dependabot.py,sha256=V4VbHbwrxHfe7eCilJ7U_MBeIO6X3wetGfIo2DJYe_c,7793
|
|
126
125
|
regscale/integrations/commercial/ecr.py,sha256=oQafB_Lx4CbGDLb6fqNtY1oAWci6-XWsm39URNbqgrk,2687
|
|
127
126
|
regscale/integrations/commercial/gitlab.py,sha256=dzfqJQ68QI1ee_BriNMyPuXLkzOhc2vR1hhVfq2j13Y,12496
|
|
@@ -133,7 +132,7 @@ regscale/integrations/commercial/prisma.py,sha256=oYS31HlI7GiShUy0r9Luv57Ex3cGqd
|
|
|
133
132
|
regscale/integrations/commercial/salesforce.py,sha256=vvXWlXxhJMQj45tU7wz7o4YbkhqjPlaMx_6SWYkI3Bs,36671
|
|
134
133
|
regscale/integrations/commercial/servicenow.py,sha256=nUVZwt8-G1rQhwACX6i2BKIAjkMtd46uskBznxgOOsA,64014
|
|
135
134
|
regscale/integrations/commercial/snyk.py,sha256=CriDWqzZAT9OHYEUNnxBrluzW1C-S4XyoyW2kS4lv4s,3222
|
|
136
|
-
regscale/integrations/commercial/sonarcloud.py,sha256=
|
|
135
|
+
regscale/integrations/commercial/sonarcloud.py,sha256=p_XfEa2MGUYP3qVF_CKgsAGPWsS2h__1INnK2jS7afY,11956
|
|
137
136
|
regscale/integrations/commercial/sqlserver.py,sha256=PcDLmsZ9xU5NlFpwPZyMhhxCgX4JK2Ztn2S6kCG4mws,11614
|
|
138
137
|
regscale/integrations/commercial/veracode.py,sha256=sKeGXvjqP8LfFP56xavAyx5CxfKxpJIEw-PTxrHJ8bc,3374
|
|
139
138
|
regscale/integrations/commercial/xray.py,sha256=rsmlGqj4N7hzt6rW5UIKOBZD2maDVwXxOXiYKlI6F8c,2728
|
|
@@ -173,21 +172,26 @@ regscale/integrations/commercial/grype/__init__.py,sha256=KRuTTlOokQjrkpOmhrefwd
|
|
|
173
172
|
regscale/integrations/commercial/grype/commands.py,sha256=ELF1w0HC4Ps8xjAVn7MCGuoPLnt79oXArqf-lh39SH4,2338
|
|
174
173
|
regscale/integrations/commercial/grype/scanner.py,sha256=Hue1iEKuFsDCvf22IGc9Yac2L1I11ODrS4J4TWvzJUU,16987
|
|
175
174
|
regscale/integrations/commercial/import_all/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
176
|
-
regscale/integrations/commercial/import_all/import_all_cmd.py,sha256=
|
|
175
|
+
regscale/integrations/commercial/import_all/import_all_cmd.py,sha256=rOwykN0-kZYS-ABa4fR-hr5asYX8iBqMMe4qeci--dY,18308
|
|
177
176
|
regscale/integrations/commercial/import_all/scan_file_fingerprints.json,sha256=8c_hnfwbq9bEHr3f14hzcnA9vrehQ-_ZsAIZ4YTPB6w,1981
|
|
178
177
|
regscale/integrations/commercial/mappings/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
179
178
|
regscale/integrations/commercial/mappings/csf_controls.json,sha256=EHOLWrnFr0oRsHBx4LX6pLVoqLuX-Mn7O-CXuzpw-v4,57504
|
|
180
179
|
regscale/integrations/commercial/mappings/nist_800_53_r5_controls.json,sha256=Vuh8RkKhX84U8VG2zoLG94QL7mvWIF28M-u8B4paxgw,123879
|
|
180
|
+
regscale/integrations/commercial/microsoft_defender/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
181
|
+
regscale/integrations/commercial/microsoft_defender/defender.py,sha256=qBMeevsYwgXAUiYR2ZlYDHkpncbnfRL_MGCAi3Y5lVM,38181
|
|
182
|
+
regscale/integrations/commercial/microsoft_defender/defender_api.py,sha256=8vPcp7j4w89da9SRx2Hzfg2047sBb-2qhJVOhSXJVhI,12472
|
|
183
|
+
regscale/integrations/commercial/microsoft_defender/defender_constants.py,sha256=F41IcTchYSOWSl1LpUk_MzXGHK2cxa695hLlwVhGQ-E,3439
|
|
184
|
+
regscale/integrations/commercial/microsoft_defender/defender_scanner.py,sha256=gUTtbv-yB2gDa3xXZpx1Ygq0hqa77I28516UOrwvla4,10615
|
|
181
185
|
regscale/integrations/commercial/nessus/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
182
186
|
regscale/integrations/commercial/nessus/nessus_utils.py,sha256=lP1_xVmYeyL17muy0jGMnJ5xdON3mi22BVAyDHa9WfU,13525
|
|
183
187
|
regscale/integrations/commercial/nessus/scanner.py,sha256=sQWoO1qCEl43Ww1fjJ3v231AVNWco5bKmuzzUM-Ax4Q,17455
|
|
184
188
|
regscale/integrations/commercial/opentext/__init__.py,sha256=zqCPb_4rYRZZPXfeKn4AoZyyYyQ6MU4C0lCs2ysOBhc,251
|
|
185
189
|
regscale/integrations/commercial/opentext/commands.py,sha256=TTClFg16EzlXQOjdQQ6AdWuVuh7H2zO0V9rXd73-ni0,2572
|
|
186
190
|
regscale/integrations/commercial/opentext/scanner.py,sha256=QAb9FPiYeQCEnqL3dnFBFe64LydwLaR8HWpYmabgcbE,22581
|
|
187
|
-
regscale/integrations/commercial/qualys/__init__.py,sha256=
|
|
188
|
-
regscale/integrations/commercial/qualys/containers.py,sha256=
|
|
191
|
+
regscale/integrations/commercial/qualys/__init__.py,sha256=K9MfFXzLEmj3vRiQ6Mw7LpZa6AI6OugJaVYhyRKrGzA,89871
|
|
192
|
+
regscale/integrations/commercial/qualys/containers.py,sha256=KD9DJlE7E9y0_BM-HJtizr03p9dMEi-2uO4bwdwCP8M,12163
|
|
189
193
|
regscale/integrations/commercial/qualys/qualys_error_handler.py,sha256=2nlxeNLQMOpkiTij39VTsZg-2AFQsM6-rwlBW2pVpKY,18594
|
|
190
|
-
regscale/integrations/commercial/qualys/scanner.py,sha256=
|
|
194
|
+
regscale/integrations/commercial/qualys/scanner.py,sha256=fKtMo2IHyBHG0Y5xgATztr3fXjzNIBIeXEUP_87w2W4,56732
|
|
191
195
|
regscale/integrations/commercial/qualys/variables.py,sha256=TPoIW5_yNmU6c0AlLOpHQdxp6OrH8jUmMJikqT7YYz8,962
|
|
192
196
|
regscale/integrations/commercial/sap/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
193
197
|
regscale/integrations/commercial/sap/click.py,sha256=pWgjUOA_4WKkDUWcE8z4EshnJUdrTl15NKUfKpKyqzE,522
|
|
@@ -230,13 +234,16 @@ regscale/integrations/commercial/trivy/scanner.py,sha256=iiwTvjqRlLRgQvCs_FP0j83
|
|
|
230
234
|
regscale/integrations/commercial/wizv2/WizDataMixin.py,sha256=s7F_rVrP9IZa_x_vh3MswR7W_UBHRfd4kHGVsNX4ips,3606
|
|
231
235
|
regscale/integrations/commercial/wizv2/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
232
236
|
regscale/integrations/commercial/wizv2/async_client.py,sha256=a_UVGKFpfmufZLaigFaWFQTS8xTrJF6NcNKQjG7pMcw,12819
|
|
233
|
-
regscale/integrations/commercial/wizv2/click.py,sha256=
|
|
237
|
+
regscale/integrations/commercial/wizv2/click.py,sha256=qTNLsl6ZRgN-O2Bnguav9ztaWaAgdTHFpiJVebpD5iM,15350
|
|
234
238
|
regscale/integrations/commercial/wizv2/constants.py,sha256=E7DDUhPVp372wZCVZZffdD7LRO6tGdxljaR_aHlzEx0,46910
|
|
239
|
+
regscale/integrations/commercial/wizv2/data_fetcher.py,sha256=tMdwWfaQCqLpZg9tGEPdl1eM56zU0RkEWi2Jm3-7A6Y,13804
|
|
240
|
+
regscale/integrations/commercial/wizv2/finding_processor.py,sha256=Rn2dYob4cz24_Ks-UTwNQe-KQ6hmFWS6GB8PQXV0ZPE,11361
|
|
235
241
|
regscale/integrations/commercial/wizv2/issue.py,sha256=PA_7BNpCnHGoAc1caU6COGHaIIvCBvIt6DLn3L7Bilo,13451
|
|
236
242
|
regscale/integrations/commercial/wizv2/parsers.py,sha256=dsSMiZaUrBXbuW7U-I5nLoF-TQlpvXys83sTSqT4Yks,11819
|
|
237
|
-
regscale/integrations/commercial/wizv2/policy_compliance.py,sha256=
|
|
243
|
+
regscale/integrations/commercial/wizv2/policy_compliance.py,sha256=GjqgQu8o3Hajd17nXcPyU9qsM-6ZDzNt2pQs6ZONzbg,129874
|
|
244
|
+
regscale/integrations/commercial/wizv2/policy_compliance_helpers.py,sha256=-KAlDxMiojyUX2DtUi3uVbpmFhDLtGs7wj11MPBCaRE,22174
|
|
238
245
|
regscale/integrations/commercial/wizv2/sbom.py,sha256=QcGaYiBGtZ3mBcbo-KGl-I2u6QHKAIinTk26LPy0Kng,4466
|
|
239
|
-
regscale/integrations/commercial/wizv2/scanner.py,sha256=
|
|
246
|
+
regscale/integrations/commercial/wizv2/scanner.py,sha256=weSjSBFvvgHmMJp4lpjgomgvBIJ7rjpg_7W7JW-ds-A,74566
|
|
240
247
|
regscale/integrations/commercial/wizv2/utils.py,sha256=npdIwR_XG_5VZkr_YXgMe8cjhcYKncNndglD55qwWc8,55996
|
|
241
248
|
regscale/integrations/commercial/wizv2/variables.py,sha256=2DVIN4JPYX9hN6wTdEI9ZdHXYDPpYSu4mAC0yVibPLg,1992
|
|
242
249
|
regscale/integrations/commercial/wizv2/wiz_auth.py,sha256=qGcUhpC9eRkJIngmv3i9yHdp0q9rv6AvA5gHkypYzCE,5549
|
|
@@ -260,7 +267,7 @@ regscale/integrations/public/fedramp/docx_parser.py,sha256=EA9g1iTlB6-GtOzV9JwGW
|
|
|
260
267
|
regscale/integrations/public/fedramp/fedramp_cis_crm.py,sha256=IVASI6W0uEOg_SyxJSqyHev1KzSwEnF1RTWYT3qfViw,64576
|
|
261
268
|
regscale/integrations/public/fedramp/fedramp_common.py,sha256=Mdy3_WdCEcTwSXEEKXiODmr2YJTWcTg6jfyWZJWfruQ,115406
|
|
262
269
|
regscale/integrations/public/fedramp/fedramp_docx.py,sha256=eKkRwfcIi4aHJp4ajKDUGJECItwrZwYfCiKzmfB2W1Q,13703
|
|
263
|
-
regscale/integrations/public/fedramp/fedramp_five.py,sha256=
|
|
270
|
+
regscale/integrations/public/fedramp/fedramp_five.py,sha256=A4ssNsdMrTTFGOEO8WnQhD-DQrfk74LASgFAaqii_S8,96730
|
|
264
271
|
regscale/integrations/public/fedramp/fedramp_traversal.py,sha256=BkgwsFluZO5g0Rc0WujYgbc1_YLofamJzFP7Z5UYfao,4528
|
|
265
272
|
regscale/integrations/public/fedramp/import_fedramp_r4_ssp.py,sha256=Opld0vEZ4b71cIDogu6ykTUL86tXZVTSnwQzjz8w_4U,9925
|
|
266
273
|
regscale/integrations/public/fedramp/import_workbook.py,sha256=VFNBjBNLLRL3WjkJmE9CamizNsLgfdX5g8YolOr8lPY,19658
|
|
@@ -292,7 +299,7 @@ regscale/integrations/public/fedramp/poam/scanner.py,sha256=M15Mx6xC1IjSbJ4ZHXjF
|
|
|
292
299
|
regscale/integrations/transformer/__init__.py,sha256=XFmkvjPjpZkQPknz0NEC0pQsWA2JNtPygbeUCf_b5jk,484
|
|
293
300
|
regscale/integrations/transformer/data_transformer.py,sha256=J2FlY1vqPVzVafE4AwjJZvuN_rmsg4xP6qZjNqQtBt8,15407
|
|
294
301
|
regscale/integrations/transformer/mappings/__init__.py,sha256=Pp6Qb0dVtr0ehIujmSbNLzQy2nVogLajiDfP4XY_7-w,247
|
|
295
|
-
regscale/models/__init__.py,sha256
|
|
302
|
+
regscale/models/__init__.py,sha256=GiFSVSzrDHycgDfkyxBHPsnVgRFbO20jRri3YCeq604,320
|
|
296
303
|
regscale/models/click_models.py,sha256=EI0HFFXQvGy53boZ473ayDJP-qpQsCdufD0xkUGqM3I,15295
|
|
297
304
|
regscale/models/config.py,sha256=M_ftoZUgYL8x1CliDk8Pw6jMhPlz83_xh_Gi8lAabQ4,5420
|
|
298
305
|
regscale/models/email_style.css,sha256=d8PlsCiOxmmkp2Qc7T4qI9Ha5mT12Jn9kRBMOk2xx2Q,2202
|
|
@@ -313,7 +320,7 @@ regscale/models/integration_models/azure_alerts.py,sha256=2etrpvcxa7jVQrc98bJlVG
|
|
|
313
320
|
regscale/models/integration_models/base64.py,sha256=sxV6O5qY1_TstJENX5jBPsSdQwmA83-NNhgJFunXiZE,570
|
|
314
321
|
regscale/models/integration_models/burp.py,sha256=FBEBkH3U0Q8vq71FFoWnvgLRF5Hkr9GYmQFmNNHFrVk,16932
|
|
315
322
|
regscale/models/integration_models/burp_models.py,sha256=UytDTAcCaxyu-knFkm_mEUH6UmWK3OTXKSC9Sc6OjVs,3669
|
|
316
|
-
regscale/models/integration_models/cisa_kev_data.json,sha256=
|
|
323
|
+
regscale/models/integration_models/cisa_kev_data.json,sha256=rS7XvjrNcm6PObHircKJqKgO01ZhN5XhqehYerDuphQ,1253951
|
|
317
324
|
regscale/models/integration_models/defender_data.py,sha256=jsAcjKxiGmumGerj7xSWkFd6r__YpuKDnYX5o7xHDiE,2844
|
|
318
325
|
regscale/models/integration_models/defenderimport.py,sha256=Ze4kgwns-IYPyO7sBjEzW8PXWlxwU-DAo2fIyRcTC3k,6242
|
|
319
326
|
regscale/models/integration_models/drf.py,sha256=Aq7AdLa_CH97NrnR-CxaFI22JjVN9uCxVN7Z-BBUaNU,18896
|
|
@@ -344,7 +351,7 @@ regscale/models/integration_models/flat_file_importer/__init__.py,sha256=IoM8SPj
|
|
|
344
351
|
regscale/models/integration_models/sbom/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
345
352
|
regscale/models/integration_models/sbom/cyclone_dx.py,sha256=0pFR0BWBrF5c8_cC_8mj2MXvNOMHOdHbBYXvTVfFAh8,4058
|
|
346
353
|
regscale/models/integration_models/synqly_models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
347
|
-
regscale/models/integration_models/synqly_models/capabilities.json,sha256=
|
|
354
|
+
regscale/models/integration_models/synqly_models/capabilities.json,sha256=GfJbg6I-_X1O7nyz1GkRMhvthJb6Zy09nisSdrE7UY4,392385
|
|
348
355
|
regscale/models/integration_models/synqly_models/connector_types.py,sha256=8nxptkTexpskySnmL0obNAff_iu_fx6tJ7i1-4hJvao,461
|
|
349
356
|
regscale/models/integration_models/synqly_models/ocsf_mapper.py,sha256=e2kTOhWSNRnzbgMchMx-7c21pCgSv2DqWnxvajKEKJM,16960
|
|
350
357
|
regscale/models/integration_models/synqly_models/param.py,sha256=Xt5Zm6lC_VkLj7LF2qXo72TJZHysqttsp5ai0NCf1po,2643
|
|
@@ -402,7 +409,7 @@ regscale/models/regscale_models/implementation_role.py,sha256=ZjJOhjM3dVlulsGx3l
|
|
|
402
409
|
regscale/models/regscale_models/incident.py,sha256=jsS4MfigzjwFphvdIrBk62GfvbceQ8VL-AhfQSQM460,6028
|
|
403
410
|
regscale/models/regscale_models/inherited_control.py,sha256=RuQJgVyZgfoIrUG_vvwQYHECb3wsFjDH-zPj-bIFBNU,2007
|
|
404
411
|
regscale/models/regscale_models/interconnection.py,sha256=8Q9CGeHEX9TXQrim_NIAj9KuM4MwaUTpBLs_LKaXAlw,1256
|
|
405
|
-
regscale/models/regscale_models/issue.py,sha256=
|
|
412
|
+
regscale/models/regscale_models/issue.py,sha256=h88GRUD1YtC0-bVHXm3p9owDt1F0bJD48tzm03HkrOg,59248
|
|
406
413
|
regscale/models/regscale_models/leveraged_authorization.py,sha256=OUrL8JQV3r7T3ldHlL6Y_ZLv6KuQIC-3eZW5wZ7XFUk,4192
|
|
407
414
|
regscale/models/regscale_models/line_of_inquiry.py,sha256=Uu0lQEhif0W6yTSkJo27GyQGmExSngJvyqGBTr4Q8Fg,1713
|
|
408
415
|
regscale/models/regscale_models/link.py,sha256=lAY4Ig3Menm1EqfcAbVJ7jsCsRO5tWtJIf-9-G9FXT8,6593
|
|
@@ -495,8 +502,6 @@ tests/mocks/response.py,sha256=fUF2jrrxgmGUKXUcWWOSA457yrEyM1EB28G6RqPO9a0,1040
|
|
|
495
502
|
tests/mocks/xml.py,sha256=WYeZRZfyYmOi4TTvF7I53l3gKF4x1DE1dqy08szPkfQ,261
|
|
496
503
|
tests/regscale/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
497
504
|
tests/regscale/test_about.py,sha256=32YZC8XJW5QkIYIfwEVGIdIxQNUIbyzn3OzVcX_5X24,635
|
|
498
|
-
tests/regscale/test_authorization.py,sha256=fls5ODCYiu0DdkwXFepO_GM-BP6tRaPmMCZWX6VD2e8,1899
|
|
499
|
-
tests/regscale/test_init.py,sha256=O_3Dh7s7ObycIZyd0-Y10NCTKdGnrnotcpU6CUB5pno,4180
|
|
500
505
|
tests/regscale/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
501
506
|
tests/regscale/core/test_api.py,sha256=25AsIT-jg8SrlkPeynUwwm4PvTOrHcRO2Ba_omnNLUY,7512
|
|
502
507
|
tests/regscale/core/test_app.py,sha256=wvxpp5Wyag2T5-LmPZL02yrYiH8tedVSRle8RhrlB38,42380
|
|
@@ -528,9 +533,9 @@ tests/regscale/models/test_regscale_model.py,sha256=ZsrEZkC4EtdIsoQuayn1xv2gEGcV
|
|
|
528
533
|
tests/regscale/models/test_report.py,sha256=IqUq7C__a1_q_mLaz0PE9Lq6fHggBsB14-AzEYNBxLw,4666
|
|
529
534
|
tests/regscale/models/test_tenable_integrations.py,sha256=PNJC2Zu6lv1xj7y6e1yOsz5FktSU3PRKb5x3n5YG3w0,4072
|
|
530
535
|
tests/regscale/models/test_user_model.py,sha256=e9olv28qBApgnvK6hFHOgXjUC-pkaV8aGDirEIWASL4,4427
|
|
531
|
-
regscale_cli-6.21.
|
|
532
|
-
regscale_cli-6.21.
|
|
533
|
-
regscale_cli-6.21.
|
|
534
|
-
regscale_cli-6.21.
|
|
535
|
-
regscale_cli-6.21.
|
|
536
|
-
regscale_cli-6.21.
|
|
536
|
+
regscale_cli-6.21.2.0.dist-info/LICENSE,sha256=ytNhYQ9Rmhj_m-EX2pPq9Ld6tH5wrqqDYg-fCf46WDU,1076
|
|
537
|
+
regscale_cli-6.21.2.0.dist-info/METADATA,sha256=MqoS0sl4OZ364E34R6tvMovjED3MWz63xJwSoipU1EQ,34955
|
|
538
|
+
regscale_cli-6.21.2.0.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
539
|
+
regscale_cli-6.21.2.0.dist-info/entry_points.txt,sha256=cLOaIP1eRv1yZ2u7BvpE3aB4x3kDrDwkpeisKOu33z8,269
|
|
540
|
+
regscale_cli-6.21.2.0.dist-info/top_level.txt,sha256=Uv8VUCAdxRm70bgrD4YNEJUmDhBThad_1aaEFGwRByc,15
|
|
541
|
+
regscale_cli-6.21.2.0.dist-info/RECORD,,
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
"""Test the platform module."""
|
|
2
|
-
|
|
3
|
-
import os
|
|
4
|
-
from unittest.mock import patch
|
|
5
|
-
from unittest import skip
|
|
6
|
-
|
|
7
|
-
import pytest
|
|
8
|
-
|
|
9
|
-
from regscale.core.app.application import Application
|
|
10
|
-
from regscale.core.app.api import Api
|
|
11
|
-
from regscale.core.login import get_regscale_token
|
|
12
|
-
from regscale.models import platform
|
|
13
|
-
|
|
14
|
-
PATH = "regscale.models.platform"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
@pytest.fixture
|
|
18
|
-
def env_variables():
|
|
19
|
-
os.environ["REGSCALE_USER"] = "testuser"
|
|
20
|
-
os.environ["REGSCALE_PASSWORD"] = "testpassword"
|
|
21
|
-
os.environ["REGSCALE_DOMAIN"] = "https://testdomain.com"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
@patch(f"{PATH}.get_regscale_token", return_value=("billy", "zane"))
|
|
25
|
-
def test_RegScaleAuth_model_behaves(mock_get_regscale_token):
|
|
26
|
-
api = Api()
|
|
27
|
-
"""The RegScaleAuth BaseModel class does lots of things, let's test them."""
|
|
28
|
-
un = "funkenstein"
|
|
29
|
-
pw = "groovin'tothewaveoftheflag"
|
|
30
|
-
domain = "disinfo.org"
|
|
31
|
-
model = platform.RegScaleAuth.authenticate(
|
|
32
|
-
api=api,
|
|
33
|
-
username=un,
|
|
34
|
-
password=pw,
|
|
35
|
-
domain=domain,
|
|
36
|
-
)
|
|
37
|
-
mock_get_regscale_token.assert_called_once()
|
|
38
|
-
assert isinstance(model, platform.RegScaleAuth)
|
|
39
|
-
assert model.token == "Bearer zane"
|
|
40
|
-
assert model.user_id == "billy"
|
|
41
|
-
assert model.username == un
|
|
42
|
-
assert model.password.get_secret_value() == pw
|
|
43
|
-
assert model.domain == domain
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
@skip("Skipping this test because MFA is required to log into DEV")
|
|
47
|
-
def test_RegScaleAuth_model():
|
|
48
|
-
"""The RegScaleAuth BaseModel class is based"""
|
|
49
|
-
app = Application()
|
|
50
|
-
api = Api()
|
|
51
|
-
domain = app.config["domain"]
|
|
52
|
-
model = platform.RegScaleAuth.authenticate(
|
|
53
|
-
api=api,
|
|
54
|
-
domain=domain,
|
|
55
|
-
)
|
|
56
|
-
assert model.token
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
@skip("Skipping this test because MFA is required to log into DEV")
|
|
60
|
-
def test_get_regscale_token(env_variables):
|
|
61
|
-
api = Api()
|
|
62
|
-
user_id, auth_token = get_regscale_token(api)
|
|
63
|
-
print(auth_token)
|
|
64
|
-
assert isinstance(user_id, str)
|
|
65
|
-
assert isinstance(auth_token, str)
|
tests/regscale/test_init.py
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import sys
|
|
2
|
-
import types
|
|
3
|
-
import unittest
|
|
4
|
-
from unittest.mock import patch, mock_open, MagicMock
|
|
5
|
-
|
|
6
|
-
airflow_exceptions = types.ModuleType("airflow.exceptions")
|
|
7
|
-
airflow_exceptions.AirflowException = Exception
|
|
8
|
-
sys.modules["airflow.exceptions"] = airflow_exceptions
|
|
9
|
-
|
|
10
|
-
airflow_settings = types.ModuleType("airflow.settings")
|
|
11
|
-
airflow_settings.initialize = lambda: None
|
|
12
|
-
airflow_settings.LAZY_LOAD_PROVIDERS = True
|
|
13
|
-
sys.modules["airflow.settings"] = airflow_settings
|
|
14
|
-
|
|
15
|
-
sys.modules["airflow.configuration"] = types.ModuleType("airflow.configuration")
|
|
16
|
-
|
|
17
|
-
airflow_operators = types.ModuleType("airflow.operators")
|
|
18
|
-
airflow_operators_python = types.ModuleType("airflow.operators.python")
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
class DummyPythonOperator:
|
|
22
|
-
def __init__(self, *args, **kwargs):
|
|
23
|
-
# This dummy operator is intentionally left empty because it is only used
|
|
24
|
-
# to mock Airflow's PythonOperator for testing purposes. No initialization logic is needed.
|
|
25
|
-
pass
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
airflow_operators_python.PythonOperator = DummyPythonOperator
|
|
29
|
-
sys.modules["airflow.operators"] = airflow_operators
|
|
30
|
-
sys.modules["airflow.operators.python"] = airflow_operators_python
|
|
31
|
-
|
|
32
|
-
from regscale.airflow.tasks.init import get_shared_keys, set_shared_config_values # noqa: E402
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
class TestInitPy(unittest.TestCase):
|
|
36
|
-
@patch("regscale.airflow.tasks.init.execute_click_command")
|
|
37
|
-
@patch("yaml.safe_load", return_value={"foo": "bar"})
|
|
38
|
-
@patch("pathlib.Path.open", new_callable=mock_open, read_data="foo: bar\n")
|
|
39
|
-
def test_get_shared_keys(self, mock_file, mock_yaml, mock_exec):
|
|
40
|
-
"""
|
|
41
|
-
If the YAML and dag_run.conf share a key, we should get that key back and execute the click command once.
|
|
42
|
-
"""
|
|
43
|
-
dag_context = {"dag_run": MagicMock(conf={"foo": "baz"})}
|
|
44
|
-
shared_keys = get_shared_keys("dummy.yaml", **dag_context)
|
|
45
|
-
self.assertEqual(shared_keys, ["foo"])
|
|
46
|
-
mock_exec.assert_called_once()
|
|
47
|
-
|
|
48
|
-
@patch("regscale.airflow.tasks.init.execute_click_command")
|
|
49
|
-
def test_set_shared_config_values(self, mock_exec):
|
|
50
|
-
"""
|
|
51
|
-
When shared keys are found in xcom, set_shared_config_values should call execute_click_command for each.
|
|
52
|
-
"""
|
|
53
|
-
dag_context = {
|
|
54
|
-
"dag_run": MagicMock(conf={"foo": "bar", "op_kwargs": {"shared_keys_task": "task1"}}),
|
|
55
|
-
"ti": MagicMock(xcom_pull=MagicMock(return_value=["foo"])),
|
|
56
|
-
}
|
|
57
|
-
set_shared_config_values(shared_keys_task=None, **dag_context)
|
|
58
|
-
mock_exec.assert_called_once()
|
|
59
|
-
|
|
60
|
-
def test_set_shared_config_values_raises(self):
|
|
61
|
-
"""
|
|
62
|
-
If op_kwargs is missing from dag_run.conf, set_shared_config_values should raise an AirflowException.
|
|
63
|
-
"""
|
|
64
|
-
from airflow.exceptions import AirflowException
|
|
65
|
-
|
|
66
|
-
dag_context = {"dag_run": MagicMock(conf={})}
|
|
67
|
-
with self.assertRaises(AirflowException):
|
|
68
|
-
set_shared_config_values(shared_keys_task=None, **dag_context)
|
|
69
|
-
|
|
70
|
-
@patch("regscale.airflow.tasks.init.execute_click_command")
|
|
71
|
-
def test_set_shared_config_values_warns(self, mock_exec):
|
|
72
|
-
"""
|
|
73
|
-
If xcom_pull returns None, set_shared_config_values should log a warning and not call execute_click_command.
|
|
74
|
-
"""
|
|
75
|
-
dag_context = {
|
|
76
|
-
"dag_run": MagicMock(conf={"foo": "bar", "op_kwargs": {"shared_keys_task": "task1"}}),
|
|
77
|
-
"ti": MagicMock(xcom_pull=MagicMock(return_value=None)),
|
|
78
|
-
}
|
|
79
|
-
with self.assertLogs(level="WARNING") as log:
|
|
80
|
-
set_shared_config_values(shared_keys_task=None, **dag_context)
|
|
81
|
-
self.assertTrue(any("No shared keys found" in msg for msg in log.output))
|
|
82
|
-
mock_exec.assert_not_called()
|
|
83
|
-
|
|
84
|
-
@patch("yaml.safe_load", return_value={"foo": "bar"})
|
|
85
|
-
@patch("pathlib.Path.open", new_callable=mock_open, read_data="foo: bar\n")
|
|
86
|
-
def test_get_shared_keys_logs_error(self, mock_file, mock_yaml):
|
|
87
|
-
"""
|
|
88
|
-
If dag_run is missing from the context, get_shared_keys should log an error and raise KeyError.
|
|
89
|
-
"""
|
|
90
|
-
with self.assertLogs(level="ERROR") as log, self.assertRaises(KeyError):
|
|
91
|
-
get_shared_keys("dummy.yaml")
|
|
92
|
-
self.assertTrue(any("context contains" in msg for msg in log.output))
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
if __name__ == "__main__":
|
|
96
|
-
unittest.main()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|