devsecops-engine-tools 1.47.3__py3-none-any.whl → 1.48.1__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_core/src/infrastructure/driven_adapters/azure/azure_devops.py +4 -0
- devsecops_engine_tools/engine_sast/engine_iac/src/infrastructure/driven_adapters/checkov/checkov_tool.py +100 -15
- devsecops_engine_tools/engine_utilities/defect_dojo/domain/serializers/import_scan.py +1 -1
- devsecops_engine_tools/version.py +1 -1
- {devsecops_engine_tools-1.47.3.dist-info → devsecops_engine_tools-1.48.1.dist-info}/METADATA +1 -1
- {devsecops_engine_tools-1.47.3.dist-info → devsecops_engine_tools-1.48.1.dist-info}/RECORD +9 -9
- {devsecops_engine_tools-1.47.3.dist-info → devsecops_engine_tools-1.48.1.dist-info}/WHEEL +0 -0
- {devsecops_engine_tools-1.47.3.dist-info → devsecops_engine_tools-1.48.1.dist-info}/entry_points.txt +0 -0
- {devsecops_engine_tools-1.47.3.dist-info → devsecops_engine_tools-1.48.1.dist-info}/top_level.txt +0 -0
|
@@ -65,6 +65,10 @@ class AzureDevops(DevopsPlatformGateway):
|
|
|
65
65
|
"github": (
|
|
66
66
|
f"https://github.com/{BuildVariables.Build_Repository_Name.value()}"
|
|
67
67
|
),
|
|
68
|
+
"git": (
|
|
69
|
+
f"{SystemVariables.System_TeamFoundationCollectionUri.value()}"
|
|
70
|
+
f"{SystemVariables.System_TeamProject.value()}/_git/{BuildVariables.Build_Repository_Name.value()}"
|
|
71
|
+
).replace(" ", "%20")
|
|
68
72
|
}
|
|
69
73
|
return source_code_management_uri.get(BuildVariables.Build_Repository_Provider.value().lower())
|
|
70
74
|
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import yaml
|
|
2
|
+
import requests
|
|
3
|
+
import zipfile
|
|
2
4
|
import subprocess
|
|
3
5
|
import time
|
|
4
6
|
import os
|
|
@@ -66,14 +68,14 @@ class CheckovTool(ToolGateway):
|
|
|
66
68
|
|
|
67
69
|
installed = shutil.which(package)
|
|
68
70
|
if installed:
|
|
69
|
-
return
|
|
71
|
+
return "checkov"
|
|
70
72
|
|
|
71
73
|
python_command = "python3" if platform.system() != "Windows" else "python"
|
|
72
74
|
|
|
73
75
|
python_path = shutil.which(python_command)
|
|
74
76
|
if python_path is None:
|
|
75
77
|
logger.error("Python3 not found on the system.")
|
|
76
|
-
return
|
|
78
|
+
return None
|
|
77
79
|
|
|
78
80
|
def retry(attempt):
|
|
79
81
|
if attempt < MAX_RETRIES:
|
|
@@ -98,17 +100,17 @@ class CheckovTool(ToolGateway):
|
|
|
98
100
|
result = subprocess.run(install_cmd, capture_output=True)
|
|
99
101
|
if result.returncode == 0:
|
|
100
102
|
logger.debug(INSTALL_SUCCESS_MSG)
|
|
101
|
-
return
|
|
103
|
+
return "checkov"
|
|
102
104
|
except Exception as e:
|
|
103
105
|
logger.error(f"Error during installation: {e}")
|
|
104
106
|
|
|
105
107
|
retry(attempt)
|
|
106
108
|
|
|
107
|
-
return
|
|
109
|
+
return None
|
|
108
110
|
|
|
109
|
-
def execute(self, checkov_config: CheckovConfig):
|
|
111
|
+
def execute(self, checkov_config: CheckovConfig, command_prefix):
|
|
110
112
|
command = (
|
|
111
|
-
"
|
|
113
|
+
f"{command_prefix} --config-file "
|
|
112
114
|
+ checkov_config.path_config_file
|
|
113
115
|
+ checkov_config.config_file_name
|
|
114
116
|
+ self.CHECKOV_CONFIG_FILE
|
|
@@ -123,9 +125,9 @@ class CheckovTool(ToolGateway):
|
|
|
123
125
|
error = result.stderr.strip()
|
|
124
126
|
return output
|
|
125
127
|
|
|
126
|
-
def async_scan(self, queue, checkov_config: CheckovConfig):
|
|
128
|
+
def async_scan(self, queue, checkov_config: CheckovConfig, command_prefix):
|
|
127
129
|
result = []
|
|
128
|
-
output = self.execute(checkov_config)
|
|
130
|
+
output = self.execute(checkov_config, command_prefix)
|
|
129
131
|
result.append(json.loads(output))
|
|
130
132
|
queue.put(result)
|
|
131
133
|
|
|
@@ -136,6 +138,7 @@ class CheckovTool(ToolGateway):
|
|
|
136
138
|
agent_env,
|
|
137
139
|
environment,
|
|
138
140
|
platform_to_scan,
|
|
141
|
+
command_prefix
|
|
139
142
|
):
|
|
140
143
|
output_queue = queue.Queue()
|
|
141
144
|
# Crea una lista para almacenar los hilos
|
|
@@ -186,7 +189,7 @@ class CheckovTool(ToolGateway):
|
|
|
186
189
|
rules_run.update(config_tool[self.TOOL_CHECKOV]["RULES"][rule])
|
|
187
190
|
t = threading.Thread(
|
|
188
191
|
target=self.async_scan,
|
|
189
|
-
args=(output_queue, checkov_config),
|
|
192
|
+
args=(output_queue, checkov_config, command_prefix),
|
|
190
193
|
)
|
|
191
194
|
t.start()
|
|
192
195
|
threads.append(t)
|
|
@@ -212,13 +215,21 @@ class CheckovTool(ToolGateway):
|
|
|
212
215
|
util = Utils()
|
|
213
216
|
agent_env = util.configurate_external_checks(self.TOOL_CHECKOV,config_tool, secret_tool,secret_external_checks)
|
|
214
217
|
|
|
215
|
-
checkov_install = self.retryable_install_package(
|
|
216
|
-
"checkov", config_tool[self.TOOL_CHECKOV]["VERSION"]
|
|
217
|
-
)
|
|
218
218
|
|
|
219
|
-
|
|
219
|
+
install_type = config_tool[self.TOOL_CHECKOV].get("INSTALL_TYPE", "")
|
|
220
|
+
|
|
221
|
+
command_prefix = None
|
|
222
|
+
|
|
223
|
+
if install_type.casefold() == "remote-binary".casefold():
|
|
224
|
+
command_prefix = self.install_binary(config_tool[self.TOOL_CHECKOV])
|
|
225
|
+
else:
|
|
226
|
+
command_prefix = self.retryable_install_package(
|
|
227
|
+
"checkov", config_tool[self.TOOL_CHECKOV]["VERSION"]
|
|
228
|
+
)
|
|
229
|
+
|
|
230
|
+
if command_prefix is not None:
|
|
220
231
|
result_scans, rules_run = self.scan_folders(
|
|
221
|
-
folders_to_scan, config_tool, agent_env, environment, platform_to_scan
|
|
232
|
+
folders_to_scan, config_tool, agent_env, environment, platform_to_scan, command_prefix
|
|
222
233
|
)
|
|
223
234
|
|
|
224
235
|
checkov_deserealizator = CheckovDeserealizator()
|
|
@@ -240,4 +251,78 @@ class CheckovTool(ToolGateway):
|
|
|
240
251
|
),
|
|
241
252
|
)
|
|
242
253
|
else:
|
|
243
|
-
return [], None
|
|
254
|
+
return [], None
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
def install_binary(self,config_tool):
|
|
258
|
+
os_platform = platform.system()
|
|
259
|
+
if os_platform == "Linux":
|
|
260
|
+
architecture = platform.machine()
|
|
261
|
+
if architecture == "aarch64":
|
|
262
|
+
url = config_tool["URL_FILE_LINUX_ARM64"]
|
|
263
|
+
else:
|
|
264
|
+
url = config_tool["URL_FILE_LINUX"]
|
|
265
|
+
file = os.path.basename(url)
|
|
266
|
+
self.install_tool_unix(file, url)
|
|
267
|
+
return "./checkov"
|
|
268
|
+
elif os_platform == "Darwin":
|
|
269
|
+
url = config_tool["URL_FILE_DARWIN"]
|
|
270
|
+
file = os.path.basename(url)
|
|
271
|
+
self.install_tool_unix(file, url)
|
|
272
|
+
return "./checkov"
|
|
273
|
+
elif os_platform == "Windows":
|
|
274
|
+
url = config_tool["URL_FILE_WINDOWS"]
|
|
275
|
+
file = os.path.basename(url)
|
|
276
|
+
self.install_tool_windows(file, url)
|
|
277
|
+
return "checkov.exe"
|
|
278
|
+
else:
|
|
279
|
+
logger.warning(f"{os_platform} is not supported.")
|
|
280
|
+
return None
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
def download_tool(self, file, url):
|
|
284
|
+
try:
|
|
285
|
+
response = requests.get(url, allow_redirects=True)
|
|
286
|
+
with open(file, "wb") as compress_file:
|
|
287
|
+
compress_file.write(response.content)
|
|
288
|
+
except Exception as e:
|
|
289
|
+
logger.error(f"Error downloading Checkov: {e}")
|
|
290
|
+
|
|
291
|
+
def install_tool_unix(self, file, url):
|
|
292
|
+
installed = subprocess.run(
|
|
293
|
+
["which", "./checkov"],
|
|
294
|
+
stdout=subprocess.PIPE,
|
|
295
|
+
stderr=subprocess.PIPE,
|
|
296
|
+
)
|
|
297
|
+
if installed.returncode == 1:
|
|
298
|
+
command = ["chmod", "+x", "./checkov"]
|
|
299
|
+
try:
|
|
300
|
+
self.download_tool(file, url)
|
|
301
|
+
with zipfile.ZipFile(file, 'r') as zip_file:
|
|
302
|
+
zip_file.extract(member="dist/checkov")
|
|
303
|
+
source = os.path.join("dist", "checkov")
|
|
304
|
+
destination = "checkov"
|
|
305
|
+
shutil.move(source, destination)
|
|
306
|
+
subprocess.run(
|
|
307
|
+
command, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE
|
|
308
|
+
)
|
|
309
|
+
except Exception as e:
|
|
310
|
+
logger.error(f"Error installing Checkov: {e}")
|
|
311
|
+
|
|
312
|
+
def install_tool_windows(self, file, url):
|
|
313
|
+
try:
|
|
314
|
+
subprocess.run(
|
|
315
|
+
["checkov.exe", "--version"],
|
|
316
|
+
stdout=subprocess.PIPE,
|
|
317
|
+
stderr=subprocess.PIPE,
|
|
318
|
+
)
|
|
319
|
+
except:
|
|
320
|
+
try:
|
|
321
|
+
self.download_tool(file, url)
|
|
322
|
+
with zipfile.ZipFile(file, 'r') as zip_file:
|
|
323
|
+
zip_file.extract(member="dist/checkov.exe")
|
|
324
|
+
source = os.path.join("dist", "checkov.exe")
|
|
325
|
+
destination = "checkov.exe"
|
|
326
|
+
shutil.move(source, destination)
|
|
327
|
+
except Exception as e:
|
|
328
|
+
logger.error(f"Error installing Checkov: {e}")
|
|
@@ -179,7 +179,7 @@ class ImportScanSerializer(Schema):
|
|
|
179
179
|
product_name = fields.Str(required=False)
|
|
180
180
|
engagement_name = fields.Str(required=True)
|
|
181
181
|
engagement_end_date = fields.Str(required=False)
|
|
182
|
-
source_code_management_uri = fields.Str(required=False)
|
|
182
|
+
source_code_management_uri = fields.Str(required=False, load_default=None)
|
|
183
183
|
engagement = fields.Int(required=False)
|
|
184
184
|
auto_create_context = fields.Str(required=False, load_default="true")
|
|
185
185
|
deduplication_on_engagement = fields.Str(required=False)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
version = '1.
|
|
1
|
+
version = '1.48.1'
|
|
@@ -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=fsWA33w6l-rR0RWdoXYfxoaTVXSxTBcmlhCVcZQZfyI,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
|
|
@@ -36,7 +36,7 @@ devsecops_engine_tools/engine_core/src/infrastructure/driven_adapters/aws/__init
|
|
|
36
36
|
devsecops_engine_tools/engine_core/src/infrastructure/driven_adapters/aws/s3_manager.py,sha256=xLPwfh8FQzP5CldRj0ev8LsSxFO4A_i88EnNGBPuN2g,2210
|
|
37
37
|
devsecops_engine_tools/engine_core/src/infrastructure/driven_adapters/aws/secrets_manager.py,sha256=ELihQBgSPH4f9QCyg2dgjudsFitaqgdsljnVOmaA_v4,1972
|
|
38
38
|
devsecops_engine_tools/engine_core/src/infrastructure/driven_adapters/azure/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
39
|
-
devsecops_engine_tools/engine_core/src/infrastructure/driven_adapters/azure/azure_devops.py,sha256=
|
|
39
|
+
devsecops_engine_tools/engine_core/src/infrastructure/driven_adapters/azure/azure_devops.py,sha256=SIRGfjZZF_5JC_bjN3bvObKDZaSqtEcCd3DR2FGC5jI,5742
|
|
40
40
|
devsecops_engine_tools/engine_core/src/infrastructure/driven_adapters/defect_dojo/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
41
41
|
devsecops_engine_tools/engine_core/src/infrastructure/driven_adapters/defect_dojo/defect_dojo.py,sha256=dKodTpwafJUDSfCLPWELLkx7THK1m91ncoIO0mqStGg,30603
|
|
42
42
|
devsecops_engine_tools/engine_core/src/infrastructure/driven_adapters/github/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -152,7 +152,7 @@ devsecops_engine_tools/engine_sast/engine_iac/src/infrastructure/driven_adapters
|
|
|
152
152
|
devsecops_engine_tools/engine_sast/engine_iac/src/infrastructure/driven_adapters/checkov/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
153
153
|
devsecops_engine_tools/engine_sast/engine_iac/src/infrastructure/driven_adapters/checkov/checkov_config.py,sha256=qbE6wUO5_WFXF_QolL0JYelaRGEOUakPEZR_6HAKzzI,4355
|
|
154
154
|
devsecops_engine_tools/engine_sast/engine_iac/src/infrastructure/driven_adapters/checkov/checkov_deserealizator.py,sha256=l_opY909gh1m3k2ud2xDrCVnDTBe3ApYT75juBf_uMk,1836
|
|
155
|
-
devsecops_engine_tools/engine_sast/engine_iac/src/infrastructure/driven_adapters/checkov/checkov_tool.py,sha256=
|
|
155
|
+
devsecops_engine_tools/engine_sast/engine_iac/src/infrastructure/driven_adapters/checkov/checkov_tool.py,sha256=bMcPri5oZkQdzjz2cIWIb-JA3xpdsFwD7LPBp_IDUnQ,11991
|
|
156
156
|
devsecops_engine_tools/engine_sast/engine_iac/src/infrastructure/driven_adapters/kics/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
157
157
|
devsecops_engine_tools/engine_sast/engine_iac/src/infrastructure/driven_adapters/kics/kics_deserealizator.py,sha256=b1X5GWz2snJtsKZcGEsILNc178hv9p-lg-el0Jc-_Eo,2084
|
|
158
158
|
devsecops_engine_tools/engine_sast/engine_iac/src/infrastructure/driven_adapters/kics/kics_tool.py,sha256=8lda0A7huVSWgq2zMAN92vQv4ug0HiQMATGdXV5lgyA,5202
|
|
@@ -279,7 +279,7 @@ devsecops_engine_tools/engine_utilities/defect_dojo/domain/request_objects/findi
|
|
|
279
279
|
devsecops_engine_tools/engine_utilities/defect_dojo/domain/request_objects/import_scan.py,sha256=3OqfunER_l7j8JkcwEiVVao40GvGtGKcHf5YlPqfjsw,5198
|
|
280
280
|
devsecops_engine_tools/engine_utilities/defect_dojo/domain/serializers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
281
281
|
devsecops_engine_tools/engine_utilities/defect_dojo/domain/serializers/finding.py,sha256=4IQLjqgyImVdn8AxoU3UKgXnvU-F-x7Tm2bJdp6nHm4,5265
|
|
282
|
-
devsecops_engine_tools/engine_utilities/defect_dojo/domain/serializers/import_scan.py,sha256=
|
|
282
|
+
devsecops_engine_tools/engine_utilities/defect_dojo/domain/serializers/import_scan.py,sha256=pk28H4i2NdJjrXa58K1Me9zX7mjBcO0NrWpArh9bSqE,7508
|
|
283
283
|
devsecops_engine_tools/engine_utilities/defect_dojo/domain/user_case/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
284
284
|
devsecops_engine_tools/engine_utilities/defect_dojo/domain/user_case/cmdb.py,sha256=BUOdvP39bEMQ6Unr2hB28eljVGU2Uv8dDEkzRyEJgyQ,2650
|
|
285
285
|
devsecops_engine_tools/engine_utilities/defect_dojo/domain/user_case/component.py,sha256=_icc-ZAqw-aVgE5J4VH8Q7fSqpCgEGcfmurgRIN9NqM,448
|
|
@@ -347,8 +347,8 @@ devsecops_engine_tools/engine_utilities/utils/name_conversion.py,sha256=ADJrRGax
|
|
|
347
347
|
devsecops_engine_tools/engine_utilities/utils/printers.py,sha256=amYAr9YQfYgR6jK9a2l26z3oovFPQ3FAKmhq6BKhEBA,623
|
|
348
348
|
devsecops_engine_tools/engine_utilities/utils/session_manager.py,sha256=Z0fdhB3r-dxU0nGSD9zW_B4r2Qol1rUnUCkhFR0U-HQ,487
|
|
349
349
|
devsecops_engine_tools/engine_utilities/utils/utils.py,sha256=HCjS900TBoNcHrC4LaiP-Kf9frVdtagF130qOUgnO2M,6757
|
|
350
|
-
devsecops_engine_tools-1.
|
|
351
|
-
devsecops_engine_tools-1.
|
|
352
|
-
devsecops_engine_tools-1.
|
|
353
|
-
devsecops_engine_tools-1.
|
|
354
|
-
devsecops_engine_tools-1.
|
|
350
|
+
devsecops_engine_tools-1.48.1.dist-info/METADATA,sha256=hqIhjAzLVeg0ie74aQKly3ouyx32l_gutUl5jjWdGCo,11779
|
|
351
|
+
devsecops_engine_tools-1.48.1.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
|
|
352
|
+
devsecops_engine_tools-1.48.1.dist-info/entry_points.txt,sha256=MHCTFFs9bdNKo6YcWCcBW2_8X6yTisgLOlmVx-V8Rxc,276
|
|
353
|
+
devsecops_engine_tools-1.48.1.dist-info/top_level.txt,sha256=ge6y0X_xBAU1aG3EMWFtl9djbVyg5BxuSp2r2Lg6EQU,23
|
|
354
|
+
devsecops_engine_tools-1.48.1.dist-info/RECORD,,
|
|
File without changes
|
{devsecops_engine_tools-1.47.3.dist-info → devsecops_engine_tools-1.48.1.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{devsecops_engine_tools-1.47.3.dist-info → devsecops_engine_tools-1.48.1.dist-info}/top_level.txt
RENAMED
|
File without changes
|