Closed dobromirttmf closed 3 years ago
FortifyVulnerabilityExporter can only export issue details like file paths that are exposed through the SSC REST API; apparently SSC doesn't provide the drive letter so FortifyVulnerabilityExporter cannot know that a drive letter should be included to generate an absolute path. This is also mentioned in the documentation in more generic terms: https://github.com/fortify/FortifyVulnerabilityExporter#sonarqube-integration
Product changes would be required to resolve this issue in a generic way, so please consider to:
/Agents/vbc/a0/_work/1/s/Source/AAA/BBB/C.asax.cs
actually points to E:/Agents/vbc/a0/_work/1/s/Source/AAA/BBB/C.asax.cs
.As a work-around, you can use one of the following approaches:
filePath
properties to a format that is accepted by SonarQube.E:
prefix to the file paths: --json.sonarqube.sast.format.vulnerabilityMappers.issue.fields.primaryLocation.filePath=E:$[vuln.fullFileName]
Please leave a comment if you have any suggestions on how FortifyVulnerabilityExporter could assist in working around these product limitations.
@rsenden Thank you for the feedback. Regarding the second workaround: are there any future plans for adding this custom functionality in FortifyVulnerabilityExporter or client should do it in his own?
proposed workaround: "Customize the FortifyVulnerabilityExporter JSON output by using a custom configuration file or through command line options"
@dobromirttmf The second work-around was already available, but version 1.3.0 adds a --json.sonarqube.sast.filePathPrefix
command line option that makes it a bit easier to specify a file path prefix.
SSC vulnerabilities cannot be imported in SonarQube 8.3.1 during scan.
Issue: json file was generated successfully from SSC app version with FortifyVulnerabilityExporter version 1.2.0, but SonarQube was not importing vulnerabilities from scan as "filePath" was without volume.
Examples:
filePath with volume: "filePath" : "E:/Agents/vbc/a0/_work/1/s/Source/AAA/BBB/C.asax.cs", filePath without volume: "filePath" : "/Agents/vbc/a0/_work/1/s/Source/AAA/BBB/C.asax.cs",
There were 0 issues imported. Error experienced during SonarQube scan with external Fortify issue import:
Adding the
E:
volume to thefilePath
property fixes this issue.