API Calls
The <integration_type> placeholder is to be replaced with either “ghe” (GitHub Enterprise), “gls” (GitLab), or “bb” (Bitbucket).
Health Check APIs
Mend App
wss-<integration_type>-app Container
Request (GET): {wss-<integration_type>-app-container-url}:5678/payload/healthcheck
Response: If the app container is healthy, the response code will be 200.
wss-scanner Container
NOTE: This Health Check API is only supported from version 19.10.1.
Request (GET): {wss-scanner-container-url}:9393/health-check
Response: If the scanner container is healthy, the response code will be 200 and the response will contain the following JSON object:
CODE
|
wss-remediate Container
Request (GET): {wss-remediate-container-url}:8080
Response: If the remediate container is healthy, the response code will be 200 and the response will contain the following JSON object:
CODE
|
Accessing Scan Statistics via API
In order to keep track of the number of scan requests that are in the scan queue at any given time, the following API call can be used via the wss-<integration_type>-app container endpoint:
Request (GET):
{wss-<integration_type>-app-container-url}/payload/scanner/request
An optional state parameter can be provided as part of the request URL. It can contain one of the following values:
pending (this is the default value when using this API call)
scanning
done
For example: {wss-<integration_type>-app-container-url}:5678/payload/scanner/request?state=scanning
Response:
{
"extraData":null,
"requestedScanState":"pending",
"requestsCount":"6"
}
Our existing controller API endpoint (/payload/scanner/request) only returns SCA scans.
Create two new endpoints to allow retrieving both SAST results and SCA results (the existing endpoint will be kept untouched for backward compatibility).
Retrieve scan count by state and engine
Note: This endpoint is for Mend for GitHub Enterprise only.
Request (GET):
{wss-<integration_type>-app-container-url}/payload/scanner/request/by-engine
Query parameters:
state
- pending / scanning / doneengine
- SCA / SAST / ALL
Response:
{
"requestedScanState": "pending",
"requestsCount": "123"
}
Retrieve scan count by state for all engines
Note: This endpoint is for Mend for GitHub Enterprise only.
Request (GET):
{wss-<integration_type>-app-container-url}/payload/scanner/request/all-engines
Query parameters:
state
- pending / scanning / done
Response:
{
"sca": {
"requestedScanState": "pending",
"requestsCount": "123"
},
"sast": {
"requestedScanState": "pending",
"requestsCount": "45"
}
}