regscale-cli 6.20.1.0__py3-none-any.whl → 6.20.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 (42) hide show
  1. regscale/__init__.py +1 -1
  2. regscale/core/app/utils/variables.py +5 -3
  3. regscale/integrations/commercial/__init__.py +2 -0
  4. regscale/integrations/commercial/burp.py +14 -0
  5. regscale/integrations/commercial/grype/commands.py +8 -1
  6. regscale/integrations/commercial/grype/scanner.py +2 -1
  7. regscale/integrations/commercial/jira.py +290 -133
  8. regscale/integrations/commercial/opentext/commands.py +14 -5
  9. regscale/integrations/commercial/opentext/scanner.py +3 -2
  10. regscale/integrations/commercial/qualys/__init__.py +3 -3
  11. regscale/integrations/commercial/stigv2/click_commands.py +6 -37
  12. regscale/integrations/commercial/synqly/edr.py +8 -2
  13. regscale/integrations/commercial/synqly/ticketing.py +25 -0
  14. regscale/integrations/commercial/tenablev2/commands.py +12 -4
  15. regscale/integrations/commercial/tenablev2/sc_scanner.py +21 -1
  16. regscale/integrations/commercial/tenablev2/sync_compliance.py +3 -0
  17. regscale/integrations/commercial/trivy/commands.py +11 -4
  18. regscale/integrations/commercial/trivy/scanner.py +2 -1
  19. regscale/integrations/jsonl_scanner_integration.py +8 -1
  20. regscale/integrations/public/cisa.py +58 -63
  21. regscale/integrations/public/fedramp/fedramp_cis_crm.py +88 -93
  22. regscale/integrations/scanner_integration.py +22 -6
  23. regscale/models/app_models/click.py +49 -1
  24. regscale/models/integration_models/burp.py +11 -8
  25. regscale/models/integration_models/cisa_kev_data.json +146 -25
  26. regscale/models/integration_models/flat_file_importer/__init__.py +36 -176
  27. regscale/models/integration_models/jira_task_sync.py +27 -0
  28. regscale/models/integration_models/qualys.py +6 -7
  29. regscale/models/integration_models/synqly_models/capabilities.json +1 -1
  30. regscale/models/regscale_models/control_implementation.py +39 -2
  31. regscale/models/regscale_models/regscale_model.py +49 -1
  32. regscale/models/regscale_models/supply_chain.py +1 -1
  33. regscale/models/regscale_models/task.py +1 -0
  34. regscale/regscale.py +1 -4
  35. regscale/utils/string.py +13 -0
  36. {regscale_cli-6.20.1.0.dist-info → regscale_cli-6.20.2.0.dist-info}/METADATA +1 -1
  37. {regscale_cli-6.20.1.0.dist-info → regscale_cli-6.20.2.0.dist-info}/RECORD +41 -41
  38. regscale/integrations/commercial/synqly_jira.py +0 -840
  39. {regscale_cli-6.20.1.0.dist-info → regscale_cli-6.20.2.0.dist-info}/LICENSE +0 -0
  40. {regscale_cli-6.20.1.0.dist-info → regscale_cli-6.20.2.0.dist-info}/WHEEL +0 -0
  41. {regscale_cli-6.20.1.0.dist-info → regscale_cli-6.20.2.0.dist-info}/entry_points.txt +0 -0
  42. {regscale_cli-6.20.1.0.dist-info → regscale_cli-6.20.2.0.dist-info}/top_level.txt +0 -0
