devsecops-engine-tools 1.55.0__py3-none-any.whl → 1.56.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_dast/src/infrastructure/driven_adapters/oauth/generic_oauth.py +2 -2
- devsecops_engine_tools/engine_sast/engine_iac/src/infrastructure/driven_adapters/checkov/checkov_tool.py +32 -22
- devsecops_engine_tools/version.py +1 -1
- {devsecops_engine_tools-1.55.0.dist-info → devsecops_engine_tools-1.56.1.dist-info}/METADATA +1 -1
- {devsecops_engine_tools-1.55.0.dist-info → devsecops_engine_tools-1.56.1.dist-info}/RECORD +8 -8
- {devsecops_engine_tools-1.55.0.dist-info → devsecops_engine_tools-1.56.1.dist-info}/WHEEL +0 -0
- {devsecops_engine_tools-1.55.0.dist-info → devsecops_engine_tools-1.56.1.dist-info}/entry_points.txt +0 -0
- {devsecops_engine_tools-1.55.0.dist-info → devsecops_engine_tools-1.56.1.dist-info}/top_level.txt +0 -0
devsecops_engine_tools/engine_dast/src/infrastructure/driven_adapters/oauth/generic_oauth.py
CHANGED
|
@@ -11,7 +11,7 @@ logger = MyLogger.__call__(**settings.SETTING_LOGGER).get_logger()
|
|
|
11
11
|
class GenericOauth(AuthenticationGateway):
|
|
12
12
|
def __init__(self, data, endpoint):
|
|
13
13
|
self.data: dict = data
|
|
14
|
-
self.endpoint = endpoint
|
|
14
|
+
self.endpoint: str = endpoint
|
|
15
15
|
self.config = {}
|
|
16
16
|
|
|
17
17
|
def process_data(self):
|
|
@@ -52,7 +52,7 @@ class GenericOauth(AuthenticationGateway):
|
|
|
52
52
|
"scope": self.config["scope"]
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
url = self.endpoint + self.config["path"]
|
|
55
|
+
url = self.endpoint + self.config["path"] if not self.config["path"].startswith("http") else self.config["path"]
|
|
56
56
|
headers = self.config["headers"]
|
|
57
57
|
response = requests.request(
|
|
58
58
|
self.config["method"], url, headers=headers, data=data, timeout=5
|
|
@@ -57,57 +57,67 @@ class CheckovTool(ToolGateway):
|
|
|
57
57
|
yaml.dump(checkov_config.dict_confg_file, file)
|
|
58
58
|
file.close()
|
|
59
59
|
|
|
60
|
-
|
|
61
60
|
def retryable_install_package(self, package: str, version: str) -> bool:
|
|
62
61
|
MAX_RETRIES = 3
|
|
63
62
|
RETRY_DELAY = 1 # in seconds
|
|
64
63
|
INSTALL_SUCCESS_MSG = f"Installation of {package} successful"
|
|
65
|
-
INSTALL_RETRY_MSG =
|
|
66
|
-
f"Retrying installation of {package} in {RETRY_DELAY} seconds..."
|
|
67
|
-
)
|
|
64
|
+
INSTALL_RETRY_MSG = f"Retrying installation of {package} in {RETRY_DELAY} seconds..."
|
|
68
65
|
|
|
69
66
|
installed = shutil.which(package)
|
|
70
67
|
if installed:
|
|
71
68
|
return "checkov"
|
|
72
69
|
|
|
73
70
|
python_command = "python3" if platform.system() != "Windows" else "python"
|
|
74
|
-
|
|
75
71
|
python_path = shutil.which(python_command)
|
|
76
72
|
if python_path is None:
|
|
77
|
-
logger.error("
|
|
73
|
+
logger.error("Python not found on the system.")
|
|
74
|
+
return None
|
|
75
|
+
|
|
76
|
+
# Detect Python version
|
|
77
|
+
try:
|
|
78
|
+
result = subprocess.run(
|
|
79
|
+
[python_path, "--version"],
|
|
80
|
+
capture_output=True,
|
|
81
|
+
text=True,
|
|
82
|
+
check=True
|
|
83
|
+
)
|
|
84
|
+
version_str = result.stdout.strip().split()[1]
|
|
85
|
+
major, minor, *_ = map(int, version_str.split("."))
|
|
86
|
+
except Exception as e:
|
|
87
|
+
logger.error(f"Failed to detect Python version: {e}")
|
|
78
88
|
return None
|
|
79
89
|
|
|
90
|
+
# Prepare install command parts
|
|
91
|
+
install_cmd_base = [
|
|
92
|
+
python_path, "-m", "pip", "install", "-q",
|
|
93
|
+
f"{package}=={version}",
|
|
94
|
+
"--retries", str(MAX_RETRIES),
|
|
95
|
+
"--timeout", str(RETRY_DELAY),
|
|
96
|
+
]
|
|
97
|
+
|
|
98
|
+
if (major, minor) >= (3, 11):
|
|
99
|
+
install_cmd_base.append("--break-system-packages")
|
|
100
|
+
|
|
80
101
|
def retry(attempt):
|
|
81
102
|
if attempt < MAX_RETRIES:
|
|
82
103
|
logger.warning(INSTALL_RETRY_MSG)
|
|
83
104
|
time.sleep(RETRY_DELAY)
|
|
84
105
|
|
|
85
106
|
for attempt in range(1, MAX_RETRIES + 1):
|
|
86
|
-
install_cmd = [
|
|
87
|
-
python_path,
|
|
88
|
-
"-m",
|
|
89
|
-
"pip",
|
|
90
|
-
"install",
|
|
91
|
-
"-q",
|
|
92
|
-
f"{package}=={version}",
|
|
93
|
-
"--retries",
|
|
94
|
-
str(MAX_RETRIES),
|
|
95
|
-
"--timeout",
|
|
96
|
-
str(RETRY_DELAY),
|
|
97
|
-
]
|
|
98
|
-
|
|
99
107
|
try:
|
|
100
|
-
result = subprocess.run(
|
|
108
|
+
result = subprocess.run(install_cmd_base, capture_output=True)
|
|
101
109
|
if result.returncode == 0:
|
|
102
110
|
logger.debug(INSTALL_SUCCESS_MSG)
|
|
103
111
|
return "checkov"
|
|
112
|
+
else:
|
|
113
|
+
logger.error(f"Installation failed (attempt {attempt}): {result.stderr.decode().strip()}")
|
|
104
114
|
except Exception as e:
|
|
105
|
-
logger.error(f"Error during installation: {e}")
|
|
115
|
+
logger.error(f"Error during installation (attempt {attempt}): {e}")
|
|
106
116
|
|
|
107
117
|
retry(attempt)
|
|
108
118
|
|
|
109
119
|
return None
|
|
110
|
-
|
|
120
|
+
|
|
111
121
|
def execute(self, checkov_config: CheckovConfig, command_prefix):
|
|
112
122
|
command = (
|
|
113
123
|
f"{command_prefix} --config-file "
|
|
@@ -1 +1 @@
|
|
|
1
|
-
version = '1.
|
|
1
|
+
version = '1.56.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=8mpGm6z-L6X4ymQ3_8LD1YncguL5Xrs034FtvUIeOe4,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
|
|
@@ -83,7 +83,7 @@ devsecops_engine_tools/engine_dast/src/infrastructure/driven_adapters/nuclei/nuc
|
|
|
83
83
|
devsecops_engine_tools/engine_dast/src/infrastructure/driven_adapters/nuclei/nuclei_deserealizer.py,sha256=qqoBMXr350ItzabSU6a_fD2-9kB6pAmtWioFP5AvCIE,1346
|
|
84
84
|
devsecops_engine_tools/engine_dast/src/infrastructure/driven_adapters/nuclei/nuclei_tool.py,sha256=Bk2JTwzTqrU9N84C_GTIf2vF_IpxuvLbvaygVIWOXdI,6066
|
|
85
85
|
devsecops_engine_tools/engine_dast/src/infrastructure/driven_adapters/oauth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
86
|
-
devsecops_engine_tools/engine_dast/src/infrastructure/driven_adapters/oauth/generic_oauth.py,sha256=
|
|
86
|
+
devsecops_engine_tools/engine_dast/src/infrastructure/driven_adapters/oauth/generic_oauth.py,sha256=qjcVMro4nBdM8LR9d4PxWEmHvxo8ni0t48S2AG6vta8,2882
|
|
87
87
|
devsecops_engine_tools/engine_dast/src/infrastructure/entry_points/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
88
88
|
devsecops_engine_tools/engine_dast/src/infrastructure/entry_points/entry_point_dast.py,sha256=Cbl-PH4BL4mT7JMkFRd3G9xKL4VatGDox3uyCGjxsKc,419
|
|
89
89
|
devsecops_engine_tools/engine_dast/src/infrastructure/helpers/__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=dI71x8QfhVOmq6FmzHsiHoUFWCwHjr4W4BgikyLiMjA,12645
|
|
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=tZq3jutZL2M9XIxm5K_xd3mWwTCMVmHQPFNvrslCqCM,2092
|
|
158
158
|
devsecops_engine_tools/engine_sast/engine_iac/src/infrastructure/driven_adapters/kics/kics_tool.py,sha256=pVNZclcBKA6Ebm9kUfBWlHFI37ROT58CdqcczeM1UGs,6656
|
|
@@ -349,8 +349,8 @@ devsecops_engine_tools/engine_utilities/utils/name_conversion.py,sha256=ADJrRGax
|
|
|
349
349
|
devsecops_engine_tools/engine_utilities/utils/printers.py,sha256=amYAr9YQfYgR6jK9a2l26z3oovFPQ3FAKmhq6BKhEBA,623
|
|
350
350
|
devsecops_engine_tools/engine_utilities/utils/session_manager.py,sha256=Z0fdhB3r-dxU0nGSD9zW_B4r2Qol1rUnUCkhFR0U-HQ,487
|
|
351
351
|
devsecops_engine_tools/engine_utilities/utils/utils.py,sha256=HCjS900TBoNcHrC4LaiP-Kf9frVdtagF130qOUgnO2M,6757
|
|
352
|
-
devsecops_engine_tools-1.
|
|
353
|
-
devsecops_engine_tools-1.
|
|
354
|
-
devsecops_engine_tools-1.
|
|
355
|
-
devsecops_engine_tools-1.
|
|
356
|
-
devsecops_engine_tools-1.
|
|
352
|
+
devsecops_engine_tools-1.56.1.dist-info/METADATA,sha256=F5ZpP3JPiHmHIo4C9ag2kj48NO7gGdkKXFu2m736mkk,11779
|
|
353
|
+
devsecops_engine_tools-1.56.1.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
|
|
354
|
+
devsecops_engine_tools-1.56.1.dist-info/entry_points.txt,sha256=MHCTFFs9bdNKo6YcWCcBW2_8X6yTisgLOlmVx-V8Rxc,276
|
|
355
|
+
devsecops_engine_tools-1.56.1.dist-info/top_level.txt,sha256=ge6y0X_xBAU1aG3EMWFtl9djbVyg5BxuSp2r2Lg6EQU,23
|
|
356
|
+
devsecops_engine_tools-1.56.1.dist-info/RECORD,,
|
|
File without changes
|
{devsecops_engine_tools-1.55.0.dist-info → devsecops_engine_tools-1.56.1.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{devsecops_engine_tools-1.55.0.dist-info → devsecops_engine_tools-1.56.1.dist-info}/top_level.txt
RENAMED
|
File without changes
|