devsecops-engine-tools 1.67.0__py3-none-any.whl → 1.69.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 devsecops-engine-tools might be problematic. Click here for more details.
- devsecops_engine_tools/engine_dast/src/domain/model/api_config.py +7 -3
- devsecops_engine_tools/engine_dast/src/domain/model/wa_config.py +8 -1
- devsecops_engine_tools/engine_dast/src/domain/usecases/dast_scan.py +5 -0
- devsecops_engine_tools/engine_dast/src/infrastructure/driven_adapters/nuclei/nuclei_config.py +5 -0
- devsecops_engine_tools/engine_dast/src/infrastructure/driven_adapters/nuclei/nuclei_tool.py +19 -11
- devsecops_engine_tools/version.py +1 -1
- {devsecops_engine_tools-1.67.0.dist-info → devsecops_engine_tools-1.69.0.dist-info}/METADATA +1 -1
- {devsecops_engine_tools-1.67.0.dist-info → devsecops_engine_tools-1.69.0.dist-info}/RECORD +11 -11
- {devsecops_engine_tools-1.67.0.dist-info → devsecops_engine_tools-1.69.0.dist-info}/WHEEL +0 -0
- {devsecops_engine_tools-1.67.0.dist-info → devsecops_engine_tools-1.69.0.dist-info}/entry_points.txt +0 -0
- {devsecops_engine_tools-1.67.0.dist-info → devsecops_engine_tools-1.69.0.dist-info}/top_level.txt +0 -0
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
from typing import List
|
|
1
|
+
from typing import List, Optional
|
|
2
2
|
from devsecops_engine_tools.engine_dast.src.domain.model.api_operation import ApiOperation
|
|
3
3
|
|
|
4
|
-
|
|
5
4
|
class ApiConfig():
|
|
6
5
|
def __init__(self, api_data: dict):
|
|
7
6
|
try:
|
|
8
7
|
self.target_type: str = "API"
|
|
9
8
|
self.endpoint: str = api_data["endpoint"]
|
|
10
|
-
self.rate_limit: str = api_data.get("rate_limit")
|
|
11
9
|
self.operations: "List[ApiOperation]" = api_data["operations"]
|
|
10
|
+
self.concurrency: Optional[int] = None
|
|
11
|
+
self.rate_limit: Optional[int] = api_data.get("rate_limit", 150)
|
|
12
|
+
self.response_size: Optional[int] = None
|
|
13
|
+
self.bulk_size: Optional[int] = None
|
|
14
|
+
self.timeout: Optional[int] = None
|
|
15
|
+
|
|
12
16
|
except KeyError:
|
|
13
17
|
raise KeyError("Missing configuration, validate the endpoint and every single operation")
|
|
@@ -1,8 +1,15 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
1
3
|
class WaConfig:
|
|
2
4
|
def __init__(self, data: dict, authentication_gateway):
|
|
3
5
|
self.target_type: str = "WA"
|
|
4
6
|
self.url: str = data["endpoint"]
|
|
5
|
-
self.data: dict = data
|
|
7
|
+
self.data: dict = data["data"]
|
|
8
|
+
self.concurrency: Optional[int] = None
|
|
9
|
+
self.rate_limit: Optional[int] = data.get("rate_limit", 150)
|
|
10
|
+
self.response_size: Optional[int] = None
|
|
11
|
+
self.bulk_size: Optional[int] = None
|
|
12
|
+
self.timeout: Optional[int] = None
|
|
6
13
|
|
|
7
14
|
def authenticate(self):
|
|
8
15
|
self.credentials = self.authentication_gateway.get_credentials()
|
|
@@ -52,6 +52,11 @@ class DastScan:
|
|
|
52
52
|
config_tool["SCOPE_PIPELINE"]
|
|
53
53
|
).get(tool)
|
|
54
54
|
|
|
55
|
+
self.data_target.concurrency = config_tool.get(tool, {}).get("CONCURRENCY", 25)
|
|
56
|
+
self.data_target.response_size = config_tool.get(tool, {}).get("RESPONSE_SIZE", 1048576)
|
|
57
|
+
self.data_target.bulk_size = config_tool.get(tool, {}).get("BULK_SIZE", 25)
|
|
58
|
+
self.data_target.timeout = config_tool.get(tool, {}).get("TIMEOUT", 10)
|
|
59
|
+
|
|
55
60
|
data_target_config = self.data_target
|
|
56
61
|
return config_tool, data_target_config
|
|
57
62
|
|
devsecops_engine_tools/engine_dast/src/infrastructure/driven_adapters/nuclei/nuclei_config.py
CHANGED
|
@@ -9,6 +9,11 @@ class NucleiConfig:
|
|
|
9
9
|
self.target_type: str = target_config.target_type.lower()
|
|
10
10
|
self.custom_templates_dir: str = ""
|
|
11
11
|
self.output_file: str = "result_dast_scan.json"
|
|
12
|
+
self.concurrency: int = target_config.concurrency
|
|
13
|
+
self.rate_limit: int = target_config.rate_limit
|
|
14
|
+
self.response_size: int = target_config.response_size
|
|
15
|
+
self.bulk_size: int = target_config.bulk_size
|
|
16
|
+
self.timeout: int = target_config.timeout
|
|
12
17
|
self.yaml = YAML()
|
|
13
18
|
if self.target_type == "api":
|
|
14
19
|
self.data: List = target_config.operations
|
|
@@ -31,7 +31,7 @@ class NucleiTool(ToolGateway):
|
|
|
31
31
|
self.data_config_cli = data_config_cli
|
|
32
32
|
self.TOOL: str = "NUCLEI"
|
|
33
33
|
|
|
34
|
-
def download_tool(self, version):
|
|
34
|
+
def download_tool(self, version, binary_path):
|
|
35
35
|
try:
|
|
36
36
|
base_url = f"https://github.com/projectdiscovery/nuclei/releases/download/v{version}/"
|
|
37
37
|
os_type = platform.system().lower()
|
|
@@ -49,35 +49,33 @@ class NucleiTool(ToolGateway):
|
|
|
49
49
|
if response.status_code != 200:
|
|
50
50
|
raise Exception(f"Error [102]: Failed to download Nuclei version {version}. HTTP status code: {response.status_code}")
|
|
51
51
|
|
|
52
|
-
|
|
53
|
-
zip_name = os.path.join(home_directory, file_name)
|
|
52
|
+
zip_name = os.path.join(binary_path, file_name)
|
|
54
53
|
with open(zip_name, "wb") as f:
|
|
55
54
|
f.write(response.content)
|
|
56
55
|
|
|
57
|
-
Utils().unzip_file(zip_name,
|
|
56
|
+
Utils().unzip_file(zip_name, binary_path)
|
|
58
57
|
return 0
|
|
59
58
|
except Exception as e:
|
|
60
59
|
logger.error(f"Error [103]: An exception occurred during download: {e}")
|
|
61
60
|
return e
|
|
62
61
|
|
|
63
|
-
def install_tool(self, version):
|
|
62
|
+
def install_tool(self, version, binary_path):
|
|
64
63
|
try:
|
|
65
64
|
nuclei_path = shutil.which("nuclei")
|
|
66
65
|
|
|
67
66
|
if not nuclei_path:
|
|
68
|
-
download_result = self.download_tool(version)
|
|
67
|
+
download_result = self.download_tool(version, binary_path)
|
|
69
68
|
if download_result != 0:
|
|
70
69
|
raise Exception(f"Error [104]: Download failed with error: {download_result}")
|
|
71
70
|
|
|
72
71
|
os_type = platform.system().lower()
|
|
73
|
-
home_directory = os.path.expanduser("~")
|
|
74
72
|
|
|
75
73
|
if nuclei_path:
|
|
76
74
|
executable_path = nuclei_path
|
|
77
75
|
elif os_type == "windows":
|
|
78
|
-
executable_path = os.path.join(
|
|
76
|
+
executable_path = os.path.join(binary_path, "nuclei.exe")
|
|
79
77
|
else:
|
|
80
|
-
executable_path = os.path.join(
|
|
78
|
+
executable_path = os.path.join(binary_path, "nuclei")
|
|
81
79
|
|
|
82
80
|
if os_type == "darwin" or os_type == "linux":
|
|
83
81
|
subprocess.run(["chmod", "+x", executable_path], check=True)
|
|
@@ -104,11 +102,17 @@ class NucleiTool(ToolGateway):
|
|
|
104
102
|
+ (f" -ud {target_config.custom_templates_dir}" if target_config.custom_templates_dir else "")
|
|
105
103
|
+ " -ni " # disable interactsh server
|
|
106
104
|
+ "-dc " # disable clustering of requests
|
|
105
|
+
+ "-sr " # use system DNS resolving as error fallback
|
|
106
|
+
+ "-or " # omit request/response pairs in the output
|
|
107
107
|
+ "-tags " # Excute only templates with the especified tag
|
|
108
108
|
+ target_config.target_type
|
|
109
|
+
+ (f" -c {target_config.concurrency}" if target_config.concurrency else "") # concurrency
|
|
110
|
+
+ (f" -rl {target_config.rate_limit}" if target_config.rate_limit else "") # rate limit
|
|
111
|
+
+ (f" -rss {target_config.response_size}" if target_config.response_size else "") # max response size to save in bytes
|
|
112
|
+
+ (f" -bs {target_config.bulk_size}" if target_config.bulk_size else "") # max number of hosts to analyze
|
|
113
|
+
+ (f" -timeout {target_config.timeout}" if target_config.timeout else "") # timeout for each request
|
|
109
114
|
+ " -je " # file to export results in JSON format
|
|
110
115
|
+ str(target_config.output_file)
|
|
111
|
-
+ " -sr"
|
|
112
116
|
)
|
|
113
117
|
|
|
114
118
|
if command is not None:
|
|
@@ -131,7 +135,11 @@ class NucleiTool(ToolGateway):
|
|
|
131
135
|
secret_external_checks,
|
|
132
136
|
agent_work_folder
|
|
133
137
|
):
|
|
134
|
-
|
|
138
|
+
binary_path = agent_work_folder
|
|
139
|
+
if config_tool[self.TOOL].get("BINARY_PATH"):
|
|
140
|
+
binary_path = config_tool[self.TOOL]["BINARY_PATH"]
|
|
141
|
+
|
|
142
|
+
result_install = self.install_tool(config_tool[self.TOOL]["VERSION"], binary_path)
|
|
135
143
|
if result_install["status"] < 200:
|
|
136
144
|
return [], None
|
|
137
145
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
version = '1.
|
|
1
|
+
version = '1.69.0'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
devsecops_engine_tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
devsecops_engine_tools/version.py,sha256=
|
|
2
|
+
devsecops_engine_tools/version.py,sha256=KQLoZcx51jQLw6biD8z2jpnV4STvMNzfe61Xm7v00g4,19
|
|
3
3
|
devsecops_engine_tools/engine_core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
4
|
devsecops_engine_tools/engine_core/src/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
5
|
devsecops_engine_tools/engine_core/src/applications/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -62,14 +62,14 @@ devsecops_engine_tools/engine_dast/src/deployment/__init__.py,sha256=47DEQpj8HBS
|
|
|
62
62
|
devsecops_engine_tools/engine_dast/src/deployment/infrastructure/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
63
63
|
devsecops_engine_tools/engine_dast/src/domain/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
64
64
|
devsecops_engine_tools/engine_dast/src/domain/model/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
65
|
-
devsecops_engine_tools/engine_dast/src/domain/model/api_config.py,sha256=
|
|
65
|
+
devsecops_engine_tools/engine_dast/src/domain/model/api_config.py,sha256=36zOqCRbY-YD-eOmG5SMbIeHAS46A1_l0HCmRGR_hwA,773
|
|
66
66
|
devsecops_engine_tools/engine_dast/src/domain/model/api_operation.py,sha256=mQbmTlB0UxCJGEmw21Z0c9ObQF72Gl8N1qK21H5H81o,621
|
|
67
|
-
devsecops_engine_tools/engine_dast/src/domain/model/wa_config.py,sha256=
|
|
67
|
+
devsecops_engine_tools/engine_dast/src/domain/model/wa_config.py,sha256=KnJ43dxJH5dzLS5SgqybPCnrCqplHblmQ9tEv7pr1_E,693
|
|
68
68
|
devsecops_engine_tools/engine_dast/src/domain/model/gateways/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
69
69
|
devsecops_engine_tools/engine_dast/src/domain/model/gateways/authentication_gateway.py,sha256=JSi2LAK8kPctqPmh3KfxIkXeDY5sSRsXoPWqudlmyYQ,175
|
|
70
70
|
devsecops_engine_tools/engine_dast/src/domain/model/gateways/tool_gateway.py,sha256=F9Xusc7bQo25GpRvCMWPPQ_hlILbGF1yZKMAnm15Axs,255
|
|
71
71
|
devsecops_engine_tools/engine_dast/src/domain/usecases/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
72
|
-
devsecops_engine_tools/engine_dast/src/domain/usecases/dast_scan.py,sha256=
|
|
72
|
+
devsecops_engine_tools/engine_dast/src/domain/usecases/dast_scan.py,sha256=iIQToOk38dbF04gZ6XvJk7A2sdpN3iOQ13VYLHO0ci8,5480
|
|
73
73
|
devsecops_engine_tools/engine_dast/src/infrastructure/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
74
74
|
devsecops_engine_tools/engine_dast/src/infrastructure/driven_adapters/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
75
75
|
devsecops_engine_tools/engine_dast/src/infrastructure/driven_adapters/http/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -79,9 +79,9 @@ devsecops_engine_tools/engine_dast/src/infrastructure/driven_adapters/jwt/__init
|
|
|
79
79
|
devsecops_engine_tools/engine_dast/src/infrastructure/driven_adapters/jwt/jwt_object.py,sha256=p0_rDDjdsyAa_ar-HgZE_SQE-beua0oK3KBnwj8EmPo,1998
|
|
80
80
|
devsecops_engine_tools/engine_dast/src/infrastructure/driven_adapters/jwt/jwt_tool.py,sha256=9Yh7lOd6lsHcvl8exgWW7N8qTP55w-Znl0kid7IlKrM,5431
|
|
81
81
|
devsecops_engine_tools/engine_dast/src/infrastructure/driven_adapters/nuclei/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
82
|
-
devsecops_engine_tools/engine_dast/src/infrastructure/driven_adapters/nuclei/nuclei_config.py,sha256=
|
|
82
|
+
devsecops_engine_tools/engine_dast/src/infrastructure/driven_adapters/nuclei/nuclei_config.py,sha256=am955PLHU8OBEiKwUsv8G_1wWZPFFi61-lRSgX-kAOY,3734
|
|
83
83
|
devsecops_engine_tools/engine_dast/src/infrastructure/driven_adapters/nuclei/nuclei_deserealizer.py,sha256=qqoBMXr350ItzabSU6a_fD2-9kB6pAmtWioFP5AvCIE,1346
|
|
84
|
-
devsecops_engine_tools/engine_dast/src/infrastructure/driven_adapters/nuclei/nuclei_tool.py,sha256=
|
|
84
|
+
devsecops_engine_tools/engine_dast/src/infrastructure/driven_adapters/nuclei/nuclei_tool.py,sha256=KQKEq06izKut2VMhD9nfc-CFPdvT8wOcar3COB7x6ZA,6843
|
|
85
85
|
devsecops_engine_tools/engine_dast/src/infrastructure/driven_adapters/oauth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
86
86
|
devsecops_engine_tools/engine_dast/src/infrastructure/driven_adapters/oauth/generic_oauth.py,sha256=fdQ6L7uiDsOol9unGL12l0O47LuOVkg5574Li7aqR24,2913
|
|
87
87
|
devsecops_engine_tools/engine_dast/src/infrastructure/entry_points/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -352,8 +352,8 @@ devsecops_engine_tools/engine_utilities/utils/name_conversion.py,sha256=ADJrRGax
|
|
|
352
352
|
devsecops_engine_tools/engine_utilities/utils/printers.py,sha256=amYAr9YQfYgR6jK9a2l26z3oovFPQ3FAKmhq6BKhEBA,623
|
|
353
353
|
devsecops_engine_tools/engine_utilities/utils/session_manager.py,sha256=Z0fdhB3r-dxU0nGSD9zW_B4r2Qol1rUnUCkhFR0U-HQ,487
|
|
354
354
|
devsecops_engine_tools/engine_utilities/utils/utils.py,sha256=HCjS900TBoNcHrC4LaiP-Kf9frVdtagF130qOUgnO2M,6757
|
|
355
|
-
devsecops_engine_tools-1.
|
|
356
|
-
devsecops_engine_tools-1.
|
|
357
|
-
devsecops_engine_tools-1.
|
|
358
|
-
devsecops_engine_tools-1.
|
|
359
|
-
devsecops_engine_tools-1.
|
|
355
|
+
devsecops_engine_tools-1.69.0.dist-info/METADATA,sha256=tea62eR8HLKZUGinRmojgCOjREwyuZXfYtVWrQFqkAs,12052
|
|
356
|
+
devsecops_engine_tools-1.69.0.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
|
|
357
|
+
devsecops_engine_tools-1.69.0.dist-info/entry_points.txt,sha256=MHCTFFs9bdNKo6YcWCcBW2_8X6yTisgLOlmVx-V8Rxc,276
|
|
358
|
+
devsecops_engine_tools-1.69.0.dist-info/top_level.txt,sha256=ge6y0X_xBAU1aG3EMWFtl9djbVyg5BxuSp2r2Lg6EQU,23
|
|
359
|
+
devsecops_engine_tools-1.69.0.dist-info/RECORD,,
|
|
File without changes
|
{devsecops_engine_tools-1.67.0.dist-info → devsecops_engine_tools-1.69.0.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{devsecops_engine_tools-1.67.0.dist-info → devsecops_engine_tools-1.69.0.dist-info}/top_level.txt
RENAMED
|
File without changes
|