/usr/share/openvas/openvasmd/global_report_formats/910200ca-dc05-11e1-954f-406186ea4fc5/ARF.xsl is in openvas-manager-common 6.0.9-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 | <?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
version="1.0"
xmlns:func = "http://exslt.org/functions"
xmlns:openvas="http://openvas.org"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ai="http://scap.nist.gov/schema/asset-identification/1.1"
xmlns:core="http://scap.nist.gov/schema/reporting-core/1.1"
xmlns:cpe-name="http://cpe.mitre.org/naming/2.0"
xmlns:arf="http://scap.nist.gov/specifications/arf/index.html"
xmlns="http://scap.nist.gov/schema/asset-reporting-format/1.1"
extension-element-prefixes="func">
<xsl:output
method = "xml"
indent = "yes" />
<!--
OpenVAS Manager
$Id: arf.xsl 13067 2012-03-15 16:06:29Z mattm $
Description: Stylesheet for generating NIST ARF-compatible reports.
Authors:
Henri Doreau <henri.doreau@greenbone.net>
Copyright:
Copyright (C) 2012 Greenbone Networks GmbH
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-->
<func:function name="openvas:report">
<xsl:choose>
<xsl:when test="count(/report/report) > 0">
<func:result select="/report/report"/>
</xsl:when>
<xsl:otherwise>
<func:result select="/report"/>
</xsl:otherwise>
</xsl:choose>
</func:function>
<xsl:template match="report">
<asset-report-collection>
<core:relationships xmlns:arfvocab="http://scap.nist.gov/vocabulary/arf/relationships/1.0#">
<xsl:for-each select="host">
<xsl:variable name="curr_host" select="ip/text()"/>
<xsl:variable name="host_id" select="concat('h_', $curr_host)"/>
<xsl:variable name="report_id" select="concat('report_', $curr_host)"/>
<core:relationship type="arfvocab:isAbout"
subject="{$report_id}">
<core:ref>
<xsl:value-of select="$host_id"/>
</core:ref>
</core:relationship>
<xsl:for-each select="detail[name = 'App']/value">
<core:relationship type="arfvocab:isAbout"
subject="{$report_id}">
<core:ref>
<xsl:value-of select="concat('a_', $host_id, '_', position())"/>
</core:ref>
</core:relationship>
</xsl:for-each>
</xsl:for-each>
</core:relationships>
<assets>
<xsl:for-each select="host">
<xsl:variable name="host_id" select="concat('h_', ip/text())"/>
<asset id="{$host_id}">
<ai:computing-device>
<xsl:for-each select="detail[name = 'OS']">
<xsl:if test="contains(value, 'cpe:/h')">
<cpe><xsl:value-of select="value"/></cpe>
</xsl:if>
</xsl:for-each>
<xsl:if test="detail[name = 'hostname']">
<hostname>
<xsl:value-of select="detail[name = 'hostname']/value"/>
</hostname>
</xsl:if>
<ai:connections>
<ai:connection>
<ai:ip-address>
<ai:ip-v4><xsl:value-of select="ip/text()"/></ai:ip-v4>
</ai:ip-address>
</ai:connection>
</ai:connections>
</ai:computing-device>
</asset>
<xsl:for-each select="detail[name = 'App']/value">
<asset id="a_{$host_id}_{position()}">
<ai:software>
<cpe><xsl:value-of select="."/></cpe>
</ai:software>
</asset>
</xsl:for-each>
<xsl:if test="detail[name = 'best_os_cpe']/value">
<asset id="os_{$host_id}_{position()}">
<ai:software>
<cpe>
<xsl:value-of select="detail[name = 'best_os_cpe']/value/text()"/>
</cpe>
</ai:software>
</asset>
</xsl:if>
</xsl:for-each>
</assets>
<reports>
<xsl:for-each select="host">
<xsl:call-template name="host-report">
<xsl:with-param name="ip" select="ip/text()"/>
</xsl:call-template>
</xsl:for-each>
</reports>
</asset-report-collection>
</xsl:template>
<xsl:template name="host-report">
<xsl:param name="ip"/>
<report id="{concat('report_', $ip)}">
<content>
<xsl:copy>
<xsl:for-each select="openvas:report()/results/result[host = $ip]">
<xsl:copy-of select="."/>
</xsl:for-each>
</xsl:copy>
</content>
</report>
</xsl:template>
<xsl:template match="/">
<xsl:choose>
<xsl:when test = "report/@extension = 'xml'">
<xsl:apply-templates select="report/report"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="report"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
|