regscale-cli 6.25.0.1__py3-none-any.whl → 6.25.1.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/integrations/commercial/synqly/assets.py +17 -0
- regscale/integrations/commercial/wizv2/constants.py +20 -71
- regscale/integrations/due_date_handler.py +118 -6
- regscale/integrations/scanner_integration.py +49 -34
- regscale/models/integration_models/cisa_kev_data.json +48 -3
- regscale/models/integration_models/synqly_models/capabilities.json +1 -1
- regscale/utils/threading/threadhandler.py +20 -15
- {regscale_cli-6.25.0.1.dist-info → regscale_cli-6.25.1.0.dist-info}/METADATA +1 -1
- {regscale_cli-6.25.0.1.dist-info → regscale_cli-6.25.1.0.dist-info}/RECORD +14 -14
- {regscale_cli-6.25.0.1.dist-info → regscale_cli-6.25.1.0.dist-info}/LICENSE +0 -0
- {regscale_cli-6.25.0.1.dist-info → regscale_cli-6.25.1.0.dist-info}/WHEEL +0 -0
- {regscale_cli-6.25.0.1.dist-info → regscale_cli-6.25.1.0.dist-info}/entry_points.txt +0 -0
- {regscale_cli-6.25.0.1.dist-info → regscale_cli-6.25.1.0.dist-info}/top_level.txt +0 -0
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"""Thread handler to create and start threads"""
|
|
4
4
|
|
|
5
5
|
from concurrent.futures import ThreadPoolExecutor, TimeoutError, as_completed
|
|
6
|
-
from typing import Any, Callable, List, Tuple, Union
|
|
6
|
+
from typing import Any, Callable, List, Optional, Tuple, Union
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
class ThreadManager:
|
|
@@ -98,16 +98,7 @@ def create_threads(process: Callable, args: Tuple, thread_count: int) -> None:
|
|
|
98
98
|
:param int thread_count: # of threads needed
|
|
99
99
|
:rtype: None
|
|
100
100
|
"""
|
|
101
|
-
|
|
102
|
-
from regscale.core.app.application import Application
|
|
103
|
-
|
|
104
|
-
app = Application()
|
|
105
|
-
max_threads = app.config.get("maxThreads", 100)
|
|
106
|
-
if not isinstance(max_threads, int):
|
|
107
|
-
try:
|
|
108
|
-
max_threads = int(max_threads)
|
|
109
|
-
except (ValueError, TypeError):
|
|
110
|
-
max_threads = 100
|
|
101
|
+
max_threads = _determine_max_threads()
|
|
111
102
|
if threads := min(thread_count, max_threads):
|
|
112
103
|
# start the threads with the number of threads allowed
|
|
113
104
|
with ThreadPoolExecutor(max_workers=threads) as executor:
|
|
@@ -127,15 +118,29 @@ def thread_assignment(thread: int, total_items: int) -> list:
|
|
|
127
118
|
:return: List of items to process for the given thread
|
|
128
119
|
:rtype: list
|
|
129
120
|
"""
|
|
121
|
+
max_threads = _determine_max_threads()
|
|
122
|
+
|
|
123
|
+
return [x for x in range(total_items) if x % max_threads == thread]
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
def _determine_max_threads(default: Optional[int] = 100) -> int:
|
|
127
|
+
"""
|
|
128
|
+
Function to determine the max threads to use by checking the Application config
|
|
129
|
+
|
|
130
|
+
:param Optional[int] default: The default max threads to use if the Application config is not set, defaults to 100
|
|
131
|
+
:return: The max threads to use
|
|
132
|
+
:rtype: int
|
|
133
|
+
"""
|
|
130
134
|
from regscale.core.app.application import Application
|
|
131
135
|
|
|
132
136
|
app = Application()
|
|
137
|
+
if app.running_in_airflow:
|
|
138
|
+
default = 20
|
|
133
139
|
# set max threads
|
|
134
|
-
max_threads = app.config.get("maxThreads",
|
|
140
|
+
max_threads = app.config.get("maxThreads", default)
|
|
135
141
|
if not isinstance(max_threads, int):
|
|
136
142
|
try:
|
|
137
143
|
max_threads = int(max_threads)
|
|
138
144
|
except (ValueError, TypeError):
|
|
139
|
-
max_threads =
|
|
140
|
-
|
|
141
|
-
return [x for x in range(total_items) if x % max_threads == thread]
|
|
145
|
+
max_threads = default
|
|
146
|
+
return max_threads
|
|
@@ -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=qXIgTADAR4x7Bs08Sx0ILzqiq6QkTVIVUbXG1Q5wDZQ,1198
|
|
3
3
|
regscale/regscale.py,sha256=4LzcbkBxPh23cCLANVEEr6uNoZ0sebHec0N-VJm5_vA,31480
|
|
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
|
|
@@ -112,10 +112,10 @@ regscale/integrations/__init__.py,sha256=Sqthp3Jggo7co_go380cLn3OAb0cHwqL609_4QJ
|
|
|
112
112
|
regscale/integrations/api_paginator.py,sha256=73rjaNM9mGv8evHAeoObXEjZPg-bJuGPo60ewCLEil8,33192
|
|
113
113
|
regscale/integrations/api_paginator_example.py,sha256=lEuYI-xEGcjnXuIzbCobCP0YRuukLF0s8S3d382SAH4,12119
|
|
114
114
|
regscale/integrations/compliance_integration.py,sha256=as4cb4NWmY9mTaHtu75lvwxScB3OKE3Ge6ki7-zZNBE,91103
|
|
115
|
-
regscale/integrations/due_date_handler.py,sha256=
|
|
115
|
+
regscale/integrations/due_date_handler.py,sha256=RIT5OuKLeEU2XkSv5i8NIAyrLmJ39ZY4XFLxylw-L34,13861
|
|
116
116
|
regscale/integrations/integration_override.py,sha256=HjYBCuvNpU3t3FptaqYAkdexLFOZBAFrFE9xU0RD1Nc,5867
|
|
117
117
|
regscale/integrations/jsonl_scanner_integration.py,sha256=l8nq_T3rE1XX-6HxrNHm3xzxCNWbIjxQvGMdtZWs7KQ,57003
|
|
118
|
-
regscale/integrations/scanner_integration.py,sha256=
|
|
118
|
+
regscale/integrations/scanner_integration.py,sha256=Owy06vAXzYnq60tXG07oMpZGjThDwsXKngBa5U5MqLg,187636
|
|
119
119
|
regscale/integrations/variables.py,sha256=MfQ34WuYVN5437A9sZ2ssHRkA3gFhMHfk1DVasceGmY,2336
|
|
120
120
|
regscale/integrations/commercial/__init__.py,sha256=U2RIsRe4lKufADRwMJY0RhSbL6TX4jLxpCtbcnzvI3k,14607
|
|
121
121
|
regscale/integrations/commercial/ad.py,sha256=YXSmK8vRf6yi2GnREGa5GrE6GelhFrLj44SY8AO1pK0,15509
|
|
@@ -218,7 +218,7 @@ regscale/integrations/commercial/stigv2/ckl_parser.py,sha256=RPrDGsKqAbTJMsJd3AY
|
|
|
218
218
|
regscale/integrations/commercial/stigv2/click_commands.py,sha256=-765vFF03aSjBxU9SYCpca7x8fPaoTDNQtbk4fKuwYw,2792
|
|
219
219
|
regscale/integrations/commercial/stigv2/stig_integration.py,sha256=-UlfL0BBI3jFGotctOJyTCRAU9zIXW6mwU7ySrRXE9U,11573
|
|
220
220
|
regscale/integrations/commercial/synqly/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
221
|
-
regscale/integrations/commercial/synqly/assets.py,sha256=
|
|
221
|
+
regscale/integrations/commercial/synqly/assets.py,sha256=EY495sxSItKxkc5tp15KU_t8X9-MMt0-JCblv676QTY,7468
|
|
222
222
|
regscale/integrations/commercial/synqly/edr.py,sha256=4EQSI2-5QnaWXh1idhndToFDOHOb3xycWAdc8NY4Auk,2836
|
|
223
223
|
regscale/integrations/commercial/synqly/query_builder.py,sha256=1MAheCLG_3zUkvDeXbnCFEBybbG09OV-vUtBD0GLx0o,19306
|
|
224
224
|
regscale/integrations/commercial/synqly/ticketing.py,sha256=akucc9Ok4cTcivH_rmG927WJetJDhZ0L4IF27OC_KOE,8352
|
|
@@ -241,7 +241,7 @@ regscale/integrations/commercial/wizv2/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JC
|
|
|
241
241
|
regscale/integrations/commercial/wizv2/async_client.py,sha256=CElkHxbSlNfRnvJpf4JTBD293NJxQsR-QaTBuHINrLw,12946
|
|
242
242
|
regscale/integrations/commercial/wizv2/click.py,sha256=FkoXEUgZGQUyZNMdaDJTyNE8G_oXmIM5z6JlT-QQW8I,19831
|
|
243
243
|
regscale/integrations/commercial/wizv2/compliance_report.py,sha256=lFTgm78lrTSXJyqGA-wUbKJ2jOnFaHsV8_Ex95iIO-M,68717
|
|
244
|
-
regscale/integrations/commercial/wizv2/constants.py,sha256=
|
|
244
|
+
regscale/integrations/commercial/wizv2/constants.py,sha256=q5oxB4bMM0e45K4zQUqS_B-hHsEe8gpT3K9jrkg4_cg,48314
|
|
245
245
|
regscale/integrations/commercial/wizv2/data_fetcher.py,sha256=CmJyUCeTQIkYBu2LPicpTNwXJrYkRP3xxM55BJQhr2A,16258
|
|
246
246
|
regscale/integrations/commercial/wizv2/file_cleanup.py,sha256=ENBO9RDXL2kyHkBYaSai83i4kVTUJUF_F0JCj84i-ow,4178
|
|
247
247
|
regscale/integrations/commercial/wizv2/finding_processor.py,sha256=Rn2dYob4cz24_Ks-UTwNQe-KQ6hmFWS6GB8PQXV0ZPE,11361
|
|
@@ -329,7 +329,7 @@ regscale/models/integration_models/azure_alerts.py,sha256=2etrpvcxa7jVQrc98bJlVG
|
|
|
329
329
|
regscale/models/integration_models/base64.py,sha256=sxV6O5qY1_TstJENX5jBPsSdQwmA83-NNhgJFunXiZE,570
|
|
330
330
|
regscale/models/integration_models/burp.py,sha256=FBEBkH3U0Q8vq71FFoWnvgLRF5Hkr9GYmQFmNNHFrVk,16932
|
|
331
331
|
regscale/models/integration_models/burp_models.py,sha256=UytDTAcCaxyu-knFkm_mEUH6UmWK3OTXKSC9Sc6OjVs,3669
|
|
332
|
-
regscale/models/integration_models/cisa_kev_data.json,sha256=
|
|
332
|
+
regscale/models/integration_models/cisa_kev_data.json,sha256=2ex0O40ni9KX_RDUEoGIOEeKPELclHfeVehSDv6DJkM,1273678
|
|
333
333
|
regscale/models/integration_models/defender_data.py,sha256=jsAcjKxiGmumGerj7xSWkFd6r__YpuKDnYX5o7xHDiE,2844
|
|
334
334
|
regscale/models/integration_models/defenderimport.py,sha256=Ze4kgwns-IYPyO7sBjEzW8PXWlxwU-DAo2fIyRcTC3k,6242
|
|
335
335
|
regscale/models/integration_models/drf.py,sha256=Aq7AdLa_CH97NrnR-CxaFI22JjVN9uCxVN7Z-BBUaNU,18896
|
|
@@ -360,7 +360,7 @@ regscale/models/integration_models/flat_file_importer/__init__.py,sha256=HYO7mrq
|
|
|
360
360
|
regscale/models/integration_models/sbom/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
361
361
|
regscale/models/integration_models/sbom/cyclone_dx.py,sha256=0pFR0BWBrF5c8_cC_8mj2MXvNOMHOdHbBYXvTVfFAh8,4058
|
|
362
362
|
regscale/models/integration_models/synqly_models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
363
|
-
regscale/models/integration_models/synqly_models/capabilities.json,sha256=
|
|
363
|
+
regscale/models/integration_models/synqly_models/capabilities.json,sha256=wNGPBgqYl1jfBoJzRNcXFoSRtQwK8I2cHUmHov8UYgc,408808
|
|
364
364
|
regscale/models/integration_models/synqly_models/connector_types.py,sha256=8nxptkTexpskySnmL0obNAff_iu_fx6tJ7i1-4hJvao,461
|
|
365
365
|
regscale/models/integration_models/synqly_models/filter_parser.py,sha256=8rdnHH7gW1A_uWRTexZXzCH-HzRVy5nlvFgtc7ztcsQ,12160
|
|
366
366
|
regscale/models/integration_models/synqly_models/ocsf_mapper.py,sha256=ftObPhGg9CamnwRZ5z6qi8pW2Gu4JYy8apEo33o7q00,16960
|
|
@@ -493,7 +493,7 @@ regscale/utils/string.py,sha256=pY4eMcXRruCfGRaWKPN5NTWj6bXiKytxmU6XSxK4y6k,4198
|
|
|
493
493
|
regscale/utils/synqly_utils.py,sha256=DjkdAxdUJBOU5YfAJ7pFFNBPSP37Gs9NQS10xduaYmA,6324
|
|
494
494
|
regscale/utils/version.py,sha256=bOH1vlvOEAt1f-fzzFxtZrg3VcnqL5SA4ud1TjZVQGU,4265
|
|
495
495
|
regscale/utils/threading/__init__.py,sha256=AuPiT3EijkUL4BSxtEQw3TrSvFW6oIfQzxtdy5sBCkk,296
|
|
496
|
-
regscale/utils/threading/threadhandler.py,sha256=
|
|
496
|
+
regscale/utils/threading/threadhandler.py,sha256=6K3f74A8nMCRhtz3XlCA0_Wqhx1L1pizYwdwoQLI4I8,5255
|
|
497
497
|
regscale/utils/threading/threadsafe_counter.py,sha256=Dwt-jt4nN-ApMgpxONM7RFll6FU4hMCeZCW54rjDPjs,1037
|
|
498
498
|
regscale/utils/threading/threadsafe_dict.py,sha256=XCVN5DoJsgZj-0tkDYAZb2QTLTZF9wS_ve-XKFJiywg,7656
|
|
499
499
|
regscale/utils/threading/threadsafe_list.py,sha256=-ltEj-MQH0dN0z_5aalptwJw2_EAU6nn4RX32BDrhyI,2274
|
|
@@ -555,9 +555,9 @@ tests/regscale/models/test_regscale_model.py,sha256=ZsrEZkC4EtdIsoQuayn1xv2gEGcV
|
|
|
555
555
|
tests/regscale/models/test_report.py,sha256=IqUq7C__a1_q_mLaz0PE9Lq6fHggBsB14-AzEYNBxLw,4666
|
|
556
556
|
tests/regscale/models/test_tenable_integrations.py,sha256=y1qaW77H094VSGHjZdlvF66UCt-nPEib9Mv3cdwbM94,32435
|
|
557
557
|
tests/regscale/models/test_user_model.py,sha256=e9olv28qBApgnvK6hFHOgXjUC-pkaV8aGDirEIWASL4,4427
|
|
558
|
-
regscale_cli-6.25.0.
|
|
559
|
-
regscale_cli-6.25.0.
|
|
560
|
-
regscale_cli-6.25.0.
|
|
561
|
-
regscale_cli-6.25.0.
|
|
562
|
-
regscale_cli-6.25.0.
|
|
563
|
-
regscale_cli-6.25.0.
|
|
558
|
+
regscale_cli-6.25.1.0.dist-info/LICENSE,sha256=ytNhYQ9Rmhj_m-EX2pPq9Ld6tH5wrqqDYg-fCf46WDU,1076
|
|
559
|
+
regscale_cli-6.25.1.0.dist-info/METADATA,sha256=VTNaM1w0tCru4UYRJFjuEBku-SEdjzRF0ITFAW2WMkE,35027
|
|
560
|
+
regscale_cli-6.25.1.0.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
561
|
+
regscale_cli-6.25.1.0.dist-info/entry_points.txt,sha256=cLOaIP1eRv1yZ2u7BvpE3aB4x3kDrDwkpeisKOu33z8,269
|
|
562
|
+
regscale_cli-6.25.1.0.dist-info/top_level.txt,sha256=Uv8VUCAdxRm70bgrD4YNEJUmDhBThad_1aaEFGwRByc,15
|
|
563
|
+
regscale_cli-6.25.1.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|