home *** CD-ROM | disk | FTP | other *** search
Wrap
<?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:variable name="Assessment"> <c score="1" text="Incomplete Scan"/> <c score="2" text="Severe Risk"/> <c score="3" text="Potential Risk"/> <c score="4" text="Security FYIs"/> <c score="5" text="Strong Security"/> <c score="6" text="Check Not Performed"/> <c score="7" text="Additional Information"/> </xsl:variable> <xsl:variable name="CR" select="' '"/> <xsl:variable name="FileName" select="'file name here'"></xsl:variable> <xsl:template match="SecScan"> <xsl:param name="assess" select="@Grade"/> Computer name: <xsl:value-of select="@Domain"/>\<xsl:value-of select="@Machine"/> IP address: <xsl:value-of select="@IP"/> Security report name: <xsl:value-of select="$FileName" /> <xsl:if test="@SUSServer and @SUSServer != ''"> SUS Server: <xsl:value-of select="@SUSServer" /> </xsl:if> Scan date: <xsl:value-of select="@Date"/> <xsl:choose><xsl:when test="@HotfixDataVersion"> Security update database version: <xsl:value-of select="@HotfixDataVersion"/> <xsl:if test="NewerVersions/@XmlVer"> ** New security updates are available; rescan to use security update database version <xsl:value-of select="NewerVersions/@XmlVer"/> **</xsl:if> </xsl:when></xsl:choose> <xsl:for-each select="//Check[@DataVersionName and @DataVersion]"> <xsl:value-of select="$CR"/> <xsl:value-of select="@DataVersionName"/><xsl:text> </xsl:text><xsl:value-of select="@DataVersion"/> </xsl:for-each> Security assessment: <xsl:value-of select="document('')/*/xsl:variable[@name='Assessment']/c[@score=$assess]/@text"/> <xsl:choose> <xsl:when test="Check[@Type='5']"> Security Updates Scan Results <xsl:choose> <xsl:when test="Check[@Type='5'][@Cat='1']"> <xsl:for-each select="."> <xsl:apply-templates select="Check[@Type='5'][@Cat='1']"> </xsl:apply-templates> </xsl:for-each> </xsl:when> </xsl:choose> </xsl:when> </xsl:choose> <xsl:choose> <xsl:when test="Check[@Type='1']"> Operating System Scan Results <xsl:choose> <xsl:when test="Check[@Type='1'][@Cat='1']"> Vulnerabilities <xsl:for-each select="."> <xsl:apply-templates select="Check[@Type='1'][@Cat='1']"> </xsl:apply-templates> </xsl:for-each> </xsl:when> </xsl:choose> <xsl:choose> <xsl:when test="Check[@Type='1'][@Cat='2']"> Additional System Information <xsl:for-each select="."> <xsl:apply-templates select="Check[@Type='1'][@Cat='2']"> </xsl:apply-templates> </xsl:for-each> </xsl:when> </xsl:choose> </xsl:when> </xsl:choose> <xsl:choose> <xsl:when test="Check[@Type='3']"> Internet Information Services (IIS) Scan Results <xsl:choose> <xsl:when test="Check[@Type='3'][@Cat='4']"> <xsl:for-each select="."> <xsl:value-of select="Check[@Type='3'][@Cat='4']/Advice" /> </xsl:for-each> </xsl:when> <xsl:when test="Check[@Type='3'][@Cat='1']"> Vulnerabilities <xsl:for-each select="."> <xsl:apply-templates select="Check[@Type='3'][@Cat='1']"> </xsl:apply-templates> </xsl:for-each> </xsl:when> </xsl:choose> <xsl:choose> <xsl:when test="Check[@Type='3'][@Cat='2']"> Additional System Information <xsl:for-each select="."> <xsl:apply-templates select="Check[@Type='3'][@Cat='2']"> </xsl:apply-templates> </xsl:for-each> </xsl:when> </xsl:choose> </xsl:when> </xsl:choose> <!-- One tag per SQL Instance, MBSA V1.1 and later --> <xsl:choose> <xsl:when test="SQLInstance"> SQL Server Scan Results<xsl:for-each select="."><xsl:apply-templates select="SQLInstance"/></xsl:for-each> </xsl:when> </xsl:choose> <xsl:choose> <xsl:when test="Check[@Type='2']"> SQL Server Scan Results <xsl:choose> <xsl:when test="Check[@Type='2'][@Cat='4']"> <xsl:for-each select="."> <xsl:value-of select="Check[@Type='2'][@Cat='4']/Advice" /> </xsl:for-each> </xsl:when> <xsl:when test="Check[@Type='2'][@Cat='1']"> Vulnerabilities <xsl:for-each select="."> <xsl:apply-templates select="Check[@Type='2'][@Cat='1']"> </xsl:apply-templates> </xsl:for-each> </xsl:when> </xsl:choose> <xsl:choose> <xsl:when test="Check[@Type='2'][@Cat='2']"> Additional System Information <xsl:for-each select="."> <xsl:apply-templates select="Check[@Type='2'][@Cat='2']"> </xsl:apply-templates> </xsl:for-each> </xsl:when> </xsl:choose> </xsl:when> </xsl:choose> <xsl:choose> <xsl:when test="Check[@Type='4']"> Desktop Application Scan Results <xsl:choose> <xsl:when test="Check[@Type='4'][@Cat='1']"> Vulnerabilities <xsl:for-each select="."> <xsl:apply-templates select="Check[@Type='4'][@Cat='1']"> </xsl:apply-templates> </xsl:for-each> </xsl:when> </xsl:choose> <xsl:choose> <xsl:when test="Check[@Type='4'][@Cat='2']"> Additional System Information <xsl:for-each select="."> <xsl:apply-templates select="Check[@Type='4'][@Cat='2']"> </xsl:apply-templates> </xsl:for-each> </xsl:when> </xsl:choose> </xsl:when> </xsl:choose> </xsl:template> <!-- SQL Instance section --> <xsl:template match="SQLInstance"> Instance <xsl:value-of select="@Name"/> <xsl:choose> <xsl:when test="Check[@Type='2'][@Cat='1']"> Vulnerabilities <xsl:for-each select="."> <xsl:apply-templates select="Check[@Type='2'][@Cat='1']"> </xsl:apply-templates> </xsl:for-each> </xsl:when> </xsl:choose> <xsl:choose> <xsl:when test="Check[@Type='2'][@Cat='2']"> Additional System Information <xsl:for-each select="."> <xsl:apply-templates select="Check[@Type='2'][@Cat='2']"> </xsl:apply-templates> </xsl:for-each> </xsl:when> </xsl:choose> </xsl:template> <xsl:template match="Check"> <xsl:param name="score" select="@Grade"/> Issue: <xsl:value-of select="@Name"/> Score: <xsl:value-of select="document('')/*/xsl:variable[@name='Assessment']/c[@score=$score]/@text"/> Result: <xsl:value-of select="Advice"/> </xsl:template> </xsl:stylesheet>