Skip to content

Commit 413dbb2

Browse files
author
admin
committed
Add html report exporting
1 parent 9f23fd5 commit 413dbb2

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

src/test/java/net/continuumsecurity/steps/AppScanningSteps.java

+10
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,16 @@ public void writeXmlReport(String path) throws IOException {
100100
Files.write(pathToFile, xmlReport);
101101
}
102102

103+
104+
@Then("the HTML report is written to the file (.*)")
105+
public void writeHtmlReport(String path) throws IOException {
106+
byte[] htmlReport = scanner.getHtmlReport();
107+
Path pathToFile = Paths.get(path);
108+
Files.createDirectories(pathToFile.getParent());
109+
Files.write(pathToFile, htmlReport);
110+
}
111+
112+
103113
@Given("a scanner with all policies enabled")
104114
public void enableAllScanners() {
105115
getScanner().enableAllScanners();

src/test/resources/features/app_scan.feature

+25
Original file line numberDiff line numberDiff line change
@@ -184,3 +184,28 @@ Feature: Automated Application Security Scanning
184184
|url |parameter |cweId |wascId |
185185
And the XML report is written to the file build/zap/insecure_methods.xml
186186
Then no Medium or higher risk vulnerabilities should be present
187+
188+
@sonar-report
189+
Scenario: The sonar report is writting
190+
And the SQL-Injection policy is enabled
191+
And the Cross-Site-Scripting policy is enabled
192+
And the Path-traversal policy is enabled
193+
And the Remote-file-inclusion policy is enabled
194+
And the Server-side-include policy is enabled
195+
And the Server-side-code-injection policy is enabled
196+
And the Remote-os-command-injection policy is enabled
197+
And the crlf-injection policy is enabled
198+
And the External-redirect policy is enabled
199+
And the source-code-disclosure policy is enabled
200+
And the shell-shock policy is enabled
201+
And the ldap-injection policy is enabled
202+
And the xpath-injection policy is enabled
203+
And the xml-external-entity policy is enabled
204+
And the padding-oracle policy is enabled
205+
And the insecure-http-methods policy is enabled
206+
And the attack strength is set to High
207+
And the alert threshold is set to Low
208+
When the scanner is run
209+
And the following false positives are removed
210+
|url |parameter |cweId |wascId |
211+
Then the HTML report is written to the file build/zap/all_reports.html

0 commit comments

Comments
 (0)