- Checkmarx Documentation
- Checkmarx SAST
- SAST API Guide
- CXSAST (REST) API
- CxSAST (REST) API v3
- OSA
OSA
Returns all the used libraries for the specified scan Id
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json;v=3.0"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://10.32.9.160/cxrestapi/help/osa/libraries", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
URL obj = new URL("https://10.32.9.160/cxrestapi/help/osa/libraries?scanId=497f6eca-6276-4993-bfeb-53cbbbba6f08");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
const headers = {
'Accept':'application/json;v=3.0',
'Authorization':'Bearer {access-token}'
};
fetch('https://10.32.9.160/cxrestapi/help/osa/libraries?scanId=497f6eca-6276-4993-bfeb-53cbbbba6f08',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
import requests
headers = {
'Accept': 'application/json;v=3.0',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://10.32.9.160/cxrestapi/help/osa/libraries', params={
'scanId': '497f6eca-6276-4993-bfeb-53cbbbba6f08'
}, headers = headers)
print(r.json())
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json;v=3.0',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get 'https://10.32.9.160/cxrestapi/help/osa/libraries',
params: {
'scanId' => 'string(uuid)'
}, headers: headers
p JSON.parse(result)
GET /osa/libraries
Parameters
Name | In | Type | Required | Description |
|---|---|---|---|---|
scanId | query | string(uuid) | true | Unique Id of the specific scan |
page | query | integer(int32) | false | Page number (default 1) |
itemsPerPage | query | integer(int32) | false | Number of items per page (default 100) |
Responses
Status | Meaning | Description | Schema |
|---|---|---|---|
200 | none | Inline |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
anonymous | false | none | [Library DTO] | |
» id | string | false | none | Library ID |
» name | string | false | none | Library Name |
» version | string | false | none | Library Version |
» releaseDate | string(date-time) | false | none | Library Release date of the current version |
» highUniqueVulnerabilityCount | integer(int32) | false | none | Number of high vulnerabilities |
» mediumUniqueVulnerabilityCount | integer(int32) | false | none | Number of medium vulnerabilities |
» lowUniqueVulnerabilityCount | integer(int32) | false | none | Number of low vulnerabilities |
» notExploitableVulnerabilityCount | integer(int32) | false | none | Number of not exploitable vulnerabilities |
» newestVersion | string | false | none | Newest version (if no newest version exists, then this field will remain empty) |
» newestVersionReleaseDate | string(date-time) | false | none | Release date of newest version (if no newest version exists, then this field will contain 1970/1/1) |
» numberOfVersionsSinceLastUpdate | integer(int32) | false | none | Number of newer versions (if no newest version exists, then this field will be 0) |
» confidenceLevel | integer(int32) | false | none | The confidence level about the provided result |
» matchType | false | none | none | |
»» id | integer(int32) | false | read-only | none |
»» name | string | false | read-only | none |
»» description | string | false | read-only | none |
» licenses | [string] | false | none | Collection of legal licenses id |
» outdated | boolean | false | none | Indicate whether this library outdated |
» severity | false | none | none | |
»» id | integer(int32) | false | none | none |
»» name | string | false | none | none |
» riskScore | number(double) | false | none | Library risk score based on highest vulnerability risk score |
» locations | false | none | Library locations and their match-type | |
»» path | string | false | read-only | none |
»» matchType | false | none | none | |
» codeUsageStatus | string | false | none | none |
» codeReferenceCount | integer(int64) | false | none | none |
» packageRepository | string | false | none | none |
To perform this operation, you must be authenticated by means of one of the following methods: Bearer ( Scopes: sast_api )