19.11 porting guide

This article discusses the changes in the API between 19.11 and 19.07. It’s intended to help you port your code forward to the latest version of Prisma Cloud. Note that we maintain a very large internal app that must be ported forward with every major release of Twistlock. We take the notes from our porting exercise, along with output from some custom diff tools, to identify and document critical breaking changes in the API.

Changes

The response schema for image, registry, Jenkins, twistcli, host, serverless function, and PCF droplet scan reports returned from the API has changed. These changes were required to support the integration of Twistlock into the Prisma Cloud SaaS service (Prisma Cloud Enterprise Edition). If your scripts depend on these endpoints, you’ll need to refactor them.
The impacted endpoints are:
  • /api/v1/images
  • /api/v1/registry
  • api/v1/scans
  • /api/v1/hosts
  • /api/v1/serverless
  • /api/v1/pcf_droplets

Eliminated the info parent object

The scan report schema was flattened. The info parent object was eliminated, and all its children were promoted a level. If x is a scan report, and w is an object in it, then w is now a top-level object.
x.info.w -> x.w
For example, in 19.07 scan reports had the following structure:
{ _id: scanTime: info: { packages: . . . } }
In 19.11, scan reports have the following structure:
{ _id: scanTime: packages: . . . }

Eliminated the data parent object

Similarly, the data parent object was removed, and all its children were promoted. If x is a scan report, and w is an object in it, then w is now a top-level object.
x.info.data.y -> x.y
For example, in 19.07 scan reports had the following structure:
{ _id: scanTime: info: { data: { binaries: . . . } } }
In 19.11, scan reports have the following structure.
{ _id: scanTime: binaries: . . . }

Renamed some objects

Some objects have been renamed for better clarity.
19.07
19.11
complianceVulnerabilities
complianceIssues
complianceVulnerabilitiesCnt
complianceIssuesCount
cveVulnerabilities
vulnerabilities
cveVulnerabilitiesCnt
vulnerabilitiesCount
cveVulnerabilityDistribution
vulnerabilityDistribution
info.version
scanVersion
pkgDistro
osDistro
pkgDistroRelease
osDistroRelease

Recommended For You