Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CSV Hosts report format columns to match GSA #733

Merged
merged 6 commits into from
Sep 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Made checks to prevent duplicate user names stricter. [#708](https://github.com/greenbone/gvmd/pull/708) [#722](https://github.com/greenbone/gvmd/pull/722)
- Send delete command to ospd after stopping the task. [#710](https://github.com/greenbone/gvmd/pull/710)
- Check whether hosts are alive and have results when adding them in slave scans. [#717](https://github.com/greenbone/gvmd/pull/717) [#736](https://github.com/greenbone/gvmd/pull/736)

- New columns Ports, Apps, Distance, and Auth in the CSV Hosts report format [#733](https://github.com/greenbone/gvmd/pull/733)

### Fixed
- A PostgreSQL statement order issue [#611](https://github.com/greenbone/gvmd/issues/611) has been addressed [#642](https://github.com/greenbone/gvmd/pull/642)
Expand Down
35 changes: 34 additions & 1 deletion src/report_formats/CSV_Hosts/CSV_Hosts.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
</func:function>

<xsl:template match="report">
<xsl:text>IP,Hostname,OS,Scan Start,Scan End,CVSS,Severity,High,Medium,Low,Log,False Positive,Total
<xsl:text>IP,Hostname,OS,Scan Start,Scan End,CVSS,Severity,High,Medium,Low,Log,False Positive,Total,Ports,Apps,Distance,Auth
</xsl:text>
<xsl:for-each select="host">
<xsl:sort select="gvm:max-cvss (ip/text())" data-type="number" order="descending"/>
Expand Down Expand Up @@ -127,6 +127,39 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
<xsl:value-of select="$cnt_fp"/><xsl:text>,</xsl:text>

<xsl:value-of select="$cnt_high + $cnt_medium + $cnt_low + $cnt_log + $cnt_fp"/>
<xsl:text>,</xsl:text>

<xsl:value-of select="port_count/page"/>
<xsl:text>,</xsl:text>

<xsl:value-of select="count(detail[name/text() = 'App'])"/>
<xsl:text>,</xsl:text>

<xsl:variable name="traceroute" select="detail[name/text() = 'traceroute']"/>
<xsl:value-of select="string-length($traceroute) - string-length(translate($traceroute, ',', ''))"/>

<xsl:text>,</xsl:text>
<xsl:if test="detail[name/text() = 'Auth-SSH-Success']">
<xsl:text>SSH</xsl:text>
</xsl:if>
<xsl:if test="detail[name/text() = 'Auth-SMB-Success']">
timopollmeier marked this conversation as resolved.
Show resolved Hide resolved
<xsl:if test="detail[name/text() = 'Auth-SSH-Success']">
<xsl:text> </xsl:text>
</xsl:if>
<xsl:text>SMB</xsl:text>
</xsl:if>
<xsl:if test="detail[name/text() = 'Auth-SNMP-Success']">
<xsl:if test="detail[name/text() = 'Auth-SSH-Success' or name/text() = 'Auth-SMB-Success']">
<xsl:text> </xsl:text>
</xsl:if>
<xsl:text>SNMP</xsl:text>
</xsl:if>
<xsl:if test="detail[name/text() = 'Auth-ESXi-Success']">
<xsl:if test="detail[name/text() = 'Auth-SSH-Success' or name/text() = 'Auth-SMB-Success' or name/text() = 'Auth-SNMP-Success']">
<xsl:text> </xsl:text>
</xsl:if>
<xsl:text>ESXi</xsl:text>
</xsl:if>

<!-- add newline -->
<xsl:text>
Expand Down