regscale-cli 6.16.1.0__py3-none-any.whl → 6.16.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.

Potentially problematic release.


This version of regscale-cli might be problematic. Click here for more details.

Files changed (35) hide show
  1. regscale/__init__.py +1 -1
  2. regscale/core/app/internal/login.py +1 -1
  3. regscale/core/app/internal/poam_editor.py +1 -1
  4. regscale/integrations/commercial/__init__.py +2 -2
  5. regscale/integrations/commercial/ad.py +1 -1
  6. regscale/integrations/commercial/grype/__init__.py +3 -0
  7. regscale/integrations/commercial/grype/commands.py +72 -0
  8. regscale/integrations/commercial/grype/scanner.py +390 -0
  9. regscale/integrations/commercial/import_all/import_all_cmd.py +2 -2
  10. regscale/integrations/commercial/opentext/__init__.py +6 -0
  11. regscale/integrations/commercial/opentext/commands.py +77 -0
  12. regscale/integrations/commercial/opentext/scanner.py +449 -85
  13. regscale/integrations/commercial/trivy/__init__.py +5 -0
  14. regscale/integrations/commercial/trivy/commands.py +74 -0
  15. regscale/integrations/commercial/trivy/scanner.py +276 -0
  16. regscale/integrations/commercial/wizv2/utils.py +1 -1
  17. regscale/integrations/jsonl_scanner_integration.py +869 -0
  18. regscale/integrations/public/fedramp/fedramp_common.py +4 -4
  19. regscale/integrations/public/fedramp/inventory_items.py +3 -3
  20. regscale/integrations/scanner_integration.py +172 -41
  21. regscale/models/integration_models/cisa_kev_data.json +20 -5
  22. regscale/models/integration_models/synqly_models/capabilities.json +1 -1
  23. regscale/models/integration_models/tenable_models/integration.py +42 -7
  24. regscale/models/regscale_models/regscale_model.py +1 -1
  25. regscale/models/regscale_models/vulnerability.py +21 -0
  26. {regscale_cli-6.16.1.0.dist-info → regscale_cli-6.16.2.0.dist-info}/METADATA +3 -3
  27. {regscale_cli-6.16.1.0.dist-info → regscale_cli-6.16.2.0.dist-info}/RECORD +32 -27
  28. regscale/integrations/commercial/grype.py +0 -165
  29. regscale/integrations/commercial/opentext/click.py +0 -99
  30. regscale/integrations/commercial/trivy.py +0 -162
  31. /regscale/models/integration_models/{flat_file_importer.py → flat_file_importer/__init__.py} +0 -0
  32. {regscale_cli-6.16.1.0.dist-info → regscale_cli-6.16.2.0.dist-info}/LICENSE +0 -0
  33. {regscale_cli-6.16.1.0.dist-info → regscale_cli-6.16.2.0.dist-info}/WHEEL +0 -0
  34. {regscale_cli-6.16.1.0.dist-info → regscale_cli-6.16.2.0.dist-info}/entry_points.txt +0 -0
  35. {regscale_cli-6.16.1.0.dist-info → regscale_cli-6.16.2.0.dist-info}/top_level.txt +0 -0
@@ -3,6 +3,7 @@ This module contains the Tenable SC Integration class that is responsible for fe
3
3
  """
4
4
 
5
5
  import logging
6
+ import re
6
7
  from typing import Any, Iterator, List, Optional, Tuple
7
8
 
8
9
  from regscale.core.app.utils.app_utils import epoch_to_datetime
@@ -114,14 +115,34 @@ class SCIntegration(ScannerIntegration):
114
115
 
115
116
  validated_match = integration_mapping.field_map_validation(obj=vuln, model_type="asset")
116
117
  asset_identifier = validated_match or vuln.dnsName or vuln.dns or vuln.ip
117
- cvss_score = self.get_cvss_score(vuln)
118
+ cvss_scores = self.get_cvss_scores(vuln)
118
119
  severity = self.finding_severity_map.get(vuln.severity.name, regscale_models.IssueSeverity.Low)
119
120
 
121
+ installed_versions_str = ""
122
+ fixed_versions_str = ""
123
+ package_path_str = ""
124
+
125
+ if "Installed package" in vuln.pluginText:
126
+ installed_versions = re.findall(r"Installed package\s*:\s*(\S+)", vuln.pluginText)
127
+ installed_versions_str = ", ".join(installed_versions)
128
+ if "Fixed package" in vuln.pluginText:
129
+ fixed_versions = re.findall(r"Fixed package\s*:\s*(\S+)", vuln.pluginText)
130
+ fixed_versions_str = ", ".join(fixed_versions)
131
+ if "Path" in vuln.pluginText:
132
+ package_path = re.findall(r"Path\s*:\s*(\S+)", vuln.pluginText)
133
+ package_path_str = ", ".join(package_path)
134
+ if "Installed version" in vuln.pluginText:
135
+ installed_versions = re.findall(r"Installed version\s*:\s*(.+)", vuln.pluginText)
136
+ installed_versions_str = ", ".join(installed_versions)
137
+ if "Fixed version" in vuln.pluginText:
138
+ fixed_versions = re.findall(r"Fixed version\s*:\s*(.+)", vuln.pluginText)
139
+ fixed_versions_str = ", ".join(fixed_versions)
140
+
120
141
  return IntegrationFinding(
121
142
  control_labels=[], # Add an empty list for control_labels
122
143
  category="Tenable SC Vulnerability", # Add a default category
123
144
  dns=vuln.dnsName,
124
- title=getter("title") or (vuln.synopsis or vuln.pluginName), # BMC Add CVE to title
145
+ title=getter("title") or f"{cve}: {vuln.synopsis}" if cve else (vuln.synopsis or vuln.pluginName),
125
146
  description=getter("description") or (vuln.description or vuln.pluginInfo),
126
147
  severity=severity,
127
148
  status=regscale_models.IssueStatus.Open, # Findings of > Low are considered as FAIL
@@ -133,8 +154,11 @@ class SCIntegration(ScannerIntegration):
133
154
  date_last_updated=epoch_to_datetime(vuln.lastSeen),
134
155
  recommendation_for_mitigation=vuln.solution,
135
156
  cve=cve,
136
- cvss_v3_score=cvss_score,
137
- cvss_score=cvss_score,
157
+ cvss_v3_score=cvss_scores.get("cvss_v3_base_score", 0.0),
158
+ cvss_score=cvss_scores.get("cvss_v3_base_score", 0.0),
159
+ cvss_v3_vector=vuln.cvssV3Vector,
160
+ cvss_v2_score=cvss_scores.get("cvss_v2_base_score", 0.0),
161
+ cvss_v2_vector=vuln.cvssVector,
138
162
  vpr_score=float(vuln.vprScore) if vuln.vprScore else None,
139
163
  comments=vuln.cvssV3Vector,
140
164
  plugin_id=vuln.pluginID,
@@ -144,9 +168,16 @@ class SCIntegration(ScannerIntegration):
144
168
  basis_for_adjustment="Tenable SC import",
145
169
  vulnerability_type="Tenable SC Vulnerability",
146
170
  vulnerable_asset=vuln.dnsName,
171
+ build_version="",
172
+ affected_os=vuln.operatingSystem,
173
+ affected_packages=vuln.pluginName,
174
+ package_path=package_path_str,
175
+ installed_versions=installed_versions_str,
176
+ fixed_versions=fixed_versions_str,
177
+ fix_status="",
147
178
  )
148
179
 
149
- def get_cvss_score(self, vuln: TenableAsset) -> float:
180
+ def get_cvss_scores(self, vuln: TenableAsset) -> dict:
150
181
  """
