OtherDevOpsGene / zap-sonar-plugin

Integrates OWASP Zed Attack Proxy reports into SonarQube
GNU General Public License v3.0
69 stars 29 forks source link

Upload multiple ZAP Reports #102

Open vincebrechbuehl opened 2 years ago

vincebrechbuehl commented 2 years ago

In my Jenkins pipeline I have integrated a Zap scan that scans multiple targets, for each target a ZAP report is generated. I want to upload multiple ZAP reports in Sonar? I have analysed the Java source code of the ZapSensor class as well as XmlReportFile/HtmlReportFile and it is not possible like this. So is it possible to extend the logic of the ZapSensor class to handle multiple ZAP reports, or is this not possible at all for architectural reasons? I imagine extending the two parameters "sonar.zaproxy.htmlReportPath" and "sonar.zaproxy.rulesFilePath" so that you can specify multiple reports as a path and then extending the ZapSensor class so that it processes multiple reports. Could such a logic work?

pablosguajardo commented 1 year ago

that would be great. if they do it saves us a lot of work. what you can do is request the xml report and then call the api and request the html report and save it:

http://localhost:$(PortZapProxy)/JSON/reports/action/generate/?apikey=$(keyOwaspZapProxy)&title=Report+html&template=traditional-html&theme=&description=&contexts=&sites=&sections=&includedConfidences=&includedRisks=&reportFileName=zaproxy-htmlReport.html&reportFileNamePattern=&reportDir=$(Common.TestResultsDirectory)&display=

I do it in devops with powershell