regscale-cli 6.21.2.2__py3-none-any.whl → 6.22.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/core/app/application.py +3 -0
- regscale/core/app/utils/app_utils.py +31 -0
- regscale/integrations/commercial/jira.py +27 -5
- regscale/integrations/commercial/qualys/__init__.py +160 -60
- regscale/integrations/commercial/qualys/scanner.py +300 -39
- regscale/integrations/commercial/wizv2/async_client.py +4 -0
- regscale/integrations/commercial/wizv2/scanner.py +50 -24
- regscale/integrations/public/__init__.py +13 -0
- regscale/integrations/public/fedramp/fedramp_cis_crm.py +175 -51
- regscale/integrations/scanner_integration.py +513 -145
- regscale/models/integration_models/cisa_kev_data.json +34 -3
- regscale/models/integration_models/synqly_models/capabilities.json +1 -1
- regscale/models/regscale_models/__init__.py +2 -0
- regscale/models/regscale_models/catalog.py +1 -1
- regscale/models/regscale_models/control_implementation.py +8 -8
- regscale/models/regscale_models/form_field_value.py +5 -3
- regscale/models/regscale_models/inheritance.py +44 -0
- regscale/regscale.py +2 -0
- {regscale_cli-6.21.2.2.dist-info → regscale_cli-6.22.0.0.dist-info}/METADATA +1 -1
- {regscale_cli-6.21.2.2.dist-info → regscale_cli-6.22.0.0.dist-info}/RECORD +26 -28
- tests/regscale/models/test_tenable_integrations.py +811 -105
- regscale/integrations/public/fedramp/mappings/fedramp_r4_parts.json +0 -7388
- regscale/integrations/public/fedramp/mappings/fedramp_r5_parts.json +0 -9605
- regscale/integrations/public/fedramp/parts_mapper.py +0 -107
- {regscale_cli-6.21.2.2.dist-info → regscale_cli-6.22.0.0.dist-info}/LICENSE +0 -0
- {regscale_cli-6.21.2.2.dist-info → regscale_cli-6.22.0.0.dist-info}/WHEEL +0 -0
- {regscale_cli-6.21.2.2.dist-info → regscale_cli-6.22.0.0.dist-info}/entry_points.txt +0 -0
- {regscale_cli-6.21.2.2.dist-info → regscale_cli-6.22.0.0.dist-info}/top_level.txt +0 -0
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import json
|
|
2
|
-
from typing import List, Optional, Tuple
|
|
3
|
-
|
|
4
|
-
from regscale.core.decorators import singleton
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
@singleton
|
|
8
|
-
class PartMapper:
|
|
9
|
-
"""
|
|
10
|
-
PartMapper class Standardized approach to mapping identifiers between control id in FedRAMP and other frameworks
|
|
11
|
-
|
|
12
|
-
# Example usage
|
|
13
|
-
mapper = PartMapper()
|
|
14
|
-
mapper.load_fedramp_version_5_mapping() or mapper.load_json_from_file("path/to/fedramp_r5_parts.json")
|
|
15
|
-
control_label_and_part_results = mapper.find_by_control_label_and_part("AC-1", "a1")
|
|
16
|
-
oscal_control_id_and_part_results = mapper.find_by_oscal_control_id_and_part("ac-1", "a1")
|
|
17
|
-
print("Results for control label 'AC-1' and part 'a1':", control_label_and_part_results)
|
|
18
|
-
print("Results for OSCAL control ID 'ac-1' and part 'a1':", oscal_control_id_and_part_results)
|
|
19
|
-
"""
|
|
20
|
-
|
|
21
|
-
def __init__(self):
|
|
22
|
-
self.data = []
|
|
23
|
-
|
|
24
|
-
def find_by_source(self, source: str) -> Optional[str]:
|
|
25
|
-
"""
|
|
26
|
-
Find a mapping by source.
|
|
27
|
-
:param str source: The source.
|
|
28
|
-
:return: A str of the oscal part identifier or null.
|
|
29
|
-
:rtype: Optional[str]
|
|
30
|
-
"""
|
|
31
|
-
result = None
|
|
32
|
-
for item in self.data:
|
|
33
|
-
if str(item.get("SOURCE")).strip() == source:
|
|
34
|
-
result = item.get("OSCAL_PART_IDENTIFIER")
|
|
35
|
-
return result
|
|
36
|
-
return result
|
|
37
|
-
|
|
38
|
-
def find_sub_parts(self, source: str) -> List[str]:
|
|
39
|
-
"""
|
|
40
|
-
Find a mapping by source.
|
|
41
|
-
:param str source: The source.
|
|
42
|
-
:return: A list of sub-parts.
|
|
43
|
-
:rtype: List[str]
|
|
44
|
-
"""
|
|
45
|
-
result = []
|
|
46
|
-
for item in self.data:
|
|
47
|
-
if str(item.get("SOURCE")).strip() == source:
|
|
48
|
-
parts = item.get("SUB_PARTS", [])
|
|
49
|
-
return parts
|
|
50
|
-
return result
|
|
51
|
-
|
|
52
|
-
def load_json_from_file(self, json_file: str):
|
|
53
|
-
"""
|
|
54
|
-
Load json from a file
|
|
55
|
-
:param str json_file: string name of a file
|
|
56
|
-
"""
|
|
57
|
-
with open(json_file) as jf:
|
|
58
|
-
parsed_json = json.load(jf)
|
|
59
|
-
self.data = parsed_json
|
|
60
|
-
|
|
61
|
-
def load_fedramp_version_5_mapping(self):
|
|
62
|
-
"""
|
|
63
|
-
Load FedRAMP version 5 mapping
|
|
64
|
-
"""
|
|
65
|
-
from importlib.resources import path as resource_path
|
|
66
|
-
|
|
67
|
-
with resource_path("regscale.integrations.public.fedramp.mappings", "fedramp_r5_parts.json") as json_file_path:
|
|
68
|
-
self.load_json_from_file(json_file_path.__str__())
|
|
69
|
-
|
|
70
|
-
def load_fedramp_version_4_mapping(self):
|
|
71
|
-
"""
|
|
72
|
-
Load FedRAMP version 4 mapping
|
|
73
|
-
"""
|
|
74
|
-
from importlib.resources import path as resource_path
|
|
75
|
-
|
|
76
|
-
with resource_path("regscale.integrations.public.fedramp.mappings", "fedramp_r4_parts.json") as json_file_path:
|
|
77
|
-
self.load_json_from_file(json_file_path.__str__())
|
|
78
|
-
|
|
79
|
-
def find_by_control_id_and_part_letter(self, control_label: str, part: str) -> list:
|
|
80
|
-
"""
|
|
81
|
-
Find a mapping by control label and part letter.
|
|
82
|
-
:param str control_label: The control label.
|
|
83
|
-
:param str part: The part letter.
|
|
84
|
-
:return: A list of mappings.
|
|
85
|
-
:rtype: list
|
|
86
|
-
"""
|
|
87
|
-
result = [
|
|
88
|
-
item.get("OSCAL_PART_IDENTIFIER")
|
|
89
|
-
for item in self.data
|
|
90
|
-
if item.get("CONTROLLABEL") == control_label and item.get("Part") == part
|
|
91
|
-
]
|
|
92
|
-
return result
|
|
93
|
-
|
|
94
|
-
def find_by_oscal_control_id_and_part_letter(self, oscal_control_id: str, part: str) -> list:
|
|
95
|
-
"""
|
|
96
|
-
Find a mapping by OSCAL control ID and part letter.
|
|
97
|
-
:param str oscal_control_id:
|
|
98
|
-
:param str part:
|
|
99
|
-
:return: A list of mappings.
|
|
100
|
-
:rtype: list
|
|
101
|
-
"""
|
|
102
|
-
result = [
|
|
103
|
-
item.get("OSCAL_PART_IDENTIFIER")
|
|
104
|
-
for item in self.data
|
|
105
|
-
if item.get("OSCALCONTROL_ID") == oscal_control_id and item.get("Part") == part
|
|
106
|
-
]
|
|
107
|
-
return result
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|