151
182
  Returns the CVSS score for the finding
152
183
 
@@ -154,10 +185,14 @@ class SCIntegration(ScannerIntegration):
154
185
  :return: The CVSS score
155
186
  :rtype: float
156
187
  """
188
+ res = {}
157
189
  try:
158
- res = float(vuln.cvssV3BaseScore) if vuln.cvssV3BaseScore else 0.0
190
+ res["cvss_v3_base_score"] = float(vuln.cvssV3BaseScore) if vuln.cvssV3BaseScore else 0.0
191
+ res["cvss_v2_base_score"] = float(vuln.baseScore) if vuln.baseScore else 0.0
159
192
  except (ValueError, TypeError):
160
- res = 0.0
193
+ res["cvss_v3_base_score"] = 0.0
194
+ res["cvss_v2_base_score"] = 0.0
195
+
161
196
  return res
162
197
 
163
198
  def to_integration_asset(self, asset: TenableAsset, **kwargs: dict) -> IntegrationAsset:
@@ -1503,7 +1503,7 @@ class RegScaleModel(BaseModel, ABC):
1503
1503
  :rtype: Optional[T]
1504
1504
  """
1505
1505
  if response and response.ok:
1506
- logger.info(json.dumps(response.json(), indent=4))
1506
+ logger.debug(json.dumps(response.json(), indent=4))
1507
1507
  return cast(T, cls(**response.json()))
1508
1508
  else:
1509
1509
  cls.log_response_error(response=response, suppress_error=suppress_error)
@@ -87,6 +87,17 @@ class Vulnerability(RegScaleModel):
87
87
  isPublic: bool = Field(default=False)
88
88
  dateClosed: Optional[str] = None
89
89
  status: Optional[VulnerabilityStatus] = VulnerabilityStatus.Open
90
+ buildVersion: Optional[str] = None
91
+ cvsSv3BaseVector: Optional[str] = None
92
+ cvsSv2BaseVector: Optional[str] = None
93
+ cvsSv2BaseScore: Optional[Union[float, int]] = None
94
+ affectedOS: Optional[str] = None
95
+ packagePath: Optional[str] = None
96
+ imageDigest: Optional[str] = None
97
+ affectedPackages: Optional[str] = None
98
+ installedVersions: Optional[str] = None
99
+ fixedVersions: Optional[str] = None
100
+ fixStatus: Optional[str] = None
90
101
 
91
102
  @field_validator("plugInId")
92
103
  def validate_regscale_version_and_plugin_id_type(cls, v: Union[int, str]) -> Union[int, str, None]:
@@ -153,6 +164,16 @@ class Vulnerability(RegScaleModel):
153
164
  "tenants_id": "tenantsId",
154
165
  "is_public": "isPublic",
155
166
  "date_closed": "dateClosed",
167
+ "build_version": "buildVersion",
168
+ "cvss_v3_vector": "cvsSv3BaseVector",
169
+ "cvss_v2_score": "cvsSv2BaseScore",
170
+ "cvss_v2_vector": "cvsSv2BaseVector",
171
+ "affected_os": "affectedOS",
172
+ "image_digest": "imageDigest",
173
+ "affected_packages": "affectedPackages",
174
+ "installed_versions": "installedVersions",
175
+ "fixed_versions": "fixedVersions",
176
+ "fix_status": "fixStatus",
156
177
  }
157
178
 
158
179
  # Convert snake_case keys to camelCase
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: regscale-cli
3
- Version: 6.16.1.0
3
+ Version: 6.16.2.0
4
4
  Summary: Command Line Interface (CLI) for bulk processing/loading data into RegScale
5
5
  Home-page: https://github.com/RegScale/regscale-cli
6
6
  Author: Travis Howerton
