Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

299 lines
11 KiB

  1. <?xml version="1.0" encoding="iso-8859-1"?>
  2. <!-- simple xslt file: scexml.xsl -->
  3. <xsl:stylesheet
  4. version="1.0"
  5. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  6. xmlns:msxsl="urn:schemas-microsoft-com:xslt"
  7. xmlns:scexml="http://microsoft.com/sce/scexml"
  8. >
  9. <xsl:output method="html" indent="no"/>
  10. <msxsl:script language="JScript" implements-prefix="scexml">
  11. function AttribValue(NodeList, AttriName)
  12. {
  13. var Node = NodeList.nextNode();
  14. return Node.attributes.getNamedItem(AttriName).text;
  15. }
  16. function OpenWindowWithHtml(contents)
  17. {
  18. window.open("Sample.htm",null,"height=200,width=400,status=yes,toolbar=no,menubar=no,location=no");
  19. }
  20. </msxsl:script>
  21. <xsl:template match="/SCEAnalysisData">
  22. <html>
  23. <xsl:text disable-output-escaping="yes">
  24. <![CDATA[
  25. <script>
  26. function OpenDetailsWindow(name, system, baseline)
  27. {
  28. var TmpWindow=window.open(null,target="_blank","height=400,width=640,status=no,toolbar=no,menubar=no,location=no,resizable=yes");
  29. TmpWindow.document.write('<body bgcolor="#EEEEEE">');
  30. TmpWindow.document.write('<table width="90%" frame="border" bgcolor="#DDDDDD">');
  31. TmpWindow.document.write('<tr><td width="20%">Setting</td><td>');
  32. TmpWindow.document.write(name);
  33. TmpWindow.document.write('</td></tr>');
  34. TmpWindow.document.write('<tr><td width="20%">System</td><td>');
  35. TmpWindow.document.write(system);
  36. TmpWindow.document.write('</td></tr>');
  37. TmpWindow.document.write('<tr><td>Baseline</td><td>');
  38. TmpWindow.document.write(baseline);
  39. TmpWindow.document.write('</td></tr></Table>');
  40. TmpWindow.document.write('</body>');
  41. }
  42. </script>
  43. <STYLE TYPE="text/css">
  44. <!--
  45. A.nav:link { color: #000000 }
  46. A.nav:visited { color: #000000 }
  47. //-->
  48. </STYLE>
  49. ]]>
  50. </xsl:text>
  51. <title>SCE Analysis Results</title>
  52. <h2>SCE Analysis Results</h2>
  53. <body bgcolor="#EEEEEE">
  54. <TABLE width="90%" frame="border" bgcolor="#DDDDDD">
  55. <TR bgcolor="#AAAAAA">
  56. <th>Description</th>
  57. </TR>
  58. <tr>
  59. <td>Machine Name</td><td><xsl:value-of select="Description/MachineName"/></td>
  60. </tr>
  61. <tr>
  62. <td>Profile Description</td><td><xsl:value-of select="Description/ProfileDescription"/></td>
  63. </tr>
  64. <tr>
  65. <td>Analysis Timestamp</td><td><xsl:value-of select="Description/AnalysisTimestamp"/></td>
  66. </tr>
  67. </TABLE>
  68. <xsl:apply-templates select="SystemAccess"/>
  69. <xsl:apply-templates select="SystemAudit"/>
  70. <xsl:apply-templates select="RegistryValues"/>
  71. <xsl:apply-templates select="ServiceSecurity"/>
  72. <xsl:apply-templates select="GroupMembership"/>
  73. <xsl:apply-templates select="PrivilegeRights"/>
  74. <xsl:apply-templates select="FileSecurity"/>
  75. <xsl:apply-templates select="RegistrySecurity"/>
  76. </body>
  77. </html>
  78. </xsl:template>
  79. <xsl:template match="SystemAccess">
  80. <h3><font face="Arial">Area: System Access</font></h3>
  81. <TABLE width="90%" frame="border" bgcolor="#DDDDDD">
  82. <TR bgcolor="#AAAAAA">
  83. <th>Setting</th><th width="20%">Status</th>
  84. </TR>
  85. <xsl:for-each select="Setting">
  86. <TR>
  87. <TD><xsl:value-of select="Description"/></TD>
  88. <td><xsl:apply-templates select="AnalysisResult"/></td>
  89. </TR>
  90. </xsl:for-each>
  91. </TABLE>
  92. <p/>
  93. </xsl:template>
  94. <xsl:template match="SystemAudit">
  95. <h3><font face="Arial">Area: System Audit</font></h3>
  96. <TABLE width="90%" frame="border" bgcolor="#DDDDDD">
  97. <TR bgcolor="#AAAAAA">
  98. <th>Setting</th><th width="20%">Status</th>
  99. </TR>
  100. <xsl:for-each select="Setting">
  101. <TR>
  102. <TD><xsl:value-of select="Description"/></TD>
  103. <td>
  104. <xsl:apply-templates select="AnalysisResult"/>
  105. </td>
  106. </TR>
  107. </xsl:for-each>
  108. </TABLE>
  109. <p/>
  110. </xsl:template>
  111. <xsl:template match="RegistryValues">
  112. <h3><font face="Arial">Area: Registry Values</font></h3>
  113. <TABLE width="90%" frame="border" bgcolor="#DDDDDD">
  114. <TR bgcolor="#AAAAAA">
  115. <th>Setting</th><th width="20%">Status</th>
  116. </TR>
  117. <xsl:for-each select="Setting">
  118. <TR>
  119. <TD><xsl:value-of select="Description"/></TD>
  120. <td><xsl:apply-templates select="AnalysisResult"/></td>
  121. </TR>
  122. </xsl:for-each>
  123. </TABLE>
  124. <p/>
  125. </xsl:template>
  126. <xsl:template match="ServiceSecurity">
  127. <h3><font face="Arial">Area: Service Security</font></h3>
  128. <TABLE width="90%" frame="border" bgcolor="#DDDDDD">
  129. <TR bgcolor="#AAAAAA">
  130. <th>Setting</th><th width="20%">Status</th>
  131. </TR>
  132. <xsl:for-each select="Setting">
  133. <TR>
  134. <TD><xsl:value-of select="Description"/></TD>
  135. <td><xsl:apply-templates select="AnalysisResult"/></td>
  136. </TR>
  137. </xsl:for-each>
  138. </TABLE>
  139. <p/>
  140. </xsl:template>
  141. <xsl:template match="GroupMembership">
  142. <h3><font face="Arial">Area: Group Membership</font></h3>
  143. <TABLE width="90%" frame="border" bgcolor="#DDDDDD">
  144. <TR bgcolor="#AAAAAA">
  145. <th>Setting</th><th width="20%">Status</th>
  146. </TR>
  147. <xsl:for-each select="Setting">
  148. <TR>
  149. <TD><xsl:value-of select="Description"/></TD>
  150. <td><xsl:apply-templates select="AnalysisResult"/></td>
  151. </TR>
  152. </xsl:for-each>
  153. </TABLE>
  154. <p/>
  155. </xsl:template>
  156. <xsl:template match="PrivilegeRights">
  157. <h3><font face="Arial">Area: Privilege Rights</font></h3>
  158. <TABLE width="90%" frame="border" bgcolor="#DDDDDD">
  159. <TR bgcolor="#AAAAAA">
  160. <th>Setting</th><th width="20%">Status</th>
  161. </TR>
  162. <xsl:for-each select="Setting">
  163. <TR>
  164. <TD><xsl:value-of select="Description"/></TD>
  165. <td><xsl:apply-templates select="AnalysisResult"/></td>
  166. </TR>
  167. </xsl:for-each>
  168. </TABLE>
  169. <p/>
  170. </xsl:template>
  171. <xsl:template match="FileSecurity">
  172. <h3><font face="Arial">Area: File Security</font></h3>
  173. <TABLE width="90%" frame="border" bgcolor="#DDDDDD">
  174. <TR bgcolor="#AAAAAA">
  175. <th>Setting</th><th width="20%">Status</th>
  176. </TR>
  177. <xsl:for-each select="Setting">
  178. <TR>
  179. <TD><xsl:value-of select="Description"/></TD>
  180. <td><xsl:apply-templates select="AnalysisResult"/></td>
  181. </TR>
  182. </xsl:for-each>
  183. </TABLE>
  184. <p/>
  185. </xsl:template>
  186. <xsl:template match="RegistrySecurity">
  187. <h3><font face="Arial">Area: Registry Security</font></h3>
  188. <TABLE width="90%" frame="border" bgcolor="#DDDDDD">
  189. <TR bgcolor="#AAAAAA">
  190. <th>Setting</th><th width="20%">Status</th>
  191. </TR>
  192. <xsl:for-each select="Setting">
  193. <TR>
  194. <TD><xsl:value-of select="Description"/></TD>
  195. <td><xsl:apply-templates select="AnalysisResult"/></td>
  196. </TR>
  197. </xsl:for-each>
  198. </TABLE>
  199. <p/>
  200. </xsl:template>
  201. <xsl:template match="AnalysisResult">
  202. <xsl:variable name="details">
  203. <xsl:if test="BaselineValue/@Type='SecurityDescriptor' ">
  204. <xsl:value-of select="BaselineValue"/>
  205. <xsl:value-of select="StartupType"/>
  206. <xsl:value-of select="SecurityDescriptor"/>
  207. </xsl:if>
  208. </xsl:variable>
  209. <xsl:variable name="baseline">
  210. <xsl:choose>
  211. <xsl:when test="BaselineValue/@Type='ServiceSetting' ">
  212. <xsl:value-of select="BaselineValue/StartupType"/>,
  213. <xsl:value-of select="BaselineValue/SecurityDescriptor"/>
  214. </xsl:when>
  215. <xsl:when test="BaselineValue/@Type='EventAudit' ">
  216. Audit Success: <xsl:value-of select="BaselineValue/Success"/>&lt;br/&gt;
  217. Audit Failure: <xsl:value-of select="BaselineValue/Failure"/>
  218. </xsl:when>
  219. <xsl:when test="BaselineValue/@Type='Accounts' ">
  220. <xsl:for-each select="BaselineValue/Account">
  221. Account:<xsl:value-of select="."/>&lt;br/&gt;
  222. </xsl:for-each>
  223. </xsl:when>
  224. <xsl:otherwise>
  225. <xsl:value-of select="BaselineValue"/>
  226. </xsl:otherwise>
  227. </xsl:choose>
  228. </xsl:variable>
  229. <xsl:variable name="system">
  230. <xsl:choose>
  231. <xsl:when test="SystemValue/@Type='ServiceSetting' ">
  232. <xsl:value-of select="SystemValue/StartupType"/>,
  233. <xsl:value-of select="SystemValue/SecurityDescriptor"/>
  234. </xsl:when>
  235. <xsl:when test="SystemValue/@Type='EventAudit' ">
  236. Audit Success: <xsl:value-of select="SystemValue/Success"/>&lt;br/&gt;
  237. Audit Failure: <xsl:value-of select="SystemValue/Failure"/>
  238. </xsl:when>
  239. <xsl:when test="SystemValue/@Type='Accounts' ">
  240. <xsl:for-each select="SystemValue/Account">
  241. Account:<xsl:value-of select="."/>&lt;br/&gt;
  242. </xsl:for-each>
  243. </xsl:when>
  244. <xsl:otherwise>
  245. <xsl:value-of select="SystemValue"/>
  246. </xsl:otherwise>
  247. </xsl:choose>
  248. </xsl:variable>
  249. <a class="nav">
  250. <xsl:attribute name="href">javascript:OpenDetailsWindow('<xsl:value-of select="../Description"/>', '<xsl:value-of select="$baseline"/>', '<xsl:value-of select="$system"/>');</xsl:attribute>
  251. <xsl:if test="Match='FALSE' ">
  252. <font color="red">
  253. <xsl:value-of select="Match"/>
  254. </font>
  255. </xsl:if>
  256. <xsl:if test="Match!='FALSE' ">
  257. <xsl:value-of select="Match"/>
  258. </xsl:if>
  259. </a>
  260. </xsl:template>
  261. </xsl:stylesheet>