I fixed the issues I was having -- here's a modified template file (the 
complete file), my changes noted in bold, and by >>>

The changes do the following:
Change 1: <xsl:if test = "(alert/level='INFO') or (alert/level='HOLE')">
        Only creates a row if the identified port has a HOLE or INFO level 
item associated with that port
Change 2: <xsl:if test = "(level='INFO') or (level='HOLE')">
        Prints only the HOLES and INFO level items associated with the 
host (no NOTES).


This allowed me to do very full/thorough/verbose scans, but generate 
reports with items needing remediation that were pretty clean and easier 
to read.

Hopefully someone finds it useful, and if you make any good tweaks, feel 
free to pass along

Thx,
Mike


<?xml version='1.0' encoding='utf-8' ?>
<!--Copyright 2003-2004(C) Tenable Network Security-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
<xsl:import href="report_lib.xsl"/>
<xsl:output method="html" indent="yes"/>

<xsl:template name="_report_summary">
        <xsl:for-each select="host">
                <tr>
                        <td width="100%" class="border">
                                <table width="100%" cellspacing="0" 
cellpadding="0">
                                        <tr>
                                                <td width="20%" 
height="100%">
                                                        <div 
class="report_host">
                                                                <a>
 <xsl:attribute name="href"><![CDATA[#]]><xsl:value-of 
select="@hostname"/></xsl:attribute>
 <img border="0" src="images/host.gif" align="absMiddle"></img>
 <xsl:value-of select="@hostname"/>
                                                                </a>
                                                        </div>
                                                </td>
                                                <td 
class="summary_text"><img  src="images/pixel.gif" width="20" 
align="absMiddle"/>
                                                        <xsl:value-of 
select="count(port)"/><![CDATA[ ]]>Open Ports,
                                                        <![CDATA[ 
]]><xsl:value-of 
select="count((port|general)/alert[level='NOTE'])"/><![CDATA[ ]]>Notes,
                                                        <![CDATA[ 
]]><xsl:value-of 
select="count((port|general)/alert[level='INFO'])"/><![CDATA[ ]]>Warnings,
                                                        <![CDATA[ 
]]><xsl:value-of 
select="count((port|general)/alert[level='HOLE'])"/><![CDATA[ ]]>Holes.
                                                </td>
                                        </tr>
                                </table>
                        </td>
                </tr>
                <tr><td height="5"></td></tr>
        </xsl:for-each>
</xsl:template>


<xsl:template match="results">
 
        <xsl:call-template name="report_html_head"/>
 
        <body>
                <table width="100%" cellspacing="0" cellpadding="0">
                        <tr>
                        <td align="center" colspan="2" width="100%">
                                <table width="90%" height="100%" 
cellspacing="0" align="center">
 
                                        <xsl:call-template 
name="report_header"/>
                                        <xsl:call-template 
name="report_time"/>
                                        <tr><td height="40"></td></tr>
                                        <xsl:call-template 
name="report_target"/>
                                        <xsl:call-template 
name="report_error"/>
                                        <xsl:call-template 
name="_report_summary"/>
                                        <tr><td height="40"></td></tr>
 
                                </table>
                        </td>
                        </tr>
                </table>
 
                <!--Main content-->
                <xsl:for-each select="host">

                        <table width="90%" align="center">

                                <xsl:call-template 
name="report_sub_header">
                                        <xsl:with-param name="mode" 
select="'view_by_host'"/>
                                </xsl:call-template>

                                <xsl:for-each select="port|general">
>>>                             <xsl:if test = "(alert/level='INFO') or 
(alert/level='HOLE')">
                                        <tr>
                                        <td width="100%">
                                        <table width="100%" 
cellspacing="0" cellpadding="0">
 
                                        <tr>
                                                <xsl:call-template 
name="report_showhostport">
                                                        <xsl:with-param 
name="showport2" select="'yes'"/>
                                                </xsl:call-template>
 
                                                <td 
class="left_open_border" height="100%">
                                                        <table 
width="100%" height="100%" cellspacing="0" cellpadding="0">
 <xsl:for-each select="alert">
                                                                <xsl:sort 
select="level" order="ascending"/>
>>>                                                             <xsl:if 
test = "(level='INFO') or (level='HOLE')">
 <tr><td><img src="images/pixel.gif" height="3"/></td></tr>
 <xsl:call-template name="report_showalert"/>
>>>                                                             </xsl:if>
 </xsl:for-each>
                                                        </table>
                                                </td>
                                        </tr>
 
                                        </table>
                                        </td>
                                        </tr>
                                        <tr><td height="5"></td></tr>
>>>                             </xsl:if>
                                </xsl:for-each>

                        </table>
 
                        <!--Space-->
                        <table width="100%"><tr><td align="right" 
height="40"></td></tr></table>

                </xsl:for-each> 
 
                <xsl:call-template name="report_footer"/> 
 
        </body>

</xsl:template>
 
</xsl:stylesheet>




_______________________________________________
Nessus mailing list
[email protected]
http://mail.nessus.org/mailman/listinfo/nessus

Reply via email to