@@ -1,9 +1,145 @@
1
1
  {
2
2
  "title": "CISA Catalog of Known Exploited Vulnerabilities",
3
- "catalogVersion": "2025.05.27",
4
- "dateReleased": "2025-05-27T16:31:36.689Z",
5
- "count": 1352,
3
+ "catalogVersion": "2025.06.05",
4
+ "dateReleased": "2025-06-05T18:02:07.1325Z",
5
+ "count": 1360,
6
6
  "vulnerabilities": [
7
+ {
8
+ "cveID": "CVE-2025-5419",
9
+ "vendorProject": "Google",
10
+ "product": "Chromium V8",
11
+ "vulnerabilityName": "Google Chromium V8 Out-of-Bounds Read and Write Vulnerability",
12
+ "dateAdded": "2025-06-05",
13
+ "shortDescription": "Google Chromium V8 contains an out-of-bounds read and write vulnerability that could allow a remote attacker to potentially exploit heap corruption via a crafted HTML page. This vulnerability could affect multiple web browsers that utilize Chromium, including, but not limited to, Google Chrome, Microsoft Edge, and Opera.",
14
+ "requiredAction": "Apply mitigations per vendor instructions, follow applicable BOD 22-01 guidance for cloud services, or discontinue use of the product if mitigations are unavailable.",
15
+ "dueDate": "2025-06-26",
16
+ "knownRansomwareCampaignUse": "Unknown",
17
+ "notes": "https:\/\/chromereleases.googleblog.com\/2025\/06\/stable-channel-update-for-desktop.html; https:\/\/nvd.nist.gov\/vuln\/detail\/CVE-2025-5419\",",
18
+ "cwes": [
19
+ "CWE-125",
20
+ "CWE-787"
21
+ ]
22
+ },
23
+ {
24
+ "cveID": "CVE-2025-21479",
25
+ "vendorProject": "Qualcomm",
26
+ "product": "Multiple Chipsets",
27
+ "vulnerabilityName": "Qualcomm Multiple Chipsets Incorrect Authorization Vulnerability",
28
+ "dateAdded": "2025-06-03",
29
+ "shortDescription": "Multiple Qualcomm chipsets contain an incorrect authorization vulnerability. This vulnerability allows for memory corruption due to unauthorized command execution in GPU micronode while executing specific sequence of commands.",
30
+ "requiredAction": "Apply mitigations per vendor instructions, follow applicable BOD 22-01 guidance for cloud services, or discontinue use of the product if mitigations are unavailable.",
31
+ "dueDate": "2025-06-24",
32
+ "knownRansomwareCampaignUse": "Unknown",
33
+ "notes": "Please check with specific vendors (OEMs,) for information on patching status. For more information, please see: https:\/\/docs.qualcomm.com\/product\/publicresources\/securitybulletin\/june-2025-bulletin.html ; https:\/\/nvd.nist.gov\/vuln\/detail\/CVE-2025-21479",
34
+ "cwes": [
35
+ "CWE-863"
36
+ ]
37
+ },
38
+ {
39
+ "cveID": "CVE-2025-21480",
40
+ "vendorProject": "Qualcomm",
41
+ "product": "Multiple Chipsets",
42
+ "vulnerabilityName": "Qualcomm Multiple Chipsets Incorrect Authorization Vulnerability",
43
+ "dateAdded": "2025-06-03",
44
+ "shortDescription": "Multiple Qualcomm chipsets contain an incorrect authorization vulnerability. This vulnerability allows for memory corruption due to unauthorized command execution in GPU micronode while executing specific sequence of commands.",
45
+ "requiredAction": "Apply mitigations per vendor instructions, follow applicable BOD 22-01 guidance for cloud services, or discontinue use of the product if mitigations are unavailable.",
46
+ "dueDate": "2025-06-24",
47
+ "knownRansomwareCampaignUse": "Unknown",
48
+ "notes": "Please check with specific vendors (OEMs,) for information on patching status. For more information, please see: https:\/\/docs.qualcomm.com\/product\/publicresources\/securitybulletin\/june-2025-bulletin.html ; https:\/\/nvd.nist.gov\/vuln\/detail\/CVE-2025-21480",
49
+ "cwes": [
50
+ "CWE-863"
51
+ ]
52
+ },
53
+ {
54
+ "cveID": "CVE-2025-27038",
55
+ "vendorProject": "Qualcomm",
56
+ "product": "Multiple Chipsets",
57
+ "vulnerabilityName": "Qualcomm Multiple Chipsets Use-After-Free Vulnerability",
58
+ "dateAdded": "2025-06-03",
59
+ "shortDescription": "Multiple Qualcomm chipsets contain a use-after-free vulnerability. This vulnerability allows for memory corruption while rendering graphics using Adreno GPU drivers in Chrome.",
60
+ "requiredAction": "Apply mitigations per vendor instructions, follow applicable BOD 22-01 guidance for cloud services, or discontinue use of the product if mitigations are unavailable.",
61
+ "dueDate": "2025-06-24",
62
+ "knownRansomwareCampaignUse": "Unknown",
63
+ "notes": "Please check with specific vendors (OEMs,) for information on patching status. For more information, please see: https:\/\/docs.qualcomm.com\/product\/publicresources\/securitybulletin\/june-2025-bulletin.html ; https:\/\/nvd.nist.gov\/vuln\/detail\/CVE-2025-27038",
64
+ "cwes": [
65
+ "CWE-416"
66
+ ]
67
+ },
68
+ {
69
+ "cveID": "CVE-2021-32030",
70
+ "vendorProject": "ASUS",
71
+ "product": "Routers",
72
+ "vulnerabilityName": "ASUS Routers Improper Authentication Vulnerability",
73
+ "dateAdded": "2025-06-02",
74
+ "shortDescription": "ASUS Lyra Mini and ASUS GT-AC2900 devices contain an improper authentication vulnerability that allows an attacker to gain unauthorized access to the administrative interface. The impacted products could be end-of-life (EoL) and\/or end-of-service (EoS). Users should discontinue product utilization.",
75
+ "requiredAction": "Apply mitigations per vendor instructions, follow applicable BOD 22-01 guidance for cloud services, or discontinue use of the product if mitigations are unavailable.",
76
+ "dueDate": "2025-06-23",
77
+ "knownRansomwareCampaignUse": "Unknown",
78
+ "notes": "https:\/\/www.asus.com\/us\/supportonly\/lyra%20mini\/helpdesk_bios\/ ; https:\/\/www.asus.com\/us\/supportonly\/rog%20rapture%20gt-ac2900\/helpdesk_bios\/; https:\/\/nvd.nist.gov\/vuln\/detail\/CVE-2021-32030",
79
+ "cwes": [
80
+ "CWE-287"
81
+ ]
82
+ },
83
+ {
84
+ "cveID": "CVE-2025-3935",
85
+ "vendorProject": "ConnectWise",
86
+ "product": "ScreenConnect",
87
+ "vulnerabilityName": "ConnectWise ScreenConnect Improper Authentication Vulnerability",
88
+ "dateAdded": "2025-06-02",
89
+ "shortDescription": "ConnectWise ScreenConnect contains an improper authentication vulnerability. This vulnerability could allow a ViewState code injection attack, which could allow remote code execution if machine keys are compromised.",
90
+ "requiredAction": "Apply mitigations per vendor instructions, follow applicable BOD 22-01 guidance for cloud services, or discontinue use of the product if mitigations are unavailable.",
91
+ "dueDate": "2025-06-23",
92
+ "knownRansomwareCampaignUse": "Unknown",
93
+ "notes": "https:\/\/www.connectwise.com\/company\/trust\/security-bulletins\/screenconnect-security-patch-2025.4 ; https:\/\/nvd.nist.gov\/vuln\/detail\/CVE-2025-3935",
94
+ "cwes": [
95
+ "CWE-287"
96
+ ]
97
+ },
98
+ {
99
+ "cveID": "CVE-2025-35939",
100
+ "vendorProject": "Craft CMS",
101
+ "product": "Craft CMS",
102
+ "vulnerabilityName": "Craft CMS External Control of Assumed-Immutable Web Parameter Vulnerability",
103
+ "dateAdded": "2025-06-02",
104
+ "shortDescription": "Craft CMS contains an external control of assumed-immutable web parameter vulnerability. This vulnerability could allow an unauthenticated client to introduce arbitrary values, such as PHP code, to a known local file location on the server. This vulnerability could be chained with CVE-2024-58136 as represented by CVE-2025-32432.",
105
+ "requiredAction": "Apply mitigations per vendor instructions, follow applicable BOD 22-01 guidance for cloud services, or discontinue use of the product if mitigations are unavailable.",
106
+ "dueDate": "2025-06-23",
107
+ "knownRansomwareCampaignUse": "Unknown",
108
+ "notes": "https:\/\/github.com\/craftcms\/cms\/pull\/17220 ; https:\/\/nvd.nist.gov\/vuln\/detail\/CVE-2025-35939",
109
+ "cwes": [
110
+ "CWE-472"
111
+ ]
112
+ },
113
+ {
114
+ "cveID": "CVE-2024-56145",
115
+ "vendorProject": "Craft CMS",
116
+ "product": "Craft CMS",
117
+ "vulnerabilityName": "Craft CMS Code Injection Vulnerability",
118
+ "dateAdded": "2025-06-02",
119
+ "shortDescription": "Craft CMS contains a code injection vulnerability. Users with affected versions are vulnerable to remote code execution if their php.ini configuration has `register_argc_argv` enabled.",
120
+ "requiredAction": "Apply mitigations per vendor instructions, follow applicable BOD 22-01 guidance for cloud services, or discontinue use of the product if mitigations are unavailable.",
121
+ "dueDate": "2025-06-23",
122
+ "knownRansomwareCampaignUse": "Unknown",
123
+ "notes": "https:\/\/github.com\/craftcms\/cms\/security\/advisories\/GHSA-2p6p-9rc9-62j9 ; https:\/\/nvd.nist.gov\/vuln\/detail\/CVE-2024-56145",
124
+ "cwes": [
125
+ "CWE-94"
126
+ ]
127
+ },
128
+ {
129
+ "cveID": "CVE-2023-39780",
130
+ "vendorProject": "ASUS",
131
+ "product": "RT-AX55 Routers",
132
+ "vulnerabilityName": "ASUS RT-AX55 Routers OS Command Injection Vulnerability",
133
+ "dateAdded": "2025-06-02",
134
+ "shortDescription": "ASUS RT-AX55 devices contain a OS command injection vulnerability that could allow a remote, authenticated attacker to execute arbitrary commands.",
135
+ "requiredAction": "Apply mitigations per vendor instructions, follow applicable BOD 22-01 guidance for cloud services, or discontinue use of the product if mitigations are unavailable.",
136
+ "dueDate": "2025-06-23",
137
+ "knownRansomwareCampaignUse": "Unknown",
138
+ "notes": "https:\/\/www.asus.com\/networking-iot-servers\/wifi-6\/all-series\/rt-ax55\/helpdesk_bios\/?model2Name=RT-AX55 ; https:\/\/www.asus.com\/content\/asus-product-security-advisory\/ ; https:\/\/nvd.nist.gov\/vuln\/detail\/CVE-2023-39780",
139
+ "cwes": [
140
+ "CWE-78"
141
+ ]
142
+ },
7
143
  {
8
144
  "cveID": "CVE-2025-4632",
9
145
  "vendorProject": "Samsung",
@@ -85,7 +221,7 @@
85
221
  "product": "Endpoint Manager Mobile (EPMM)",
86
222
  "vulnerabilityName": "Ivanti Endpoint Manager Mobile (EPMM) Code Injection Vulnerability",
87
223
  "dateAdded": "2025-05-19",
88
- "shortDescription": "Ivanti Endpoint Manager Mobile (EPMM) contains a code injection vulnerability in the API component that allows an authenticated attacker to remotely execute arbitrary code via crafted API requests. This vulnerability results from an insecure implementation of the Hibernate Validator open-source library.",
224
+ "shortDescription": "Ivanti Endpoint Manager Mobile (EPMM) contains a code injection vulnerability in the API component that allows an authenticated attacker to remotely execute arbitrary code via crafted API requests. This vulnerability results from an insecure implementation of the Hibernate Validator open-source library, as represented by CVE-2025-35036.",
89
225
  "requiredAction": "Apply mitigations per vendor instructions, follow applicable BOD 22-01 guidance for cloud services, or discontinue use of the product if mitigations are unavailable.",
90
226
  "dueDate": "2025-06-09",
91
227
  "knownRansomwareCampaignUse": "Unknown",
@@ -139,21 +275,6 @@
139
275
  "CWE-78"
140
276
  ]
141
277
  },
142
- {
143
- "cveID": "CVE-2025-4664",
144
- "vendorProject": "Google",
145
- "product": "Chromium",
146
- "vulnerabilityName": "Google Chromium Loader Insufficient Policy Enforcement Vulnerability",
147
- "dateAdded": "2025-05-15",
148
- "shortDescription": "Google Chromium contains an insufficient policy enforcement vulnerability that allows a remote attacker to leak cross-origin data via a crafted HTML page.",
149
- "requiredAction": "Apply mitigations per vendor instructions, follow applicable BOD 22-01 guidance for cloud services, or discontinue use of the product if mitigations are unavailable.",
150
- "dueDate": "2025-06-05",
151
- "knownRansomwareCampaignUse": "Unknown",
152
- "notes": "https:\/\/chromereleases.googleblog.com\/2025\/05\/stable-channel-update-for-desktop_14.html ; https:\/\/nvd.nist.gov\/vuln\/detail\/CVE-2025-4664",
153
- "cwes": [
154
- "CWE-346"
155
- ]
156
- },
157
278
  {
158
279
  "cveID": "CVE-2025-32756",
159
280
  "vendorProject": "Fortinet",
@@ -3608,7 +3729,7 @@
3608
3729
  "shortDescription": "NextGen Healthcare Mirth Connect contains a deserialization of untrusted data vulnerability that allows for unauthenticated remote code execution via a specially crafted request.",
3609
3730
  "requiredAction": "Apply mitigations per vendor instructions or discontinue use of the product if mitigations are unavailable.",
3610
3731
  "dueDate": "2024-06-10",
3611
- "knownRansomwareCampaignUse": "Unknown",
3732
+ "knownRansomwareCampaignUse": "Known",
3612
3733
  "notes": "This vulnerability affects a common open-source component, third-party library, or a protocol used by different products. Please check with specific vendors for information on patching status. For more information, please see: https:\/\/github.com\/nextgenhealthcare\/connect\/wiki\/4.4.1---What%27s-New ; https:\/\/nvd.nist.gov\/vuln\/detail\/CVE-2023-43208",
3613
3734
  "cwes": [
3614
3735
  "CWE-502"
@@ -3907,7 +4028,7 @@
3907
4028
  "shortDescription": "Ivanti Endpoint Manager Cloud Service Appliance (EPM CSA) contains a code injection vulnerability that allows an unauthenticated user to execute malicious code with limited permissions (nobody).",
3908
4029
  "requiredAction": "Apply mitigations per vendor instructions or discontinue use of the product if mitigations are unavailable.",
3909
4030
  "dueDate": "2024-04-15",
3910
- "knownRansomwareCampaignUse": "Unknown",
4031
+ "knownRansomwareCampaignUse": "Known",
3911
4032
  "notes": "https:\/\/forums.ivanti.com\/s\/article\/SA-2021-12-02?language=en_US; https:\/\/nvd.nist.gov\/vuln\/detail\/CVE-2021-44529",
3912
4033
  "cwes": [
3913
4034
  "CWE-94"
@@ -8385,7 +8506,7 @@
8385
8506
  "shortDescription": "RARLAB UnRAR on Linux and UNIX contains a directory traversal vulnerability, allowing an attacker to write to files during an extract (unpack) operation.",
8386
8507
  "requiredAction": "Apply updates per vendor instructions.",
8387
8508
  "dueDate": "2022-08-30",
8388
- "knownRansomwareCampaignUse": "Unknown",
8509
+ "knownRansomwareCampaignUse": "Known",
8389
8510
  "notes": "Vulnerability updated with version 6.12. Accessing link will download update information: https:\/\/www.rarlab.com\/rar\/rarlinux-x32-612.tar.gz; https:\/\/nvd.nist.gov\/vuln\/detail\/CVE-2022-30333",
8390
8511
  "cwes": [
8391
8512
  "CWE-22",
@@ -8401,7 +8522,7 @@
8401
8522
  "shortDescription": "Synacor Zimbra Collaboration Suite (ZCS) allows an attacker to inject memcache commands into a targeted instance which causes an overwrite of arbitrary cached entries.",
8402
8523
  "requiredAction": "Apply updates per vendor instructions.",
8403
8524
  "dueDate": "2022-08-25",
8404
- "knownRansomwareCampaignUse": "Unknown",
8525
+ "knownRansomwareCampaignUse": "Known",
8405
8526
  "notes": "https:\/\/wiki.zimbra.com\/wiki\/Zimbra_Releases\/9.0.0\/P24.1#Security_Fixes; https:\/\/nvd.nist.gov\/vuln\/detail\/CVE-2022-27924",
8406
8527
  "cwes": [
8407
8528
  "CWE-93"
@@ -9615,7 +9736,7 @@
9615
9736
  "shortDescription": "Unspecified vulnerability in the Oracle WebCenter Forms Recognition component in Oracle Fusion Middleware allows remote attackers to affect confidentiality, integrity, and availability via Unknown vectors related to Designer.",
9616
9737
  "requiredAction": "Apply updates per vendor instructions.",
9617
9738
  "dueDate": "2022-06-15",
9618
- "knownRansomwareCampaignUse": "Unknown",
9739
+ "knownRansomwareCampaignUse": "Known",
9619
9740
  "notes": "https:\/\/nvd.nist.gov\/vuln\/detail\/CVE-2012-1710",
9620
9741
  "cwes": []
9621
9742
  },
@@ -14153,7 +14274,7 @@
14153
14274
  "shortDescription": "The Java Runtime Environment (JRE) component in Oracle Java SE allow for remote code execution.",
14154
14275
  "requiredAction": "Apply updates per vendor instructions.",
14155
14276
  "dueDate": "2022-03-24",
14156
- "knownRansomwareCampaignUse": "Unknown",
14277
+ "knownRansomwareCampaignUse": "Known",
14157
14278
  "notes": "https:\/\/nvd.nist.gov\/vuln\/detail\/CVE-2012-4681",
14158
14279
  "cwes": []
14159
14280
  },
@@ -288,6 +288,7 @@ class FlatFileImporter(ABC):
288
288
  plugin_name=plugin_name,
289
289
  date_created=vuln.firstSeen,
290
290
  date_last_updated=vuln.lastSeen,
291
+ due_date="", # Override the default factory, we want ScannerIntegration to handle this
291
292
  )
292
293
  except (KeyError, TypeError, ValueError) as e:
293
294
  self.attributes.logger.error("Error parsing Wiz finding: %s", str(e), exc_info=True)
@@ -391,7 +392,8 @@ class FlatFileImporter(ABC):
391
392
  for _ in range(start_line_number):
392
393
  next(file)
393
394
  if file.name.endswith(".csv"):
394
- data, header = self.convert_csv_to_dict(file)
395
+ data = self.validater.data.to_dict("records")
396
+ header = list(self.validater.parsed_headers)
395
397
  elif file.name.endswith(".xlsx"):
396
398
  data, header = self.convert_xlsx_to_dict(file, start_line_number)
397
399
  elif file.name.endswith(".json"):
@@ -432,33 +434,6 @@ class FlatFileImporter(ABC):
432
434
  ", ".join(extra_headers),
433
435
  )
434
436
 
435
- def convert_csv_to_dict(self, file: TextIO) -> tuple:
436
- """
437
- Converts a csv file to a list of dictionaries
438
-
439
- :param TextIO file: The csv file to convert
440
- :return: Tuple of header and data from csv file
441
- :rtype: tuple
442
- """
443
- logger.debug("flatfileimporter: Converting csv to dict")
444
- # if file is empty, error and exit
445
- if not file.read(1):
446
- error_and_exit("File is empty")
447
- # Rewind file and skip lines until the start line is reached
448
- file.seek(0)
449
- for _ in range(getattr(self.attributes, "header_line_number", 0) or 0):
450
- next(file)
451
- reader = csv.DictReader(file)
452
-
453
- header = [head for head in list(reader.fieldnames) if head]
454
-
455
- if self.extra_headers_allowed:
456
- self.handle_extra_headers(header=header)
457
-
458
- data = list(reader)
459
- logger.debug("flatfileimporter: Done converting csv to dict.")
460
- return data, header
461
-
462
437
  def convert_xlsx_to_dict(self, file: TextIO, start_line_number: int = 0) -> tuple:
463
438
  """
464
439
  Converts a xlsx file to a list of dictionaries
@@ -561,145 +536,6 @@ class FlatFileImporter(ABC):
561
536
  if asset not in self.data["assets"]:
562
537
  self.data["assets"].append(asset)
563
538
 
564
- @staticmethod
565
- def check_status_codes(response_list: list) -> None:
566
- """
567
- Check if any of the responses are not 200
568
-
569
- :param list response_list: List of responses
570
- :raises AssertionError: If any of the responses are not 200
571
- :rtype: None
572
- """
573
- for response in response_list:
574
- if isinstance(response, requests.Response) and response.status_code != 200:
575
- raise AssertionError(
576
- f"Unable to {response.request.method} asset to RegScale.\n"
577
- f"Code: {response.status_code}\nReason: {response.reason}"
578
- f"\nPayload: {response.text}"
579
- )
580
-
581
- def update_due_dt(self, iss: Issue, kev_due_date: Optional[str], scanner: str, severity: str) -> Issue:
582
- """
583
- Find the due date for the issue
584
-
585
- :param Issue iss: RegScale Issue object
586
- :param Optional[str] kev_due_date: The KEV due date
587
- :param str scanner: The scanner
588
- :param str severity: The severity of the issue
589
- :return: RegScale Issue object
590
- :rtype: Issue
591
- """
592
- fmt = "%Y-%m-%d %H:%M:%S"
593
- days = 30
594
- if severity == "medium":
595
- severity = "moderate"
596
- if severity == "important":
597
- severity = "high"
598
- if severity not in ["low", "moderate", "high", "critical"]:
599
- # An odd severity should be treated as low.
600
- severity = "low"
601
- try:
602
- days = self.attributes.app.config["issues"][scanner][severity]
603
- except KeyError:
604
- self.attributes.logger.error(
605
- "Unable to find severity '%s'\n defaulting to %i days\nPlease add %s to the init.yaml configuration",
606
- severity,
607
- days,
608
- severity,
609
- )
610
- if kev_due_date and (datetime.strptime(kev_due_date, fmt) > datetime.now()):
611
- iss.dueDate = kev_due_date
612
- else:
613
- iss.dueDate = datetime.strftime(
614
- datetime.now() + timedelta(days=days),
615
- fmt,
616
- )
617
- return iss
618
-
619
- def _check_issue(self, issue: Issue) -> None:
620
- """
621
- Check if the issue is in the data
622
-
623
- :param Issue issue: The issue to check to prevent duplicates
624
- :rtype: None
625
- """
626
- if issue and issue not in self.data["issues"]:
627
- self.data["issues"].append(issue)
628
-
629
- def _check_issues(self, issues: List[Issue]) -> None:
630
- """
631
- Check if the issues are in the data
632
-
633
- :param List[Issue] issues: The issues to check to prevent duplicates
634
- """
635
- for issue in issues:
636
- self._check_issue(issue)
637
-
638
- def check_and_close_issues(self, existing_issues: list[Issue]) -> None:
639
- """
640
- Function to close issues that are no longer being reported in the export file
641
-
642
- :param list[Issue] existing_issues: List of existing issues in RegScale
643
- :rtype: None
644
- """
645
- existing_cves = self.group_issues_by_cve_id(existing_issues)
646
- parsed_cves = {issue.cve for issue in self.data["issues"] if issue.cve}
647
- closed_issues = []
648
- with create_progress_object() as close_issue_progress:
649
- closing_issues = close_issue_progress.add_task(
650
- "Comparing parsed issue(s) and existing issue(s)...",
651
- total=len(existing_cves),
652
- )
653
- for cve, issues in existing_cves.items():
654
- if cve not in parsed_cves:
655
- for issue in issues:
656
- if issue.status == "Closed":
657
- continue
658
- self.attributes.logger.debug("Closing issue #%s", issue.id)
659
- issue.status = "Closed"
660
- issue.dateCompleted = self.scan_date.strftime("%Y-%m-%d %H:%M:%S")
661
- if issue.save():
662
- self.attributes.logger.debug("Issue #%s closed", issue.id)
663
- closed_issues.append(issue)
664
- close_issue_progress.advance(closing_issues, advance=1)
665
- self.log_and_save_closed_issues(closed_issues)
666
-
667
- @staticmethod
668
- def group_issues_by_cve_id(existing_issues: list[Issue]) -> dict[str, list[Issue]]:
669
- """
670
- Function to group existing issues from RegScale by cve and returns a dictionary of cveId and issues
671
-
672
- :param list[Issue] existing_issues: List of existing issues in RegScale
673
- :returns: A dictionary of cveId and list of issues with the same cveId
674
- :rtype: dict[str, list[Issue]]
675
- """
676
- from collections import defaultdict
677
-
678
- # create a dict with an empty list for each cve, so we can close issues that have duplicate CVEs
679
- existing_cves = defaultdict(list)
680
- # group issues by cve
681
- for issue in existing_issues:
682
- if issue.cve:
683
- existing_cves[issue.cve].append(issue)
684
- return existing_cves
685
-
686
- def log_and_save_closed_issues(self, closed_issues: list[Issue]) -> None:
687
- """
688
- Log and save the closed issues if any
689
-
690
- :param list[Issue] closed_issues: List of closed issues to log and save
691
- :rtype: None
692
- """
693
- if len(closed_issues) > 0:
694
- self.attributes.logger.info("Closed %i issue(s) in RegScale.", len(closed_issues))
695
- ReportGenerator(
696
- objects=closed_issues,
697
- to_file=True,
698
- report_name=f"{self.attributes.name}_closed_issues",
699
- regscale_id=self.attributes.parent_id,
700
- regscale_module=self.attributes.parent_module,
701
- )
702
-
703
539
  def _check_vuln(self, vuln_to_check: Union[Vulnerability, "IntegrationFinding"]) -> None:
704
540
  """
705
541
  Check if the vuln is in the data
@@ -883,13 +719,16 @@ class FlatFileImporter(ABC):
883
719
  continue
884
720
 
885
721
  @classmethod
886
- def common_scanner_options(cls, message: str, prompt: str, import_name: str) -> Callable[[Callable], click.option]:
722
+ def common_scanner_options(
723
+ cls, message: str, prompt: str, import_name: str, support_component: bool = False
724
+ ) -> Callable[[Callable], click.option]:
887
725
  """
888
726
  Common options for container scanner integrations
889
727
 
890
728
  :param str message: The message to display to the user
891
729
  :param str prompt: The prompt to display to the user
892
730
  :param str import_name: The name of the import function
731
+ :param bool support_component: Whether to support importing data to a component
893
732
  :return: The decorated function
894
733
  :rtype: Callable[[Callable], click.option]
895
734
  """
@@ -936,14 +775,35 @@ class FlatFileImporter(ABC):
936
775
  cls=NotRequiredIf,
937
776
  not_required_if=["s3_bucket", "s3_prefix"],
938
777
  )(this_func)
939
- this_func = click.option(
940
- "--regscale_ssp_id",
941
- "-id",
942
- type=click.INT,
943
- help="The ID number from RegScale of the System Security Plan.",
944
- prompt="Enter RegScale System Security Plan ID",
945
- required=True,
946
- )(this_func)
778
+ if support_component:
779
+ # This will be the normal behavior for the imports in the future, but for now we will support it for Trivy, Grype, and OpenText
780
+ this_func = click.option(
781
+ "-id",
782
+ "-p",
783
+ "--regscale_ssp_id",
784
+ "--plan_id",
785
+ type=click.INT,
786
+ help="The ID number from RegScale of the System Security Plan.",
787
+ cls=NotRequiredIf,
788
+ not_required_if=["component_id"],
789
+ )(this_func)
790
+ this_func = click.option(
791
+ "-c",
792
+ "--component_id",
793
+ type=click.INT,
794
+ help="The ID number from RegScale of the Component.",
795
+ cls=NotRequiredIf,
796
+ not_required_if=["regscale_ssp_id"],
797
+ )(this_func)
798
+ else:
799
+ this_func = click.option(
800
+ "--regscale_ssp_id",
801
+ "-id",
802
+ type=click.INT,
803
+ help="The ID number from RegScale of the System Security Plan.",
804
+ prompt="Enter RegScale System Security Plan ID",
805
+ required=True,
806
+ )(this_func)
947
807
  this_func = click.option(
948
808
  "--scan_date",
949
809
  "-sd",
@@ -0,0 +1,27 @@
1
+ """
2
+ This module contains the TaskSync class, which is used to sync tasks between RegScale and Jira.
3
+ """
4
+
5
+ from typing import Literal
6
+
7
+ from regscale.models import Task
8
+
9
+
10
+ class TaskSync:
11
+ """
12
+ This class is used to sync tasks between RegScale and Jira.
13
+ """
14
+
15
+ tasks: list[Task] = []
16
+ operation: Literal["create", "update", "close"] = ""
17
+ progress_message: str = ""
18
+
19
+ def __init__(self, tasks: list[Task], operation: Literal["create", "update", "close"]):
20
+ self.tasks = tasks
21
+ self.operation = operation
22
+ if operation == "create":
23
+ self.progress_message = f"[#f8b737]Creating {len(tasks)} task(s) in RegScale..."
24
+ elif operation == "update":
25
+ self.progress_message = f"[#f8b737]Updating {len(tasks)} task(s) in RegScale..."
26
+ elif operation == "close":
27
+ self.progress_message = f"[#f8b737]Closing {len(tasks)} task(s) in RegScale..."
@@ -8,7 +8,7 @@ import logging
8
8
  # pylint: disable=C0415
9
9
  import re
10
10
  from datetime import datetime
11
- from typing import Any, Iterator, Optional, TypeVar, TextIO
11
+ from typing import Any, Iterator, Optional, TypeVar, TextIO, Union
12
12
 
13
13
  from openpyxl.reader.excel import load_workbook
14
14
 
@@ -63,14 +63,12 @@ class Qualys(FlatFileImporter):
63
63
  self.required_headers = [
64
64
  SEVERITY,
65
65
  self.vuln_title,
66
- EXPLOITABILITY,
67
66
  CVE_ID,
68
67
  SOLUTION,
69
68
  DNS,
70
69
  IP,
71
70
  QG_HOST_ID,
72
71
  OS,
73
- NETBIOS,
74
72
  FQDN,
75
73
  ]
76
74
  logger = create_logger()
@@ -110,7 +108,7 @@ class Qualys(FlatFileImporter):
110
108
  "isPublic": True,
111
109
  "status": "Active (On Network)",
112
110
  "assetCategory": "Hardware",
113
- "qualysId": self.mapping.get_value(dat, QG_HOST_ID), # UUID from Nessus HostProperties tag
111
+ "qualysId": str(self.mapping.get_value(dat, QG_HOST_ID)), # UUID from Nessus HostProperties tag
114
112
  "bLatestScan": True,
115
113
  "bAuthenticatedScan": True,
116
114
  "scanningTool": "Qualys",
@@ -177,7 +175,7 @@ class Qualys(FlatFileImporter):
177
175
  return regscale_vuln
178
176
 
179
177
  @staticmethod
180
- def extract_float(s: str) -> Any:
178
+ def extract_float(s: Union[str, float, int]) -> Optional[float]:
181
179
  """
182
180
  Extract a float from a string
183
181
 
@@ -185,8 +183,9 @@ class Qualys(FlatFileImporter):
185
183
  :return: Float extracted from string or None
186
184
  :rtype: Any
187
185
  """
188
- matches = re.findall(r"[-+]?[0-9]*\.?[0-9]+", s)
189
- if matches:
186
+ if isinstance(s, (float, int)):
187
+ return float(s)
188
+ if matches := re.findall(r"[-+]?[0-9]*\.?[0-9]+", s):
190
189
  return float(matches[0])
191
190
  else:
192
191
  return None