@@ -579,7 +579,7 @@ See [full documentation on regscale.readme.io](https://regscale.readme.io/docs/o
579
579
 
580
580
  Create a virtual environment and install required Python libraries.
581
581
 
582
- ### Shell
582
+ ### MacOS/Linux
583
583
  ```shell
584
584
  # create and activate python virtual environment
585
585
  python -m venv venv
@@ -597,7 +597,7 @@ pip install regscale-cli
597
597
  pip install "regscale-cli[server]"
598
598
  ```
599
599
 
600
- ### PowerShell
600
+ ### Windows
601
601
  ```PowerShell
602
602
  # create and activate python virtual environment
603
603
  python -m venv venv
@@ -1,4 +1,4 @@
1
- regscale/__init__.py,sha256=Zl0rUzmz7FiI2FBxf2-jmFMhaMnVVHLMBz4s45l-UQg,25
1
+ regscale/__init__.py,sha256=XD37lWEa0uj7RqQy4EgEbfMdhicQo2sDfeBDyyspRf4,25
2
2
  regscale/regscale.py,sha256=kztX3Opi2ERFo3PVAE8ZC9fqzyOwHO3jYuNo6VdCRLM,30730
3
3
  regscale/airflow/__init__.py,sha256=yMwN0Bz4JbM0nl5qY_hPegxo_O2ilhTOL9PY5Njhn-s,270
4
4
  regscale/airflow/click_dags.py,sha256=H3SUR5jkvInNMv1gu-VG-Ja_H-kH145CpQYNalWNAbE,4520
@@ -47,10 +47,10 @@ regscale/core/app/internal/encrypt.py,sha256=yOEMDDlpI0Sc0LkoeCtXbypnOF8cxoDrzKR
47
47
  regscale/core/app/internal/evidence.py,sha256=P_I0wyk37M48NZMWkXwX55HQlTjdxrbhuto4SUMHpt8,50470
48
48
  regscale/core/app/internal/file_uploads.py,sha256=EfQ4ViJBHzU9bxnFunK3ahA6T9A6pnA-Jk2NrtgmrQY,4776
49
49
  regscale/core/app/internal/healthcheck.py,sha256=ef4Mwk19vi71bv-Xkny5_EGG1UXTbCO5dvEIzHyyfVA,2010
50
- regscale/core/app/internal/login.py,sha256=vG6eLXs9zo9iFcA0rGXlBPV2lkCidQmUXtshJMqF-eM,10769
50
+ regscale/core/app/internal/login.py,sha256=k6Qrg0YGs5msY1MgbawpVybLyO5TvhWjZP-xQB_V4xU,10770
51
51
  regscale/core/app/internal/migrations.py,sha256=wHIzb1uglLVOXawnb-K3Yt70Z5QyfQYb8ZZOMDrNRU4,7983
52
52
  regscale/core/app/internal/model_editor.py,sha256=Lt-DmwO9lS7VFZ0eD5Gax6g5gcVRqWq2d7024tzzbNY,61309
53
- regscale/core/app/internal/poam_editor.py,sha256=Id-oodYYPXllSfpxS_fEHkcEG4lmtJ7yH8ldphm3L-Y,22930
53
+ regscale/core/app/internal/poam_editor.py,sha256=3PtpSMpV7bqKFuTHD2ACYcTyB3EEtTRKuYv-XArjd0A,22929
54
54
  regscale/core/app/internal/workflow.py,sha256=SpgYk1QyzdilVLOK1fFzaKhdLspumaugf5VezgboxhQ,4007
55
55
  regscale/core/app/utils/XMLIR.py,sha256=M_RrCsbjznihatkucCKw6dPgHTPQczXyqIdUXWhuCLI,8328
56
56
  regscale/core/app/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -108,10 +108,11 @@ regscale/exceptions/license_exception.py,sha256=5lDYW1uGf7dHFKBkhzYD3FlNnI6W4BIC
108
108
  regscale/exceptions/validation_exception.py,sha256=_DW_GARtPr_Dyy8tolnvC_AYsHRsUUvRz_Rkk8-fjgk,219
109
109
  regscale/integrations/__init__.py,sha256=Sqthp3Jggo7co_go380cLn3OAb0cHwqL609_4QJSFBY,58
110
110
  regscale/integrations/integration_override.py,sha256=PH7t_bf-RCe_it3FJ61tlKX5UghqHuSEQNJWDfCamAg,5480
111
- regscale/integrations/scanner_integration.py,sha256=hWGJlQyFZN875E8mVRtrmzop5ly_0Z1PlvXozbZqQCI,122190
111
+ regscale/integrations/jsonl_scanner_integration.py,sha256=ixHAyTpevqusMpp2LS4vkATUbrCKvG4fSqu8VYOh254,38064
112
+ regscale/integrations/scanner_integration.py,sha256=AEBGdDyzIMavbg1vJm0khd3Kb12anlkzBv_226xV-KA,127632
112
113
  regscale/integrations/variables.py,sha256=_knfoweXyvarsDGijvpsy87tXAXIijKGRXk9Hw5gGlQ,1904
113
- regscale/integrations/commercial/__init__.py,sha256=rz9fcuxoK2TrpOIGr1iikPIbDqSQjrDwmQaiaUq5de4,13147
114
- regscale/integrations/commercial/ad.py,sha256=TB3crro2ov7irsUzEwEh3N8QwhbKvhi4Kmd_k3_c8SI,15508
114
+ regscale/integrations/commercial/__init__.py,sha256=bRSeNMGQorH-A7Pp6U62ll92WbVG8WTyBv2Lp4jlkBw,13160
115
+ regscale/integrations/commercial/ad.py,sha256=YXSmK8vRf6yi2GnREGa5GrE6GelhFrLj44SY8AO1pK0,15509
115
116
  regscale/integrations/commercial/burp.py,sha256=5hK4bVivfnP1H0UnBdTp_A4WfpCgIn2bsjSQ57JF7WQ,2522
116
117
  regscale/integrations/commercial/cpe.py,sha256=eXZeDXicnp1yYgKuyKcthQUYxXi2Pgc__UD8lUqr5H0,4924
117
118
  regscale/integrations/commercial/crowdstrike.py,sha256=3RIF4ISM3PuBufXO9bJ-41ByslMFLe5GKe9TayRR_mU,40254
@@ -119,7 +120,6 @@ regscale/integrations/commercial/defender.py,sha256=SA3cn4tdRcD6ZjbCZgULl3ts2fAU
119
120
  regscale/integrations/commercial/dependabot.py,sha256=V4VbHbwrxHfe7eCilJ7U_MBeIO6X3wetGfIo2DJYe_c,7793
120
121
  regscale/integrations/commercial/ecr.py,sha256=47iCigssDANlfHYGznU4rfOq6O-1QMGOuP8lBmn7Df0,2693
121
122
  regscale/integrations/commercial/gitlab.py,sha256=dzfqJQ68QI1ee_BriNMyPuXLkzOhc2vR1hhVfq2j13Y,12496
122
- regscale/integrations/commercial/grype.py,sha256=81hmc0gpZvNzuh4Hq1dpegY6VsPCgwjBeMAm6mCljqQ,6156
123
123
  regscale/integrations/commercial/ibm.py,sha256=RQrivu4tOl_8gh5iUa9m9sGbHusphP8rnU2BZZc9IMs,2772
124
124
  regscale/integrations/commercial/jira.py,sha256=1fBF3y4kotbD9hFtqZxlBIb4Q6iNkhIKyPI_MUiqZ6w,39222
125
125
  regscale/integrations/commercial/nexpose.py,sha256=lqPw9yk7ywHDoLwPeXKSz9DaLyVzOQIKOotCgayVTNE,2853
@@ -132,7 +132,6 @@ regscale/integrations/commercial/snyk.py,sha256=TLo6FPLQoSoPJI2J-UfsVMPMTL9udKd1
132
132
  regscale/integrations/commercial/sonarcloud.py,sha256=_E4DuKRZUqXNNPsxS3UJ3q6llVu-5sfw5pTHxe_UMk0,9821
133
133
  regscale/integrations/commercial/sqlserver.py,sha256=PcDLmsZ9xU5NlFpwPZyMhhxCgX4JK2Ztn2S6kCG4mws,11614
134
134
  regscale/integrations/commercial/synqly_jira.py,sha256=dmw3m_lKtii2OpVcrmtNJ-ClUNThV8-1IOrWyE2RQLE,33002
135
- regscale/integrations/commercial/trivy.py,sha256=loH0-WNeZ32ZVEiAr3mmsWi5iL1lF14pKjTxaAyvizo,6065
136
135
  regscale/integrations/commercial/veracode.py,sha256=ZEK-CW5nGIYl5bydSxssCpAZYeBLgmSZkrU-ilyRpI0,2910
137
136
  regscale/integrations/commercial/xray.py,sha256=egJO6fCQ8jhSpyu6Gj2xczTtUMEiSAJKDz05dT-YZ6M,2734
138
137
  regscale/integrations/commercial/amazon/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -165,8 +164,11 @@ regscale/integrations/commercial/gcp/__init__.py,sha256=XNiGNoYOGRKgZwqQCqTGRazr
165
164
  regscale/integrations/commercial/gcp/auth.py,sha256=DSakDZL9JE67r5W-USqavCyrRS2rqVQ7-FxGi3h4kNg,3186
166
165
  regscale/integrations/commercial/gcp/control_tests.py,sha256=AvM6Dv2FgFi3bsgXYxq6yxxlbmXuhtFZkmEAJU_qQiE,9913
167
166
  regscale/integrations/commercial/gcp/variables.py,sha256=tFxPS0SXAmYGpaDTVxOLDp4NpDyIgbEWp6OB3x9Jog4,797
167
+ regscale/integrations/commercial/grype/__init__.py,sha256=KRuTTlOokQjrkpOmhrefwdB90k1jGSEIiDYFbPcjAJY,81
168
+ regscale/integrations/commercial/grype/commands.py,sha256=EH6l8b76u89gfeMqosgKaGqcQ95sXRqgAXE6xQz6Q2w,2027
169
+ regscale/integrations/commercial/grype/scanner.py,sha256=0nrjXq3_alSTdmhO5Y4z0Un4YGo1WB2X08PyKNc3_VU,16419
168
170
  regscale/integrations/commercial/import_all/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
169
- regscale/integrations/commercial/import_all/import_all_cmd.py,sha256=VtEDpWEXEhNkwkcsTafITCqCR3g5skdXNKvHr1-hlBY,18273
171
+ regscale/integrations/commercial/import_all/import_all_cmd.py,sha256=87OGCiOeMSAmEZEN4i8MhEK3qyOJUndk-d4i-Q-l_xc,18286
170
172
  regscale/integrations/commercial/import_all/scan_file_fingerprints.json,sha256=8c_hnfwbq9bEHr3f14hzcnA9vrehQ-_ZsAIZ4YTPB6w,1981
171
173
  regscale/integrations/commercial/mappings/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
172
174
  regscale/integrations/commercial/mappings/csf_controls.json,sha256=EHOLWrnFr0oRsHBx4LX6pLVoqLuX-Mn7O-CXuzpw-v4,57504
@@ -174,9 +176,9 @@ regscale/integrations/commercial/mappings/nist_800_53_r5_controls.json,sha256=Vu
174
176
  regscale/integrations/commercial/nessus/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
175
177
  regscale/integrations/commercial/nessus/nessus_utils.py,sha256=lP1_xVmYeyL17muy0jGMnJ5xdON3mi22BVAyDHa9WfU,13525
176
178
  regscale/integrations/commercial/nessus/scanner.py,sha256=xz-OBd98ZbKKWnuxsP7oTqTdqa30TQDQMMuPLm82hfU,17335
177
- regscale/integrations/commercial/opentext/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
178
- regscale/integrations/commercial/opentext/click.py,sha256=TzDQLNwr4LttcTGHw44MZr4HocROlgDp90pZ3v38Dx8,3148
179
- regscale/integrations/commercial/opentext/scanner.py,sha256=xRZF0DVR23SZr8BrgwsvMp_PQzHBZWVmOeN9maxizVc,5483
179
+ regscale/integrations/commercial/opentext/__init__.py,sha256=zqCPb_4rYRZZPXfeKn4AoZyyYyQ6MU4C0lCs2ysOBhc,251
180
+ regscale/integrations/commercial/opentext/commands.py,sha256=c5aAxFXp6vO0plGuX1eZe_90iDifYX3vCaqMd5jbunU,2142
181
+ regscale/integrations/commercial/opentext/scanner.py,sha256=gTUbvrJtFD8sp4YBcHeIrhL3EP5lCmixijVtRA0AyA0,21608
180
182
  regscale/integrations/commercial/sap/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
181
183
  regscale/integrations/commercial/sap/click.py,sha256=pWgjUOA_4WKkDUWcE8z4EshnJUdrTl15NKUfKpKyqzE,522
182
184
  regscale/integrations/commercial/sap/sysdig/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -208,6 +210,9 @@ regscale/integrations/commercial/tenablev2/scanner.py,sha256=hNFwKTqYys4GDjopXHq
208
210
  regscale/integrations/commercial/tenablev2/stig_parsers.py,sha256=01h5ImYMUsjrVHaGgqj5JVBx6Jzlhg06ufu0SL_uBEs,5983
209
211
  regscale/integrations/commercial/tenablev2/utils.py,sha256=3Mf_HNgFBL27HtsdVs3CqLhgDNl3_RSytS21lcQfKj0,2907
210
212
  regscale/integrations/commercial/tenablev2/variables.py,sha256=GWzzNmFkQ6i55RYK7DkVq3ibStaU3hSwapvxsqbNsxE,822
213
+ regscale/integrations/commercial/trivy/__init__.py,sha256=fTTABeR1Z3Wei3l-A54SoTPn2mrMQrKLmr9SwTyYLTM,117
214
+ regscale/integrations/commercial/trivy/commands.py,sha256=uzK-15k6ZNdOQ9TxAIF_3wj5rqiJ9UDRRlZVPnXhQvQ,2068
215
+ regscale/integrations/commercial/trivy/scanner.py,sha256=MzZvcwe5CpOFqkGImNd19kKySrbpGDwb_rC0jswkM10,10726
211
216
  regscale/integrations/commercial/wizv2/WizDataMixin.py,sha256=s7F_rVrP9IZa_x_vh3MswR7W_UBHRfd4kHGVsNX4ips,3606
212
217
  regscale/integrations/commercial/wizv2/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
213
218
  regscale/integrations/commercial/wizv2/click.py,sha256=wml9JygBSk2ptOvjVuewdS88ssUCGQpUCtiHzTz8hLU,13033
@@ -217,7 +222,7 @@ regscale/integrations/commercial/wizv2/models.py,sha256=hZ6557LJfcp1_NRbMM0V_G1e
217
222
  regscale/integrations/commercial/wizv2/parsers.py,sha256=YcFOGdYZZ17hj2pcRMC9Ho2wPY94dfJ4hHwqTR5BB6c,11095
218
223
  regscale/integrations/commercial/wizv2/sbom.py,sha256=QcGaYiBGtZ3mBcbo-KGl-I2u6QHKAIinTk26LPy0Kng,4466
219
224
  regscale/integrations/commercial/wizv2/scanner.py,sha256=3Vx2vCvwDlNAogYa3-qFgRDSVjUFtIIzBW4PFSYpe5k,18419
220
- regscale/integrations/commercial/wizv2/utils.py,sha256=9OcR37JjN6wSf2q2s16fHfEz8Tu7JzLqoYEmqiZ9OmY,31319
225
+ regscale/integrations/commercial/wizv2/utils.py,sha256=VuAus03sSK_IZaZQnVvEkxDRg4MrvhT2UOoOawb4NQg,31326
221
226
  regscale/integrations/commercial/wizv2/variables.py,sha256=BRtYjMNPqZDLgql-bbBJ0dlVx0KkR647aXKc0HGdWVo,2132
222
227
  regscale/integrations/commercial/wizv2/wiz_auth.py,sha256=BpQTYJn3u0QiWC2IAw-bunZpBPsJtDJgOsC2zOL_UU4,5554
223
228
  regscale/integrations/integration/__init__.py,sha256=WJgPLnEahD94QLE8NR8QCzlf8xk2ix76_WPDlf98ezU,70
@@ -238,13 +243,13 @@ regscale/integrations/public/fedramp/click.py,sha256=cIMo5ZGXoSDyKvI9kLUFuLT0zfA
238
243
  regscale/integrations/public/fedramp/components.py,sha256=z6PMObm-kjRR42bT04EfnjisrEULfXlwxb7576uuMmY,27010
239
244
  regscale/integrations/public/fedramp/docx_parser.py,sha256=EA9g1iTlB6-GtOzV9JwGW8x_SruhbaIMOzstCBvjiq8,10526
240
245
  regscale/integrations/public/fedramp/fedramp_cis_crm.py,sha256=RKZdwX12RAGsTWd0xndHxaj5iABiKrULoee7L399E9c,44294
241
- regscale/integrations/public/fedramp/fedramp_common.py,sha256=xbWmnTq1UB77KgJxYiscW0g6EN_bKtuGZCJ2zueMbSI,115408
246
+ regscale/integrations/public/fedramp/fedramp_common.py,sha256=Mdy3_WdCEcTwSXEEKXiODmr2YJTWcTg6jfyWZJWfruQ,115406
242
247
  regscale/integrations/public/fedramp/fedramp_docx.py,sha256=GnRjuWEgE9XSe9egPOQSZ8lMjY4CpqcD2IS5paI-xQc,13742
243
248
  regscale/integrations/public/fedramp/fedramp_five.py,sha256=-dogAC3J7BNW5Yl6Aw5XHJbjW3PxFi_HjGQCfxfcWns,90771
244
249
  regscale/integrations/public/fedramp/fedramp_traversal.py,sha256=BkgwsFluZO5g0Rc0WujYgbc1_YLofamJzFP7Z5UYfao,4528
245
250
  regscale/integrations/public/fedramp/import_fedramp_r4_ssp.py,sha256=Opld0vEZ4b71cIDogu6ykTUL86tXZVTSnwQzjz8w_4U,9925
246
251
  regscale/integrations/public/fedramp/import_workbook.py,sha256=VFNBjBNLLRL3WjkJmE9CamizNsLgfdX5g8YolOr8lPY,19658
247
- regscale/integrations/public/fedramp/inventory_items.py,sha256=gRKmXbubSxMiulis7z43Na9dI05FBgb_RkgwByxC5Wk,10076
252
+ regscale/integrations/public/fedramp/inventory_items.py,sha256=nBgVgigMyZ2C6fJ9QCvz-8KvSlGtqi1lqC3alBUlzyg,10080
248
253
  regscale/integrations/public/fedramp/markdown_parser.py,sha256=I2VI8NImOnHfB1eE3iLG_gK6uqqqImL7I_YEkzh6INE,5339
249
254
  regscale/integrations/public/fedramp/metadata.py,sha256=eh8AA5YNHUxHGnlbLRmhovINBKqkAJR98EUFDX1g5Z0,26543
250
255
  regscale/integrations/public/fedramp/parts_mapper.py,sha256=aBh1gWo-3-JFDDxHQaxrvqC7OFTxS6qWEFfoHlknomc,3787
@@ -290,11 +295,10 @@ regscale/models/integration_models/azure_alerts.py,sha256=2etrpvcxa7jVQrc98bJlVG
290
295
  regscale/models/integration_models/base64.py,sha256=sxV6O5qY1_TstJENX5jBPsSdQwmA83-NNhgJFunXiZE,570
291
296
  regscale/models/integration_models/burp.py,sha256=hPQkmmUdC84MBFTE2Di5NvjbGz1ssISSkZdDaVi-ZoQ,16941
292
297
  regscale/models/integration_models/burp_models.py,sha256=UytDTAcCaxyu-knFkm_mEUH6UmWK3OTXKSC9Sc6OjVs,3669
293
- regscale/models/integration_models/cisa_kev_data.json,sha256=4iYtmPwAWXewjNWTepWV6jzPGz5NpzATB0i1XdGMCx8,1146270
298
+ regscale/models/integration_models/cisa_kev_data.json,sha256=sGmp3Hsznxw7hLBrlem6241wdTiyQV3mFec1pjUJLcc,1147593
294
299
  regscale/models/integration_models/defender_data.py,sha256=jsAcjKxiGmumGerj7xSWkFd6r__YpuKDnYX5o7xHDiE,2844
295
300
  regscale/models/integration_models/defenderimport.py,sha256=OFwEH0Xu-HFLIZJZ8hP60Ov3lS8RR7KHEsw4wI8QnoE,5766
296
301
  regscale/models/integration_models/drf.py,sha256=Aq7AdLa_CH97NrnR-CxaFI22JjVN9uCxVN7Z-BBUaNU,18896
297
- regscale/models/integration_models/flat_file_importer.py,sha256=pA7hnME_-qJX6aR8yVXijpaDeXXhj9SLXqrL3FHxFvg,43288
298
302
  regscale/models/integration_models/grype_import.py,sha256=MgCEK_jCwY7NTXZgxQtnXLbovmH7OuSOmSOm-a7egZg,9710
299
303
  regscale/models/integration_models/ibm.py,sha256=S2LZkHhxfRBTAS8T2mwiQ_pCfoX1-UwvFXRNz1rb7g0,4760
300
304
  regscale/models/integration_models/implementation_results.py,sha256=nJOAFPMS73SudAA2dzxxxRu6h5qagPmr6H9NAOLWzLw,2704
@@ -313,10 +317,11 @@ regscale/models/integration_models/amazon_models/inspector_scan.py,sha256=A1uaOv
313
317
  regscale/models/integration_models/ecr_models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
314
318
  regscale/models/integration_models/ecr_models/data.py,sha256=l28DCidXar1JygYBQZL9MYenQA9N-Cx3Skf51IOjZcw,1017
315
319
  regscale/models/integration_models/ecr_models/ecr.py,sha256=-s_5mj4BVKImrvfMaOJLT4qc5EqTCbv8qM4uJiH_nKc,9502
320
+ regscale/models/integration_models/flat_file_importer/__init__.py,sha256=pA7hnME_-qJX6aR8yVXijpaDeXXhj9SLXqrL3FHxFvg,43288
316
321
  regscale/models/integration_models/sbom/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
317
322
  regscale/models/integration_models/sbom/cyclone_dx.py,sha256=0pFR0BWBrF5c8_cC_8mj2MXvNOMHOdHbBYXvTVfFAh8,4058
318
323
  regscale/models/integration_models/synqly_models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
319
- regscale/models/integration_models/synqly_models/capabilities.json,sha256=ZOQ04SSYjGTxX70rlkmQ8Wa3UoiGqFLNc8nzfL-ZnNw,213807
324
+ regscale/models/integration_models/synqly_models/capabilities.json,sha256=28tfla4QiZOBj64e99krCv9gxFN8RdFpDeipoinTTQc,217847
320
325
  regscale/models/integration_models/synqly_models/connector_types.py,sha256=8nxptkTexpskySnmL0obNAff_iu_fx6tJ7i1-4hJvao,461
321
326
  regscale/models/integration_models/synqly_models/ocsf_mapper.py,sha256=vrtto3-VxbEtK5JSHNluypLm8yvmT_IDupyiJIeFedY,14535
322
327
  regscale/models/integration_models/synqly_models/param.py,sha256=45zgYUV4U9Ia8-CdIb4TlE3vfDMMtbfA1y5LOiznnH8,2645
@@ -327,7 +332,7 @@ regscale/models/integration_models/synqly_models/connectors/assets.py,sha256=HHN
327
332
  regscale/models/integration_models/synqly_models/connectors/ticketing.py,sha256=yRBuCkRAVfa_C91r3WqJ9gxrQsoD0qV9cY48YXpJl70,25358
328
333
  regscale/models/integration_models/synqly_models/connectors/vulnerabilities.py,sha256=kwKvmEIsxkLDOYoDOiqdtyapBZ5fHYQcrQjDpFJQvWc,7143
329
334
  regscale/models/integration_models/tenable_models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
330
- regscale/models/integration_models/tenable_models/integration.py,sha256=zUtNSboqD6Mnr6rQg9C6bSjOF4X9wvCbxGlG8Y_QoGQ,7853
335
+ regscale/models/integration_models/tenable_models/integration.py,sha256=4Lhp2SY6Hb6uPmeQcITra20Mw-yKE1fm0CKwPZwJ9PM,9672
331
336
  regscale/models/integration_models/tenable_models/models.py,sha256=dmG7btkN4YkDWwnfW5Ldc3tWEAGjPiaRgJjrqMOkPEU,15846
332
337
  regscale/models/regscale_models/__init__.py,sha256=OmFpksQ7e1P52xkBfP5_CTew1A4JiB65cvNuwchGXWU,1900
333
338
  regscale/models/regscale_models/assessment.py,sha256=ekzNlcsfDGBu97PMCi7hBRGbzVgxk7Ij0RfrdGh1Rfw,20440
@@ -389,7 +394,7 @@ regscale/models/regscale_models/questionnaire.py,sha256=yWNeKLx2pc9gyc1SCwcjXfWK
389
394
  regscale/models/regscale_models/questionnaire_instance.py,sha256=Hfa27stfcK1_vjtqj8t-5s3LdxZUlLjKLRm4P5qEHKU,7071
390
395
  regscale/models/regscale_models/rbac.py,sha256=4byeEmr0TxtSyKx7efCX_HGphBzf6s2EFZ1xfTAttPk,4523
391
396
  regscale/models/regscale_models/reference.py,sha256=P_7jT6H-NZIa7TyH3j98N-ZHlB6FsjpZVRZCCpms-D4,3253
392
- regscale/models/regscale_models/regscale_model.py,sha256=6fkF_HKcsGHhX_XGwUV1VQpI9eN9ahMZhk5YlHIQTBA,66490
397
+ regscale/models/regscale_models/regscale_model.py,sha256=GTQVoQHWK9ZniqQkOJYJyj_B60aPBQfkA_CUQ6-EhAM,66491
393
398
  regscale/models/regscale_models/requirement.py,sha256=-8PnMbuWAZHol5X1w-fzm-moD784Et0oevSVbz6xLhU,767
394
399
  regscale/models/regscale_models/risk.py,sha256=QPwX8-4ERLYkJdrQYLQWTsNYCYgWn5wKY28djv6L-_s,8493
395
400
  regscale/models/regscale_models/sbom.py,sha256=UYS3lBizGqz7A7vNPYBYzpL8PWIaXLl7ZQox_hlJ2ZQ,1722
@@ -409,7 +414,7 @@ regscale/models/regscale_models/task.py,sha256=eKVdR89Gb6M9E2plhK4fru8teQI3zPJpg
409
414
  regscale/models/regscale_models/threat.py,sha256=4TNZcRnTgmlDwBsYu5Pbh9GRd8ZWAtqqr0Xph3uPNAA,7255
410
415
  regscale/models/regscale_models/user.py,sha256=o-1Ghx0pm2DYLCDyOryJmDrMlTCyrsN0opr89rQ09vA,6560
411
416
  regscale/models/regscale_models/user_group.py,sha256=6j-lkhu21zNukof804Dsk7eHPtEwD7779yInWm6lHTs,1860
412
- regscale/models/regscale_models/vulnerability.py,sha256=Wq7YVnReysjLyDy2IAfYOo6EMr6u4DtyE_9gs8SfUdc,10032
417
+ regscale/models/regscale_models/vulnerability.py,sha256=VKgWMVvAQ74Sq46myYsivGfIeW63dHq3bv3cRCkDcbg,10960
413
418
  regscale/models/regscale_models/vulnerability_mapping.py,sha256=cq44xkkCH7rfp0BJxavr4DLiEAHouyyPmi5EaizH6NI,6261
414
419
  regscale/models/regscale_models/workflow.py,sha256=uMNVVAn5qR8wxjMP5PHbcvMmvPRe1gn1oclVUpbv52s,1873
415
420
  regscale/models/regscale_models/workflow_action.py,sha256=zMHrvUkTQJlkCj6Xx6wadozBwsVPpObj5GD81LI2VZc,925
@@ -474,9 +479,9 @@ tests/regscale/models/test_regscale_model.py,sha256=ZsrEZkC4EtdIsoQuayn1xv2gEGcV
474
479
  tests/regscale/models/test_report.py,sha256=eiSvS_zS0aVeL0HBvtmHVvEzcfF9ZFVn2twj5g8KttY,970
475
480
  tests/regscale/models/test_tenable_integrations.py,sha256=PNJC2Zu6lv1xj7y6e1yOsz5FktSU3PRKb5x3n5YG3w0,4072
476
481
  tests/regscale/models/test_user_model.py,sha256=e9olv28qBApgnvK6hFHOgXjUC-pkaV8aGDirEIWASL4,4427
477
- regscale_cli-6.16.1.0.dist-info/LICENSE,sha256=ytNhYQ9Rmhj_m-EX2pPq9Ld6tH5wrqqDYg-fCf46WDU,1076
478
- regscale_cli-6.16.1.0.dist-info/METADATA,sha256=bkisrnIFwNUjOOJbjepMzzWch2CaWcDc6Ymyxl52nb8,30910
479
- regscale_cli-6.16.1.0.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
480
- regscale_cli-6.16.1.0.dist-info/entry_points.txt,sha256=cLOaIP1eRv1yZ2u7BvpE3aB4x3kDrDwkpeisKOu33z8,269
481
- regscale_cli-6.16.1.0.dist-info/top_level.txt,sha256=Uv8VUCAdxRm70bgrD4YNEJUmDhBThad_1aaEFGwRByc,15
482
- regscale_cli-6.16.1.0.dist-info/RECORD,,
482
+ regscale_cli-6.16.2.0.dist-info/LICENSE,sha256=ytNhYQ9Rmhj_m-EX2pPq9Ld6tH5wrqqDYg-fCf46WDU,1076
483
+ regscale_cli-6.16.2.0.dist-info/METADATA,sha256=AzR8rsJ0selaUTdj2JdFYuQXpO_bHipH6P-SKeRUin0,30913
484
+ regscale_cli-6.16.2.0.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
485
+ regscale_cli-6.16.2.0.dist-info/entry_points.txt,sha256=cLOaIP1eRv1yZ2u7BvpE3aB4x3kDrDwkpeisKOu33z8,269
486
+ regscale_cli-6.16.2.0.dist-info/top_level.txt,sha256=Uv8VUCAdxRm70bgrD4YNEJUmDhBThad_1aaEFGwRByc,15
487
+ regscale_cli-6.16.2.0.dist-info/RECORD,,
@@ -1,165 +0,0 @@
1
- """
2
- Module for processing Grype scan results and loading them into RegScale.
3
- """
4
-
5
- import logging
6
- import traceback
7
- from datetime import datetime
8
- from typing import List, Optional, Union
9
-
10
- import click
11
- from pathlib import Path
12
-
13
- from regscale.core.app.utils.file_utils import (
14
- download_from_s3,
15
- find_files,
16
- iterate_files,
17
- move_file,
18
- )
19
- from regscale.models.integration_models.flat_file_importer import FlatFileImporter
20
- from regscale.models.integration_models.grype_import import GrypeImport
21
-
22
- logger = logging.getLogger(__name__)
23
-
24
-
25
- class GrypeProcessingError(Exception):
26
- """Custom exception for Grype processing errors."""
27
-
28
- pass
29
-
30
-
31
- @click.group()
32
- def grype():
33
- """Performs actions from the Grype scanner integration."""
34
- pass
35
-
36
-
37
- @grype.command("import_scans")
38
- @FlatFileImporter.common_scanner_options(
39
- message="File path to the folder containing Grype .json files to process to RegScale.",
40
- prompt="File path for Grype files",
41
- import_name="grype",
42
- )
43
- @click.option("--destination", "-d", type=click.Path(exists=True, dir_okay=True), required=False)
44
- @click.option("--file_pattern", "-p", type=str, required=False, default="grype*.json")
45
- def import_scans(
46
- destination: Optional[Path],
47
- file_pattern: str,
48
- folder_path: Path,
49
- regscale_ssp_id: int,
50
- scan_date: datetime,
51
- mappings_path: Path,
52
- disable_mapping: bool,
53
- s3_bucket: str,
54
- s3_prefix: str,
55
- aws_profile: str,
56
- upload_file: bool,
57
- ) -> None:
58
- """
59
- Process Grype scan results from a folder containing Grype scan files and load into RegScale.
60
- """
61
- import_grype_scans(
62
- destination=destination,
63
- file_pattern=file_pattern,
64
- folder_path=folder_path,
65
- regscale_ssp_id=regscale_ssp_id,
66
- scan_date=scan_date,
67
- mappings_path=mappings_path,
68
- disable_mapping=disable_mapping,
69
- s3_bucket=s3_bucket,
70
- s3_prefix=s3_prefix,
71
- aws_profile=aws_profile,
72
- upload_file=upload_file,
73
- )
74
-
75
-
76
- def import_grype_scans(
77
- folder_path: Path,
78
- regscale_ssp_id: int,
79
- scan_date: datetime,
80
- mappings_path: Optional[Path] = None,
81
- disable_mapping: Optional[bool] = False,
82
- s3_bucket: Optional[str] = None,
83
- s3_prefix: Optional[str] = None,
84
- aws_profile: Optional[str] = None,
85
- destination: Optional[Path] = None,
86
- file_pattern: Optional[str] = "grype*.json",
87
- upload_file: Optional[bool] = True,
88
- ) -> None:
89
- """
90
- Process Grype scan results from a folder container grype scan files and load into RegScale.
91
-
92
- :param Path folder_path: Path to the Grype scan results JSON file
93
- :param int regscale_ssp_id: RegScale SSP ID
94
- :param datetime scan_date: The date of the scan
95
- :param Optional[Path] mappings_path: Path to the header mapping file, default: None
96
- :param Optional[bool] disable_mapping: Disable the header mapping, default: False
97
- :param Optional[str] s3_bucket: S3 bucket to download scan files from, default: None
98
- :param Optional[str] s3_prefix: Prefix (folder path) within the S3 bucket, default: None
99
- :param Optional[str] aws_profile: AWS profile to use for S3 access, default: None
100
- :param Optional[Path] destination: Destination folder for processed files, default: None
101
- :param Optional[str] file_pattern: File pattern to search for in the directory, default: grype*.json
102
- :param Optional[bool] upload_file: Whether to upload the file to RegScale after processing, default: True
103
- :raises GrypeProcessingError: If there is an error processing the Grype results
104
- :rtype: None
105
- """
106
- from regscale.exceptions import ValidationException
107
- from regscale.core.app.application import Application
108
-
109
- try:
110
- if s3_bucket and s3_prefix and aws_profile:
111
- download_from_s3(bucket=s3_bucket, prefix=s3_prefix, local_path=destination, aws_profile=aws_profile)
112
- files = find_files(path=destination, pattern=file_pattern)
113
- logger.info("Downloaded all Grype scan files from S3. Processing...")
114
- elif destination and not s3_bucket:
115
- logger.info("Moving Grype scan files to %s", destination)
116
- stored_file_collection = find_files(path=folder_path, pattern=file_pattern)
117
- move_all_files(stored_file_collection, destination)
118
- files = find_files(path=destination, pattern=file_pattern)
119
- logger.info("Done moving files")
120
- else:
121
- stored_file_collection = find_files(path=folder_path, pattern=file_pattern)
122
- files = stored_file_collection
123
- if not files:
124
- logger.error("No Grype scan results found in the specified directory")
125
- return
126
-
127
- except Exception as e:
128
- logger.error(f"Error processing Grype results: {str(e)}")
129
- logger.error(traceback.format_exc())
130
- raise GrypeProcessingError(f"Failed to process Grype results: {str(e)}")
131
-
132
- for file in files:
133
- try:
134
- GrypeImport(
135
- name="Grype",
136
- app=Application(),
137
- file_path=str(file),
138
- file_type=file.suffix,
139
- parent_id=regscale_ssp_id,
140
- parent_module="securityplans",
141
- scan_date=scan_date,
142
- mappings_path=mappings_path,
143
- disable_mapping=disable_mapping,
144
- upload_file=upload_file,
145
- file_name=file.name,
146
- )
147
- except ValidationException as e:
148
- logger.error(f"Validation error on {file}: {e}")
149
- continue
150
- logger.info("Completed Grype processing.")
151
-
152
-
153
- def move_all_files(file_collection: List[Union[Path, str]], destination: Union[Path, str]) -> None:
154
- """
155
- Move all Grype files in the current directory to a folder called 'processed'.
156
-
157
- :param List[Union[Path, str]] file_collection: A list of file paths or S3 URIs
158
- :param Union[Path, str] destination: The destination folder
159
- :rtype: None
160
- """
161
- for file in iterate_files(file_collection):
162
- file_path = Path(file)
163
- new_filename = f"{file_path.stem}{file_path.suffix}"
164
- new_file_path = Path(destination) / new_filename
165
- move_file(file, new_file_path)
@@ -1,99 +0,0 @@
1
- """
2
- This module contains the Click commands for the opentext integration.
3
- """
4
-
5
- # pylint: disable=W0621
6
-
7
- from datetime import datetime
8
- from os import PathLike
9
- from typing import Optional
10
-
11
- import click
12
- from pathlib import Path
13
-
14
- from regscale.integrations.commercial.opentext.scanner import WebInspect
15
- from regscale.models.integration_models.flat_file_importer import FlatFileImporter
16
-
17
-
18
- @click.group()
19
- def fortify():
20
- """Performs actions on the OpenText Fortify"""
21
-
22
-
23
- @fortify.group(name="web_inspect")
24
- def web_inspect():
25
- """Performs actions on the OpenText Web Inspect files."""
26
-
27
-
28
- @web_inspect.command(name="import_file")
29
- @FlatFileImporter.common_scanner_options(
30
- message="File path to the folder containing Fortify WebInspect .xml files to process to RegScale.",
31
- prompt="File path for Web Inspect files",
32
- import_name="web_inspect",
33
- )
34
- def import_file(
35
- folder_path: PathLike[str],
36
- regscale_ssp_id: int,
37
- scan_date: datetime,
38
- mappings_path: Path,
39
- disable_mapping: bool,
40
- s3_bucket: str,
41
- s3_prefix: str,
42
- aws_profile: str,
43
- upload_file: bool,
44
- ):
45
- """
46
- Import and process a folder of Fortify WebInspect XML file(s).
47
- """
48
- import_opentext_file(
49
- folder_path=folder_path,
50
- regscale_ssp_id=regscale_ssp_id,
51
- scan_date=scan_date,
52
- mappings_path=mappings_path,
53
- disable_mapping=disable_mapping,
54
- s3_bucket=s3_bucket,
55
- s3_prefix=s3_prefix,
56
- aws_profile=aws_profile,
57
- upload_file=upload_file,
58
- )
59
-
60
-
61
- def import_opentext_file(
62
- folder_path: PathLike[str],
63
- regscale_ssp_id: int,
64
- scan_date: datetime,
65
- mappings_path: Optional[Path] = None,
66
- disable_mapping: Optional[bool] = False,
67
- s3_bucket: Optional[str] = None,
68
- s3_prefix: Optional[str] = None,
69
- aws_profile: Optional[str] = None,
70
- upload_file: Optional[bool] = True,
71
- ) -> None:
72
- """
73
- Import and process a folder of Fortify WebInspect XML file(s).
74
-
75
- :param click.Path folder_path: The Path to a folder of XML file(s) to import
76
- :param int regscale_ssp_id: RegScale SSP ID
77
- :param datetime scan_date: The date of the scan
78
- :param Optional[Path] mappings_path: Path to the header mapping file, default: None
79
- :param Optional[bool] disable_mapping: Disable the header mapping, default: False
80
- :param Optional[str] s3_bucket: S3 bucket to download scan files from, default: None
81
- :param Optional[str] s3_prefix: Prefix (folder path) within the S3 bucket, default: None
82
- :param Optional[str] aws_profile: AWS profile to use for S3 access, default: None
83
- :param Optional[bool] upload_file: Whether to upload the file to RegScale after processing, default: True
84
- :return: None
85
- """
86
- FlatFileImporter.import_files(
87
- import_type=WebInspect,
88
- import_name="Web Inspect",
89
- file_types=".xml",
90
- folder_path=folder_path,
91
- regscale_ssp_id=regscale_ssp_id,
92
- scan_date=scan_date,
93
- mappings_path=mappings_path,
94
- disable_mapping=disable_mapping,
95
- s3_bucket=s3_bucket,
96
- s3_prefix=s3_prefix,
97
- aws_profile=aws_profile,
98
- upload_file=upload_file,
99
- )