home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2006 June / PCpro_2006_06.ISO / files / mstools / MBaslineSASetup-EN.msi / Data.Cab / cmdOverviewReport.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2005-06-29  |  6.8 KB  |  219 lines

  1. <?xml version="1.0"?> 
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  3.  
  4. <xsl:variable name="ScoreLookup">
  5.     <c score="0" text="Check Not Performed"/>
  6.     <c score="1" text="Unable to scan"/>
  7.     <c score="2" text="Check failed (critical)"/>
  8.     <c score="3" text="Check failed (non-critical)"/>
  9.     <c score="4" text="Best practice"/>
  10.     <c score="5" text="Check passed"/>
  11.     <c score="6" text="Check not performed"/>
  12.     <c score="7" text="Additional information"/>
  13.     <c score="8" text="Not approved"/>
  14. </xsl:variable>
  15.     
  16. <xsl:variable name="Assessment">
  17.     <c score="1" text="Incomplete Scan"/>
  18.     <c score="2" text="Severe Risk"/>
  19.     <c score="3" text="Potential Risk"/>
  20.     <c score="4" text="Security FYIs"/>
  21.     <c score="5" text="Strong Security"/>
  22.     <c score="6" text="Check Not Performed"/>
  23.     <c score="7" text="Additional Information"/>
  24.     <c score="8" text="Security FYIs"/>
  25. </xsl:variable>
  26.  
  27. <xsl:variable name="CR" select="'
  28. '"/>
  29.  
  30. <xsl:variable name="FileName">FileNameHere</xsl:variable>
  31.  
  32. <xsl:template match="SecScan">
  33.  
  34. <xsl:param name="assess" select="@Grade"/>                    
  35. Computer name: <xsl:value-of select="@Domain"/>\<xsl:value-of select="@Machine"/>
  36. IP address: <xsl:value-of select="@IP"/>
  37. Security report name: <xsl:value-of select="$FileName" />
  38. <xsl:if test="@SUSServer and @SUSServer != ''">
  39. Update Services server: <xsl:value-of select="@SUSServer" />
  40. </xsl:if>
  41. Scan date: <xsl:value-of select="@LDate"/>
  42. Scanned with MBSA version: <xsl:value-of select="@MbsaToolVersion"/><xsl:if test="NewerVersions/@MbsaVer">  ** Newer version <xsl:value-of select="NewerVersions/@MbsaVer"/> is available **</xsl:if>
  43. <xsl:choose><xsl:when test="@HotfixDataVersion">
  44. Catalog synchronization date: <xsl:value-of select="@HotfixDataVersion"/>
  45. <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>
  46. </xsl:when></xsl:choose>
  47. <xsl:if test="@WUSSource and @WUSSource != ''">
  48. Security update catalog: <xsl:value-of select="@WUSSource" />
  49. </xsl:if>
  50. <xsl:for-each select="//Check[@DataVersionName and @DataVersion]">
  51. <xsl:value-of select="$CR"/>
  52. <xsl:value-of select="@DataVersionName"/><xsl:text> </xsl:text><xsl:value-of select="@DataVersion"/>
  53. </xsl:for-each>
  54. Security assessment: <xsl:value-of select="document('')/*/xsl:variable[@name='Assessment']/c[@score=$assess]/@text"/>
  55.  
  56. <xsl:choose>
  57. <xsl:when test="Check[@Type='5']">
  58.  
  59.   Security Updates Scan Results
  60.     <xsl:choose>
  61.     <xsl:when test="Check[@Type='5'][@Cat='1']">
  62.         <xsl:for-each select=".">
  63.             <xsl:apply-templates select="Check[@Type='5'][@Cat='1']">
  64.             </xsl:apply-templates>
  65.         </xsl:for-each>    
  66.     </xsl:when>
  67.     </xsl:choose>
  68. </xsl:when>
  69. </xsl:choose>
  70. <xsl:choose>
  71. <xsl:when test="Check[@Type='1']">
  72.  
  73.   Operating System Scan Results 
  74.     <xsl:choose>
  75.     <xsl:when test="Check[@Type='1'][@Cat='1']">
  76.     Administrative Vulnerabilities
  77.         <xsl:for-each select=".">
  78.             <xsl:apply-templates select="Check[@Type='1'][@Cat='1']">
  79.             </xsl:apply-templates>
  80.         </xsl:for-each>    
  81.     </xsl:when>
  82.     </xsl:choose>
  83.     <xsl:choose>
  84.     <xsl:when test="Check[@Type='1'][@Cat='2']">
  85.     Additional System Information
  86.         <xsl:for-each select=".">
  87.             <xsl:apply-templates select="Check[@Type='1'][@Cat='2']">
  88.             </xsl:apply-templates>
  89.         </xsl:for-each>
  90.     </xsl:when>
  91.     </xsl:choose>
  92. </xsl:when>
  93. </xsl:choose>
  94. <xsl:choose>
  95. <xsl:when test="Check[@Type='3']">
  96.  
  97.   Internet Information Services (IIS) Scan Results
  98.     <xsl:choose>
  99.         <xsl:when test="Check[@Type='3'][@Cat='4']">
  100.         <xsl:for-each select=".">
  101.             <xsl:value-of select="Check[@Type='3'][@Cat='4']/Advice" />
  102.         </xsl:for-each>
  103.     </xsl:when>
  104.     <xsl:when test="Check[@Type='3'][@Cat='1']">
  105.     Administrative Vulnerabilities
  106.         <xsl:for-each select=".">
  107.             <xsl:apply-templates select="Check[@Type='3'][@Cat='1']">    
  108.             </xsl:apply-templates>
  109.         </xsl:for-each>
  110.     </xsl:when>
  111.     </xsl:choose>
  112.     <xsl:choose>
  113.     <xsl:when test="Check[@Type='3'][@Cat='2']">
  114.     Additional System Information
  115.         <xsl:for-each select=".">
  116.             <xsl:apply-templates select="Check[@Type='3'][@Cat='2']">
  117.             </xsl:apply-templates>
  118.         </xsl:for-each>
  119.     </xsl:when>
  120.     </xsl:choose>
  121. </xsl:when>
  122. </xsl:choose>
  123. <!-- One tag per SQL Instance, MBSA V1.1 and later -->
  124. <xsl:choose>
  125.     <xsl:when test="SQLInstance">
  126.  
  127.   SQL Server Scan Results<xsl:for-each select="."><xsl:apply-templates select="SQLInstance"/></xsl:for-each>
  128.     </xsl:when>
  129. </xsl:choose>
  130. <xsl:choose>
  131. <xsl:when test="Check[@Type='2']">
  132.  
  133.   SQL Server Scan Results
  134.     <xsl:choose>
  135.     <xsl:when test="Check[@Type='2'][@Cat='4']">
  136.         <xsl:for-each select=".">
  137.             <xsl:value-of select="Check[@Type='2'][@Cat='4']/Advice" />
  138.         </xsl:for-each>
  139.     </xsl:when>
  140.     <xsl:when test="Check[@Type='2'][@Cat='1']">
  141.     Administrative Vulnerabilities
  142.         <xsl:for-each select=".">
  143.             <xsl:apply-templates select="Check[@Type='2'][@Cat='1']">        
  144.             </xsl:apply-templates>
  145.         </xsl:for-each>    
  146.     </xsl:when>
  147.     </xsl:choose>
  148.     <xsl:choose>
  149.     <xsl:when test="Check[@Type='2'][@Cat='2']">
  150.     Additional System Information
  151.         <xsl:for-each select=".">
  152.             <xsl:apply-templates select="Check[@Type='2'][@Cat='2']">    
  153.             </xsl:apply-templates>
  154.         </xsl:for-each>    
  155.     </xsl:when>
  156.     </xsl:choose>
  157. </xsl:when>
  158. </xsl:choose>
  159. <xsl:choose>
  160. <xsl:when test="Check[@Type='4']">
  161.  
  162.   Desktop Application Scan Results
  163.     <xsl:choose>
  164.     <xsl:when test="Check[@Type='4'][@Cat='1']">
  165.     Administrative Vulnerabilities
  166.         <xsl:for-each select=".">
  167.             <xsl:apply-templates select="Check[@Type='4'][@Cat='1']">
  168.             </xsl:apply-templates>
  169.         </xsl:for-each>
  170.     </xsl:when>
  171.     </xsl:choose>
  172.     <xsl:choose>
  173.     <xsl:when test="Check[@Type='4'][@Cat='2']">
  174.     Additional System Information
  175.         <xsl:for-each select=".">
  176.             <xsl:apply-templates select="Check[@Type='4'][@Cat='2']">
  177.             </xsl:apply-templates>
  178.         </xsl:for-each>
  179.     </xsl:when>
  180.     </xsl:choose>
  181. </xsl:when>
  182. </xsl:choose>
  183. <xsl:value-of select="$CR"/>
  184. </xsl:template>
  185.     
  186. <!-- SQL Instance section -->
  187. <xsl:template match="SQLInstance">
  188.  
  189.    Instance <xsl:value-of select="@Name"/>
  190.     <xsl:choose>
  191.     <xsl:when test="Check[@Type='2'][@Cat='1']">
  192.  
  193.     Administrative Vulnerabilities
  194.         <xsl:for-each select=".">
  195.             <xsl:apply-templates select="Check[@Type='2'][@Cat='1']">
  196.             </xsl:apply-templates>
  197.         </xsl:for-each>
  198.     </xsl:when>
  199.     </xsl:choose>
  200.     <xsl:choose>
  201.     <xsl:when test="Check[@Type='2'][@Cat='2']">
  202.  
  203.     Additional System Information
  204.         <xsl:for-each select=".">
  205.             <xsl:apply-templates select="Check[@Type='2'][@Cat='2']">
  206.             </xsl:apply-templates>
  207.         </xsl:for-each>
  208.     </xsl:when>
  209.     </xsl:choose>
  210. </xsl:template>
  211.  
  212. <xsl:template match="Check">
  213. <xsl:param name="score" select="@Grade"/>
  214.           Issue:  <xsl:value-of select="@Name"/>
  215.        Score:  <xsl:value-of select="document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=$score]/@text"/>
  216.        Result: <xsl:value-of select="Advice"/>
  217. </xsl:template>
  218. </xsl:stylesheet>
  219.