Skip to content

Commit d4d51cf

Browse files
author
Grzegorz Siewruk
committed
GVM 20 integration
1 parent 1773857 commit d4d51cf

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/main/java/pl/orange/bst/mixer/openvas/OpenVasClient.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ public ReportXml getReport(RestRequestBody body) throws JAXBException, SAXExcept
7575
* Version 11
7676
*/
7777
private List<Vuln> loadVulns(User user, HashMap<String, String> params, int start, List<Vuln> vulns) throws JAXBException, SAXException, IOException, ParserConfigurationException {
78-
ProcessBuilder pb = new ProcessBuilder("bash", "-c", "gvm-cli --timeout 600 socket --socketpath " + socket + " --xml '" + xob.buildGetResult(user, params, start) + "'");
78+
//ProcessBuilder pb = new ProcessBuilder("bash", "-c", "gvm-cli --timeout 600 socket --socketpath " + socket + " --xml '" + xob.buildGetResult(user, params, start) + "'");
79+
ProcessBuilder pb = new ProcessBuilder("bash", "-c", buildCommandPrefix(user) + "'"+xob.buildGetResult(user, params, start)+"'");
7980
String output = IOUtils.toString(pb.start().getInputStream());
8081
Document doc = DocumentBuilderFactory.newInstance()
8182
.newDocumentBuilder()
@@ -284,6 +285,6 @@ private String getCreateTargetRespnse(User user, HashMap<String, String> params)
284285
}
285286

286287
public String buildCommandPrefix(User user){
287-
return String.format("gvm-cli --gmp-username=%s --gmp-password=%s socket --socketpath %s --xml ",user.getUsername(), user.getPassword(), socket);
288+
return String.format("gvm-cli --timeout 600 --gmp-username=%s --gmp-password=%s socket --socketpath %s --xml ",user.getUsername(), user.getPassword(), socket);
288289
}
289290
}

src/main/java/pl/orange/bst/mixer/openvas/pojo/Report.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ public class Report {
1313
private String reportId;
1414
@XmlAttribute(name="ignore_pagination")
1515
private Boolean ignorePagination = true;
16+
@XmlAttribute(name = "details")
17+
private String details = "True";
1618

1719
public String getReportId() {
1820
return reportId;

0 commit comments

Comments
 (0)