- Checkmarx Documentation
- Checkmarx SAST
- SAST API Guide
- CxSAST (OData) API
- 9.5.0 API Enhancements
9.5.0 API Enhancements
To track the age of vulnerabilities, the vulnerability detection date was added to each result metadata in OData. This can be helpful for customers that have internal SLAs and rules where the age of the vulnerabilities determines compliance with their enterprise's policies.
It is possible to build queries to get the detection date of specific vulnerabilities.
Following are the OData API examples related to the vulnerability detection date added to the Results metadata:
Retrieve all the results
Request result: retrieve all results metadata with detection date
Query used for retrieving the data: http://localhost/Cxwebinterface/odata/v1/Results
Retrieve the results for a specific Query in a particular Scan
Request result: retrieve all results metadata for a specific scan id and query id
Query used for retrieving the data: http://localhost/Cxwebinterface/odata/v1/Results(1,1000001)
Retrieve all results for a specific Scan
Request result: retrieve all scan details and results metadata for a specific scan Id
Query used for retrieving the data: http://localhost/Cxwebinterface/odata/v1/Scans(1000001)/Results
All Projects with their Last Scan and the High Vulnerabilities with detection date
Requested result: list all projects, and for each project list the security issues (vulnerabilities) with a High severity degree found in the project's most recent scan.
Query used for retrieving the data: http://localhost/Cxwebinterface/odata/v1/Projects?$expand=LastScan($expand=Results($filter=Severity%20eq%20CxDataRepository.Severity%27High%27))
Same query broken into two pages of 10 projects each:
http://localhost/Cxwebinterface/odata/v1/Projects?$expand=LastScan($expand=Results($filter=Severity%20eq%20CxDataRepository.Severity%27High%27))&$top=10&skip=0
http://localhost/Cxwebinterface/odata/v1/Projects?$expand=LastScan($expand=Results($filter=Severity%20eq%20CxDataRepository.Severity%27High%27))&$top=10&skip=10
Get only detection date results metadata for specific scan id and query id
Request result: retrieve only detection date results metadata for a specific scan Id and query id
Query used for retrieve the data: http://localhost/Cxwebinterface/odata/v1/Results(Id=1,ScanId=1000001)?$select=DetectionDate
Retrieve the first vulnerability detection date of results metadata for specific scan id and query id
Request result: retrieve first vulnerability detection date results metadata for a specific scan id and query id
Query used for retrieve the data: http://localhost/Cxwebinterface/odata/v1/Results?top=1&select=DetectionDate
For more details about CxSAST (OData) API Overview, see CxSAST (OData) API Overview & Examples.