CheckmarxPythonSDK 1.7.7__py3-none-any.whl → 1.7.9__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.
- CheckmarxPythonSDK/CxODataApiSDK/Utilities.py +1 -1
- CheckmarxPythonSDK/CxODataApiSDK/config.py +7 -2
- CheckmarxPythonSDK/CxOne/KeycloakAPI/AttackDetectionApi.py +29 -9
- CheckmarxPythonSDK/CxOne/KeycloakAPI/AuthenticationManagementApi.py +334 -102
- CheckmarxPythonSDK/CxOne/KeycloakAPI/ClientAttributeCertificateApi.py +70 -15
- CheckmarxPythonSDK/CxOne/KeycloakAPI/ClientInitialAccessApi.py +35 -13
- CheckmarxPythonSDK/CxOne/KeycloakAPI/ClientRegistrationPolicyApi.py +12 -4
- CheckmarxPythonSDK/CxOne/KeycloakAPI/ClientRoleMappingsApi.py +146 -46
- CheckmarxPythonSDK/CxOne/KeycloakAPI/ClientRolesApi.py +415 -160
- CheckmarxPythonSDK/CxOne/KeycloakAPI/ClientScopesApi.py +99 -35
- CheckmarxPythonSDK/CxOne/KeycloakAPI/ClientsApi.py +431 -130
- CheckmarxPythonSDK/CxOne/KeycloakAPI/ComponentApi.py +63 -19
- CheckmarxPythonSDK/CxOne/KeycloakAPI/GroupsApi.py +179 -53
- CheckmarxPythonSDK/CxOne/KeycloakAPI/IdentityProvidersApi.py +133 -40
- CheckmarxPythonSDK/CxOne/KeycloakAPI/KeyApi.py +7 -2
- CheckmarxPythonSDK/CxOne/KeycloakAPI/ProtocolMappersApi.py +234 -88
- CheckmarxPythonSDK/CxOne/KeycloakAPI/RealmsAdminApi.py +365 -230
- CheckmarxPythonSDK/CxOne/KeycloakAPI/RoleMapperApi.py +143 -41
- CheckmarxPythonSDK/CxOne/KeycloakAPI/RolesApi.py +467 -191
- CheckmarxPythonSDK/CxOne/KeycloakAPI/RolesByIdApi.py +137 -43
- CheckmarxPythonSDK/CxOne/KeycloakAPI/ScopeMappingsApi.py +580 -258
- CheckmarxPythonSDK/CxOne/KeycloakAPI/UsersApi.py +555 -220
- CheckmarxPythonSDK/CxOne/KeycloakAPI/dto/__init__.py +91 -0
- CheckmarxPythonSDK/CxOne/config.py +9 -2
- CheckmarxPythonSDK/CxOne/dto/Project.py +2 -0
- CheckmarxPythonSDK/CxRestAPISDK/config.py +7 -2
- CheckmarxPythonSDK/__init__.py +3 -17
- CheckmarxPythonSDK/__version__.py +1 -1
- CheckmarxPythonSDK/configuration.py +1 -1
- CheckmarxPythonSDK/logger_setup.py +64 -0
- {checkmarxpythonsdk-1.7.7.dist-info → checkmarxpythonsdk-1.7.9.dist-info}/METADATA +1 -1
- {checkmarxpythonsdk-1.7.7.dist-info → checkmarxpythonsdk-1.7.9.dist-info}/RECORD +35 -34
- {checkmarxpythonsdk-1.7.7.dist-info → checkmarxpythonsdk-1.7.9.dist-info}/WHEEL +1 -1
- {checkmarxpythonsdk-1.7.7.dist-info → checkmarxpythonsdk-1.7.9.dist-info}/licenses/LICENSE +0 -0
- {checkmarxpythonsdk-1.7.7.dist-info → checkmarxpythonsdk-1.7.9.dist-info}/top_level.txt +0 -0
|
@@ -206,7 +206,7 @@ def get_result(project, filter_false_positive=False, threshold=0):
|
|
|
206
206
|
"ScanId": last_scan_id,
|
|
207
207
|
"DirectLink": f"{ResultsODataAPI().api_client.configuration.server_base_url}/cxwebclient"
|
|
208
208
|
f"/ViewerMain.aspx?scanid={last_scan_id}&projectid={project_id}"
|
|
209
|
-
f"&pathid={result.get(
|
|
209
|
+
f"&pathid={result.get('PathId')}"
|
|
210
210
|
}
|
|
211
211
|
)
|
|
212
212
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from CheckmarxPythonSDK.configuration import Configuration
|
|
2
2
|
from CheckmarxPythonSDK.utilities.configUtility import get_config
|
|
3
|
+
from CheckmarxPythonSDK.logger_setup import set_module_logger_level
|
|
3
4
|
|
|
4
5
|
|
|
5
6
|
def construct_configuration() -> Configuration:
|
|
@@ -20,13 +21,14 @@ def construct_configuration() -> Configuration:
|
|
|
20
21
|
"verify": True,
|
|
21
22
|
"cert": None,
|
|
22
23
|
"proxy": None,
|
|
24
|
+
"logging_level": "ERROR",
|
|
23
25
|
}
|
|
24
26
|
old_config = get_config(config_default=config_default, section="checkmarx", prefix="cxsast_")
|
|
25
27
|
new_config = get_config(config_default=config_default, section="CxSAST", prefix="cxsast_")
|
|
26
28
|
config = old_config
|
|
27
29
|
if new_config.get("base_url"):
|
|
28
30
|
config = new_config
|
|
29
|
-
|
|
31
|
+
configuration = Configuration(
|
|
30
32
|
server_base_url=config.get("base_url"),
|
|
31
33
|
token_url=f"{config.get('base_url')}/cxrestapi/auth/identity/connect/token",
|
|
32
34
|
username=config.get("username"),
|
|
@@ -41,5 +43,8 @@ def construct_configuration() -> Configuration:
|
|
|
41
43
|
proxies={
|
|
42
44
|
"http": config.get("proxy"),
|
|
43
45
|
"https": config.get("proxy"),
|
|
44
|
-
}
|
|
46
|
+
},
|
|
47
|
+
logging_level=config.get("logging_level"),
|
|
45
48
|
)
|
|
49
|
+
set_module_logger_level("CxODataApiSDK", configuration.logging_level)
|
|
50
|
+
return configuration
|
|
@@ -11,7 +11,10 @@ class AttackDetectionApi:
|
|
|
11
11
|
api_client = ApiClient(configuration=configuration)
|
|
12
12
|
self.api_client = api_client
|
|
13
13
|
|
|
14
|
-
def delete_users(
|
|
14
|
+
def delete_users(
|
|
15
|
+
self,
|
|
16
|
+
realm: str
|
|
17
|
+
) -> bool:
|
|
15
18
|
"""
|
|
16
19
|
Clear any user login failures for all users This can release temporary disabled users
|
|
17
20
|
|
|
@@ -24,11 +27,18 @@ class AttackDetectionApi:
|
|
|
24
27
|
URL:
|
|
25
28
|
Relative path: /{realm}/attack-detection/brute-force/users
|
|
26
29
|
"""
|
|
27
|
-
relative_url = f"{api_url}/{realm}/
|
|
28
|
-
response = self.api_client.delete_request(
|
|
30
|
+
relative_url = f"{api_url}/{realm}/attack-detection/brute-force/users"
|
|
31
|
+
response = self.api_client.delete_request(
|
|
32
|
+
relative_url=relative_url,
|
|
33
|
+
is_iam=True
|
|
34
|
+
)
|
|
29
35
|
return response.status_code == 204
|
|
30
36
|
|
|
31
|
-
def get_brute_force_user(
|
|
37
|
+
def get_brute_force_user(
|
|
38
|
+
self,
|
|
39
|
+
realm: str,
|
|
40
|
+
user_id: str
|
|
41
|
+
) -> Dict[str, Any]:
|
|
32
42
|
"""
|
|
33
43
|
Get status of a username in brute force detection
|
|
34
44
|
|
|
@@ -42,11 +52,18 @@ class AttackDetectionApi:
|
|
|
42
52
|
URL:
|
|
43
53
|
Relative path: /{realm}/attack-detection/brute-force/users/{userId}
|
|
44
54
|
"""
|
|
45
|
-
relative_url = f"{api_url}/{realm}/
|
|
46
|
-
response = self.api_client.get_request(
|
|
55
|
+
relative_url = f"{api_url}/{realm}/attack-detection/brute-force/users/{user_id}"
|
|
56
|
+
response = self.api_client.get_request(
|
|
57
|
+
relative_url=relative_url,
|
|
58
|
+
is_iam=True
|
|
59
|
+
)
|
|
47
60
|
return response.json()
|
|
48
61
|
|
|
49
|
-
def delete_brute_force_user(
|
|
62
|
+
def delete_brute_force_user(
|
|
63
|
+
self,
|
|
64
|
+
realm: str,
|
|
65
|
+
user_id: str
|
|
66
|
+
) -> bool:
|
|
50
67
|
"""
|
|
51
68
|
Clear any user login failures for the user This can release temporary disabled user
|
|
52
69
|
|
|
@@ -60,6 +77,9 @@ class AttackDetectionApi:
|
|
|
60
77
|
URL:
|
|
61
78
|
Relative path: /{realm}/attack-detection/brute-force/users/{userId}
|
|
62
79
|
"""
|
|
63
|
-
relative_url = f"{api_url}/{realm}/
|
|
64
|
-
response = self.api_client.delete_request(
|
|
80
|
+
relative_url = f"{api_url}/{realm}/attack-detection/brute-force/users/{user_id}"
|
|
81
|
+
response = self.api_client.delete_request(
|
|
82
|
+
relative_url=relative_url,
|
|
83
|
+
is_iam=True
|
|
84
|
+
)
|
|
65
85
|
return response.status_code == 204
|