home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 September / Chip_2004-09_cd1.bin / zkuste / system / download / secanal / MBSASetup-en.msi / Data.Cab / cmdOverviewReport.xsl < prev    next >
Extensible Markup Language  |  2004-01-16  |  6KB  |  201 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="Assessment">
  5.     <c score="1" text="Incomplete Scan"/>
  6.     <c score="2" text="Severe Risk"/>
  7.     <c score="3" text="Potential Risk"/>
  8.     <c score="4" text="Security FYIs"/>
  9.     <c score="5" text="Strong Security"/>
  10.     <c score="6" text="Check Not Performed"/>
  11.     <c score="7" text="Additional Information"/>
  12. </xsl:variable>
  13.  
  14. <xsl:variable name="CR" select="'
  15. '"/>
  16.     
  17. <xsl:variable name="FileName" select="'file name here'"></xsl:variable>
  18.     
  19. <xsl:template match="SecScan">
  20.     
  21. <xsl:param name="assess" select="@Grade"/>                    
  22. Computer name: <xsl:value-of select="@Domain"/>\<xsl:value-of select="@Machine"/>
  23. IP address: <xsl:value-of select="@IP"/>
  24. Security report name: <xsl:value-of select="$FileName" />
  25. <xsl:if test="@SUSServer and @SUSServer != ''">
  26. SUS Server: <xsl:value-of select="@SUSServer" />
  27. </xsl:if>
  28. Scan date: <xsl:value-of select="@Date"/>
  29. <xsl:choose><xsl:when test="@HotfixDataVersion">
  30. Security update database version: <xsl:value-of select="@HotfixDataVersion"/>
  31. <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>
  32. </xsl:when></xsl:choose>
  33. <xsl:for-each select="//Check[@DataVersionName and @DataVersion]">
  34. <xsl:value-of select="$CR"/>
  35. <xsl:value-of select="@DataVersionName"/><xsl:text> </xsl:text><xsl:value-of select="@DataVersion"/>
  36. </xsl:for-each>
  37. Security assessment: <xsl:value-of select="document('')/*/xsl:variable[@name='Assessment']/c[@score=$assess]/@text"/>
  38.  
  39. <xsl:choose>
  40. <xsl:when test="Check[@Type='5']">
  41.  
  42.   Security Updates Scan Results
  43.     <xsl:choose>
  44.     <xsl:when test="Check[@Type='5'][@Cat='1']">
  45.         <xsl:for-each select=".">
  46.             <xsl:apply-templates select="Check[@Type='5'][@Cat='1']">
  47.             </xsl:apply-templates>
  48.         </xsl:for-each>    
  49.     </xsl:when>
  50.     </xsl:choose>
  51. </xsl:when>
  52. </xsl:choose>
  53. <xsl:choose>
  54. <xsl:when test="Check[@Type='1']">
  55.  
  56.   Operating System Scan Results 
  57.     <xsl:choose>
  58.     <xsl:when test="Check[@Type='1'][@Cat='1']">
  59.     Vulnerabilities
  60.         <xsl:for-each select=".">
  61.             <xsl:apply-templates select="Check[@Type='1'][@Cat='1']">
  62.             </xsl:apply-templates>
  63.         </xsl:for-each>    
  64.     </xsl:when>
  65.     </xsl:choose>
  66.     <xsl:choose>
  67.     <xsl:when test="Check[@Type='1'][@Cat='2']">
  68.     Additional System Information
  69.         <xsl:for-each select=".">
  70.             <xsl:apply-templates select="Check[@Type='1'][@Cat='2']">
  71.             </xsl:apply-templates>
  72.         </xsl:for-each>
  73.     </xsl:when>
  74.     </xsl:choose>
  75. </xsl:when>
  76. </xsl:choose>
  77. <xsl:choose>
  78. <xsl:when test="Check[@Type='3']">
  79.  
  80.   Internet Information Services (IIS) Scan Results
  81.     <xsl:choose>
  82.         <xsl:when test="Check[@Type='3'][@Cat='4']">
  83.         <xsl:for-each select=".">
  84.             <xsl:value-of select="Check[@Type='3'][@Cat='4']/Advice" />
  85.         </xsl:for-each>
  86.     </xsl:when>
  87.     <xsl:when test="Check[@Type='3'][@Cat='1']">
  88.     Vulnerabilities
  89.         <xsl:for-each select=".">
  90.             <xsl:apply-templates select="Check[@Type='3'][@Cat='1']">    
  91.             </xsl:apply-templates>
  92.         </xsl:for-each>
  93.     </xsl:when>
  94.     </xsl:choose>
  95.     <xsl:choose>
  96.     <xsl:when test="Check[@Type='3'][@Cat='2']">
  97.     Additional System Information
  98.         <xsl:for-each select=".">
  99.             <xsl:apply-templates select="Check[@Type='3'][@Cat='2']">
  100.             </xsl:apply-templates>
  101.         </xsl:for-each>
  102.     </xsl:when>
  103.     </xsl:choose>
  104. </xsl:when>
  105. </xsl:choose>
  106. <!-- One tag per SQL Instance, MBSA V1.1 and later -->
  107. <xsl:choose>
  108.     <xsl:when test="SQLInstance">
  109.  
  110.   SQL Server Scan Results<xsl:for-each select="."><xsl:apply-templates select="SQLInstance"/></xsl:for-each>
  111.     </xsl:when>
  112. </xsl:choose>
  113. <xsl:choose>
  114. <xsl:when test="Check[@Type='2']">
  115.  
  116.   SQL Server Scan Results
  117.     <xsl:choose>
  118.     <xsl:when test="Check[@Type='2'][@Cat='4']">
  119.         <xsl:for-each select=".">
  120.             <xsl:value-of select="Check[@Type='2'][@Cat='4']/Advice" />
  121.         </xsl:for-each>
  122.     </xsl:when>
  123.     <xsl:when test="Check[@Type='2'][@Cat='1']">
  124.     Vulnerabilities
  125.         <xsl:for-each select=".">
  126.             <xsl:apply-templates select="Check[@Type='2'][@Cat='1']">        
  127.             </xsl:apply-templates>
  128.         </xsl:for-each>    
  129.     </xsl:when>
  130.     </xsl:choose>
  131.     <xsl:choose>
  132.     <xsl:when test="Check[@Type='2'][@Cat='2']">
  133.     Additional System Information
  134.         <xsl:for-each select=".">
  135.             <xsl:apply-templates select="Check[@Type='2'][@Cat='2']">    
  136.             </xsl:apply-templates>
  137.         </xsl:for-each>    
  138.     </xsl:when>
  139.     </xsl:choose>
  140. </xsl:when>
  141. </xsl:choose>
  142. <xsl:choose>
  143. <xsl:when test="Check[@Type='4']">
  144.  
  145.   Desktop Application Scan Results
  146.     <xsl:choose>
  147.     <xsl:when test="Check[@Type='4'][@Cat='1']">
  148.     Vulnerabilities
  149.         <xsl:for-each select=".">
  150.             <xsl:apply-templates select="Check[@Type='4'][@Cat='1']">
  151.             </xsl:apply-templates>
  152.         </xsl:for-each>
  153.     </xsl:when>
  154.     </xsl:choose>
  155.     <xsl:choose>
  156.     <xsl:when test="Check[@Type='4'][@Cat='2']">
  157.     Additional System Information
  158.         <xsl:for-each select=".">
  159.             <xsl:apply-templates select="Check[@Type='4'][@Cat='2']">
  160.             </xsl:apply-templates>
  161.         </xsl:for-each>
  162.     </xsl:when>
  163.     </xsl:choose>
  164. </xsl:when>
  165. </xsl:choose>
  166. </xsl:template>
  167.     
  168. <!-- SQL Instance section -->
  169. <xsl:template match="SQLInstance">
  170.  
  171.    Instance <xsl:value-of select="@Name"/>
  172.     <xsl:choose>
  173.     <xsl:when test="Check[@Type='2'][@Cat='1']">
  174.  
  175.     Vulnerabilities
  176.         <xsl:for-each select=".">
  177.             <xsl:apply-templates select="Check[@Type='2'][@Cat='1']">
  178.             </xsl:apply-templates>
  179.         </xsl:for-each>
  180.     </xsl:when>
  181.     </xsl:choose>
  182.     <xsl:choose>
  183.     <xsl:when test="Check[@Type='2'][@Cat='2']">
  184.  
  185.     Additional System Information
  186.         <xsl:for-each select=".">
  187.             <xsl:apply-templates select="Check[@Type='2'][@Cat='2']">
  188.             </xsl:apply-templates>
  189.         </xsl:for-each>
  190.     </xsl:when>
  191.     </xsl:choose>
  192. </xsl:template>
  193.  
  194. <xsl:template match="Check">
  195. <xsl:param name="score" select="@Grade"/>
  196.           Issue:  <xsl:value-of select="@Name"/>
  197.        Score:  <xsl:value-of select="document('')/*/xsl:variable[@name='Assessment']/c[@score=$score]/@text"/>
  198.        Result: <xsl:value-of select="Advice"/>
  199. </xsl:template>
  200. </xsl:stylesheet>
  201.