JFrog Xray Support

Software Risk Manager imports results from JFrog Xray using its built-in Reports feature, which collects a list of vulnerabilities for all scanned artifacts that match the specified filters. While this data includes the list of vulnerabilities and the affected artifacts, it does not include a list of the scanned artifacts.

If a new version of an artifact is uploaded and scanned by JFrog Xray, and if it is found to have zero vulnerabilities, that artifact may not have any entries in the report and vulnerabilities from older versions of the artifact may still be present. While SRM does track the list of affected artifacts through the "JFrog Impacted Artifacts" field on individual results, the existence of findings in the scanned project gives a false impression of its state and makes it harder to tell which vulnerabilities are still present in the most recent artifacts of interest.

Requests by SRM for the Build report type automatically include a filter to only fetch results for the latest build. However, Repository reports do not have this option, which necessitates detection and filtering by SRM to determine the latest version and its associated results.

When the JFrog Xray connector is configured to use Repository reports, SRM can perform a variety of additional checks to discover the most recent version of each affected artifact. The types and number of checks done will depend on which options are selected in the connector configuration form.

Detecting the "Latest Version"

The strategy for detecting the "latest version" depends on the "Latest Version Search Method" dropdown field, which has the following options: The "None" option may be used if you are interested in vulnerabilities across all versions of the affected artifacts. The "Report Only" option may be used if you expect the scanned artifacts to always contain at least some vulnerabilities. The "Active Search" option may be used if you expect at least some scanned artifacts to be completely free of vulnerabilities.

When a "latest version" is detected, its artifact ID and file path are recorded and used as a filter on the list of vulnerabilities in the JFrog Xray report.

Finding the "Latest Version" within a Report

When using the contents of the Xray report to detect the most recent version, SRM will take each affected artifact ID and split it on its last : (colon) character. Text up to this character will be used as the package ID, and text after that character will be used as the package version.

Note: This logic is also used to filter for specific versions when "Version Filtering Mode" is set to "Text Pattern."

SRM will take each artifact ID, its file path, and scan time for the artifact, and group this information together based on the parsed package ID. For each group, the entry with the most recent scan time will be used as the "latest version" for the given package ID.

Optimization Options for "Active Search" Detection

The Active Search detection method attempts to ensure that the latest detected version is correct. This can involve many requests to the JFrog Xray API and significantly lengthen analysis times. You can use the "Latest Version Search Optimizations" dropdown field to let SRM make certain assumptions, which will reduce the amount of API requests to JFrog Xray. This field has the following options:
  • Accurate. The full search process is performed as previously described.
  • Pre-Filter. SRM will use the "Report Only" filtering before making any API requests, reducing the number of requests to Get Artifacts and, potentially, Get Package Versions.
  • Optimistic. In addition to the Pre-Filter optimization, this option assumes that each package ID candidate is a match for each associated artifact (without confirming their existence in the list of package versions) and immediately returns the first package version in the list. This reduces the number of requests to Get Package Versions.
It is typically safe to enable "Optimistic" filtering for the following package types:
  • Docker
  • Maven
  • NPM
  • Go
  • Composer
  • NuGet
  • PyPi
  • Conan
It is recommended to start with the "Accurate" optimization to get a baseline set of results and confirm that other optimization options are consistent with that baseline.