You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/main/java/com/contrast/labs/ai/mcp/contrast/AssessService.java
+16-13Lines changed: 16 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -42,11 +42,7 @@
42
42
importorg.springframework.stereotype.Service;
43
43
44
44
importjava.io.IOException;
45
-
importjava.util.ArrayList;
46
-
importjava.util.HashSet;
47
-
importjava.util.List;
48
-
importjava.util.Optional;
49
-
importjava.util.Set;
45
+
importjava.util.*;
50
46
51
47
@Service
52
48
publicclassAssessService {
@@ -69,11 +65,18 @@ public class AssessService {
69
65
@Value("${contrast.org-id:${CONTRAST_ORG_ID:}}")
70
66
privateStringorgID;
71
67
68
+
@Value("${http.proxy.host:${http_proxy_host:}}")
69
+
privateStringhttpProxyHost;
70
+
71
+
@Value("${http.proxy.port:${http_proxy_port:}}")
72
+
privateStringhttpProxyPort;
73
+
74
+
72
75
73
76
@Tool(name = "get_vulnerability_by_id", description = "takes a vulnerability ID ( vulnID ) and Application ID ( appID ) and returns details about the specific security vulnerability. If based on the stacktrace, the vulnerability looks like it is in code that is not in the codebase, the vulnerability may be in a 3rd party library, review the CVE data attached to that stackframe you believe the vulnerability exists in and if possible upgrade that library to the next non vulnerable version based on the remediation guidance.")
@Tool(name = "get_vulnerability", description = "Takes a vulnerability ID (vulnID) and application name (app_name) and returns details about the specific security vulnerability. If based on the stacktrace, the vulnerability looks like it is in code that is not in the codebase, the vulnerability may be in a 3rd party library, review the CVE data attached to that stackframe you believe the vulnerability exists in and if possible upgrade that library to the next non vulnerable version based on the remediation guidance.")
@Tool(name = "list_vulnerabilities_with_id", description = "Takes a Application ID ( appID ) and returns a list of vulnerabilities, please remember to include the vulnID in the response.")
@Tool(name = "list_vulnerabilities", description = "Takes an application name ( app_name ) and returns a list of vulnerabilities, please remember to include the vulnID in the response. ")
logger.debug("Searching for application ID matching name: {}", app_name);
@@ -226,15 +229,15 @@ public List<VulnLight> listVulnsInAppByName(String app_name) throws IOException
226
229
@Tool(name = "list_applications", description = "Takes an application name (app_name) returns a list of active applications matching that name. Please remember to display the name, status and ID.")
@@ -37,11 +38,19 @@ public class RouteCoverageService {
37
38
@Value("${contrast.org-id:${CONTRAST_ORG_ID:}}")
38
39
privateStringorgID;
39
40
41
+
@Value("${http.proxy.host:${http_proxy_host:}}")
42
+
privateStringhttpProxyHost;
43
+
44
+
@Value("${http.proxy.port:${http_proxy_port:}}")
45
+
privateStringhttpProxyPort;
46
+
47
+
48
+
40
49
@Tool(name = "get_application_route_coverage", description = "takes a application name and return the route coverage data for that application. " +
41
50
"If a route/endpoint is DISCOVERED, it means it has been found by Assess but that route has had no inbound http requests. If it is EXERCISED, it means it has had atleast one inbound http request to that route/endpoint.")
logger.debug("Searching for application ID matching name: {}", app_name);
@@ -78,7 +87,7 @@ public RouteCoverageResponse getRouteCoverage(String app_name) throws IOExceptio
78
87
"If a route/endpoint is DISCOVERED, it means it has been found by Assess but that route has had no inbound http requests. If it is EXERCISED, it means it has had atleast one inbound http request to that route/endpoint.")
@Tool(name = "list_application_libraries_by_app_id", description = "takes a application ID and returns the libraries used in the application, note if class usage count is 0 the library is unlikely to be used")
@@ -69,7 +77,7 @@ public List<LibraryExtended> getApplicationLibrariesByID(String appID) throws IO
69
77
@Tool(name = "list_application_libraries", description = "takes a application name and returns the libraries used in the application, note if class usage count is 0 the library is unlikely to be used")
@@ -94,7 +102,7 @@ public List<LibraryExtended> getApplicationLibraries(String app_name) throws IOE
94
102
@Tool(name= "list_applications_vulnerable_to_cve", description = "takes a cve id and returns the applications and servers vulnerable to the cve. Please note if the application class usage is 0, its unlikely to be vulnerable")
0 commit comments