home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2004 September
/
Chip_2004-09_cd1.bin
/
zkuste
/
system
/
download
/
secanal
/
MBSASetup-en.msi
/
Data.Cab
/
copyreport.xsl
< prev
next >
Wrap
Extensible Markup Language
|
2004-01-16
|
19KB
|
528 lines
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:variable name="ScoreLookup">
<c score="0" url="Graphics/dash.gif" alttext="Check Not Performed"/>
<c score="1" url="Graphics/excl_red.gif" alttext="Unable to scan"/>
<c score="2" url="Graphics/x_red.gif" alttext="Check failed (critical)"/>
<c score="3" url="Graphics/x_gold.gif" alttext="Check failed (non-critical)"/>
<c score="4" url="Graphics/astrx.gif" alttext="Best practice"/>
<c score="5" url="Graphics/chek_grn.gif" alttext="Check passed"/>
<c score="6" url="Graphics/dash.gif" alttext="Check not performed"/>
<c score="7" url="Graphics/info.gif" alttext="Additional information"/>
</xsl:variable>
<xsl:variable name="Assessment">
<c score="1" text="Incomplete Scan" longtext="Could not complete one or more requested checks."/>
<c score="2" text="Severe Risk" longtext="One or more critical checks failed."/>
<c score="3" text="Potential Risk" longtext="One or more non-critical checks failed."/>
<c score="4" text="Security FYIs" longtext=""/>
<c score="5" text="Strong Security" longtext="All checks were passed."/>
</xsl:variable>
<xsl:variable name="FileName">FileNameHere</xsl:variable>
<xsl:template match="SecScan">
<xsl:param name="assess" select="@Grade"/>
<head>
<link REL="stylesheet" type="text/css" href="css/scanner.css" />
</head>
<table>
<tr>
<td class="reportsubheader" width="140"><b>Computer name:</b></td>
<td>
<xsl:choose>
<xsl:when test="@DisplayName">
<xsl:value-of select="@DisplayName"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@Domain"/>\<xsl:value-of select="@Machine"/>
</xsl:otherwise>
</xsl:choose>
</td>
</tr>
<tr>
<td class="reportsubheader" width="140"><b>IP address:</b></td>
<td><xsl:value-of select="@IP"/></td>
</tr>
<tr>
<td class="reportsubheader" width="140"><b>Security report name:</b></td>
<td><xsl:value-of select="$FileName" /></td>
</tr>
<xsl:if test="@SUSServer and @SUSServer != ''">
<tr>
<td class="reportsubheader" width="140"><b>SUS Server:</b></td>
<td><xsl:value-of select="@SUSServer" /></td>
</tr>
</xsl:if>
<tr>
<td class="reportsubheader" width="140"><b>Scan date:</b></td>
<xsl:choose>
<xsl:when test="@LDate">
<td><xsl:value-of select="@LDate"/></td>
</xsl:when>
<xsl:otherwise>
<td><xsl:value-of select="@Date"/></td>
</xsl:otherwise>
</xsl:choose>
</tr>
<xsl:choose>
<xsl:when test="@HotfixDataVersion">
<tr>
<td class="reportsubheader" width="140"><b>Security update database version:</b></td>
<td><xsl:value-of select="@HotfixDataVersion"/>
</td>
</tr>
</xsl:when>
</xsl:choose>
<xsl:for-each select="//Check[@DataVersionName and @DataVersion]">
<tr>
<td class="reportsubheader" width="140"><b><xsl:value-of select="@DataVersionName"/></b></td>
<td><xsl:value-of select="@DataVersion"/></td>
</tr>
</xsl:for-each>
<tr>
<td class="reportsubheader" width="140"><b>Security assessment:</b></td>
<td><xsl:value-of select="document('')/*/xsl:variable[@name='Assessment']/c[@score=$assess]/@text"/><xsl:text> </xsl:text>(<xsl:value-of select="document('')/*/xsl:variable[@name='Assessment']/c[@score=$assess]/@longtext"/>)</td>
</tr>
</table>
<xsl:choose>
<xsl:when test="Check[@Type='5']">
<br />
<div class="reportheader"><b>Security Updates</b></div>
<xsl:choose>
<xsl:when test="Check[@Type='5'][@Cat='1']">
<br />
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr class="ReportListHeader">
<td style="width:40" align="center"><nobr> Score </nobr></td>
<td style="width:80" align="left"><nobr>Issue</nobr></td>
<td><nobr>Result</nobr></td>
</tr>
<xsl:for-each select=".">
<xsl:apply-templates select="Check[@Type='5'][@Cat='1']">
<xsl:sort order="sortorder" select="sortfield"/>
<xsl:sort select="@Rank"/>
</xsl:apply-templates>
</xsl:for-each>
</table>
</xsl:when>
</xsl:choose>
</xsl:when>
</xsl:choose>
<xsl:choose>
<xsl:when test="Check[@Type='1']">
<br />
<div class="reportheader"><b>Windows Scan Results</b></div>
<xsl:choose>
<xsl:when test="Check[@Type='1'][@Cat='1']">
<br />
<div class="reportsubheader" style="MARGIN-LEFT: 5px;"><b>Vulnerabilities</b></div>
<br />
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr class="ReportListHeader">
<td style="width:40" align="center"><nobr> Score </nobr></td>
<td style="width:80" align="left"><nobr>Issue</nobr></td>
<td><nobr>Result</nobr></td>
</tr>
<xsl:for-each select=".">
<xsl:apply-templates select="Check[@Type='1'][@Cat='1']">
<xsl:sort order="sortorder" select="sortfield"/>
<xsl:sort select="@Rank"/>
</xsl:apply-templates>
</xsl:for-each>
</table>
</xsl:when>
</xsl:choose>
<xsl:choose>
<xsl:when test="Check[@Type='1'][@Cat='2']">
<br />
<div class="reportsubheader" style="MARGIN-LEFT: 5px;"><b>Additional System Information</b></div>
<br />
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr class="ReportListHeader">
<td style="width:40" align="center"><nobr> Score </nobr></td>
<td style="width:80" align="left"><nobr>Issue</nobr></td>
<td><nobr>Result</nobr></td>
</tr>
<xsl:for-each select=".">
<xsl:apply-templates select="Check[@Type='1'][@Cat='2']">
<xsl:sort order="sortorder" select="sortfield"/>
<xsl:sort select="@Rank"/>
</xsl:apply-templates>
</xsl:for-each>
</table>
</xsl:when>
</xsl:choose>
</xsl:when>
</xsl:choose>
<xsl:choose>
<xsl:when test="Check[@Type='3']">
<br />
<div class="reportheader"><b>Internet Information Services (IIS) Scan Results</b></div>
<xsl:choose>
<xsl:when test="Check[@Type='3'][@Cat='1']">
<br />
<div class="reportsubheader" style="MARGIN-LEFT: 5px;"><b>Vulnerabilities</b></div>
<br />
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr class="ReportListHeader">
<td style="width:40" align="center"><nobr> Score </nobr></td>
<td style="width:80" align="left"><nobr>Issue</nobr></td>
<td><nobr>Result</nobr></td>
</tr>
<xsl:for-each select=".">
<xsl:apply-templates select="Check[@Type='3'][@Cat='1']">
<xsl:sort order="sortorder" select="sortfield"/>
<xsl:sort select="@Rank"/>
</xsl:apply-templates>
</xsl:for-each>
</table>
</xsl:when>
</xsl:choose>
<xsl:choose>
<xsl:when test="Check[@Type='3'][@Cat='2']">
<br />
<div class="reportsubheader" style="MARGIN-LEFT: 5px;"><b>Additional System Information</b></div>
<br />
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr class="ReportListHeader">
<td style="width:40" align="center"><nobr> Score </nobr></td>
<td style="width:80" align="left"><nobr>Issue</nobr></td>
<td><nobr>Result</nobr></td>
</tr>
<xsl:for-each select=".">
<xsl:apply-templates select="Check[@Type='3'][@Cat='2']">
<xsl:sort order="sortorder" select="sortfield"/>
<xsl:sort select="@Rank"/>
</xsl:apply-templates>
</xsl:for-each>
</table>
</xsl:when>
</xsl:choose>
<xsl:choose>
<xsl:when test="Check[@Type='3'][@Cat='4']">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr class="ReportListHeader">
<td style="width:40" align="center"><nobr> Score </nobr></td>
<td style="width:80" align="left"><nobr>Issue</nobr></td>
<td><nobr>Result</nobr></td>
</tr>
<xsl:for-each select=".">
<xsl:apply-templates select="Check[@Type='3'][@Cat='4']">
<xsl:sort order="sortorder" select="sortfield"/>
<xsl:sort select="@Rank"/>
</xsl:apply-templates>
</xsl:for-each>
</table>
</xsl:when>
</xsl:choose>
</xsl:when>
</xsl:choose>
<!-- One tag per SQL Instance, MBSA V1.1 and later -->
<xsl:choose>
<xsl:when test="SQLInstance">
<xsl:for-each select=".">
<xsl:apply-templates select="SQLInstance"/>
</xsl:for-each>
</xsl:when>
</xsl:choose>
<xsl:choose>
<xsl:when test="Check[@Type='2']">
<br />
<div class="reportheader"><b>SQL Server Scan Results</b></div>
<xsl:choose>
<xsl:when test="Check[@Type='2'][@Cat='1']">
<br />
<div class="reportsubheader" style="MARGIN-LEFT: 5px;"><b>Vulnerabilities</b></div>
<br />
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr class="ReportListHeader">
<td style="width:40" align="center"><nobr> Score </nobr></td>
<td style="width:80" align="left"><nobr>Issue</nobr></td>
<td><nobr>Result</nobr></td>
</tr>
<xsl:for-each select=".">
<xsl:apply-templates select="Check[@Type='2'][@Cat='1']">
<xsl:sort order="sortorder" select="sortfield"/>
<xsl:sort select="@Rank"/>
</xsl:apply-templates>
</xsl:for-each>
</table>
</xsl:when>
</xsl:choose>
<xsl:choose>
<xsl:when test="Check[@Type='2'][@Cat='2']">
<br />
<div class="reportsubheader" style="MARGIN-LEFT: 5px;"><b>Additional System Information</b></div>
<br />
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr class="ReportListHeader">
<td style="width:40" align="center"><nobr> Score </nobr></td>
<td style="width:80" align="left"><nobr>Issue</nobr></td>
<td><nobr>Result</nobr></td>
</tr>
<xsl:for-each select=".">
<xsl:apply-templates select="Check[@Type='2'][@Cat='2']">
<xsl:sort order="sortorder" select="sortfield"/>
<xsl:sort select="@Rank"/>
</xsl:apply-templates>
</xsl:for-each>
</table>
</xsl:when>
</xsl:choose>
<xsl:choose>
<xsl:when test="Check[@Type='2'][@Cat='4']">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr class="ReportListHeader">
<td style="width:40" align="center"><nobr> Score </nobr></td>
<td style="width:80" align="left"><nobr>Issue</nobr></td>
<td><nobr>Result</nobr></td>
</tr>
<xsl:for-each select=".">
<xsl:apply-templates select="Check[@Type='2'][@Cat='4']">
<xsl:sort order="sortorder" select="sortfield"/>
<xsl:sort select="@Rank"/>
</xsl:apply-templates>
</xsl:for-each>
</table>
</xsl:when>
</xsl:choose>
</xsl:when>
</xsl:choose>
<xsl:choose>
<xsl:when test="Check[@Type='4']">
<br />
<div class="reportheader"><b>Desktop Application Scan Results</b></div>
<xsl:choose>
<xsl:when test="Check[@Type='4'][@Cat='1']">
<br />
<div class="reportsubheader" style="MARGIN-LEFT: 5px;"><b>Vulnerabilities</b></div>
<br />
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr class="ReportListHeader">
<td style="width:40" align="center"><nobr> Score </nobr></td>
<td style="width:80" align="left"><nobr>Issue</nobr></td>
<td><nobr>Result</nobr></td>
</tr>
<xsl:for-each select=".">
<xsl:apply-templates select="Check[@Type='4'][@Cat='1']">
<xsl:sort order="sortorder" select="sortfield"/>
<xsl:sort select="@Rank"/>
</xsl:apply-templates>
</xsl:for-each>
</table>
</xsl:when>
</xsl:choose>
<xsl:choose>
<xsl:when test="Check[@Type='4'][@Cat='2']">
<br />
<div class="reportsubheader" style="MARGIN-LEFT: 5px;"><b>Additional System Information</b></div>
<br />
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr class="ReportListHeader">
<td style="width:40" align="center"><nobr> Score </nobr></td>
<td style="width:80" align="left"><nobr>Issue</nobr></td>
<td><nobr>Result</nobr></td>
</tr>
<xsl:for-each select=".">
<xsl:apply-templates select="Check[@Type='4'][@Cat='2']">
<xsl:sort order="sortorder" select="sortfield"/>
<xsl:sort select="@Rank"/>
</xsl:apply-templates>
</xsl:for-each>
</table>
</xsl:when>
</xsl:choose>
</xsl:when>
</xsl:choose>
<!--EndFragment -->
</xsl:template>
<xsl:template match="Check">
<xsl:param name="score" select="@Grade"/>
<xsl:variable name="bgcolor">
<xsl:choose>
<xsl:when test="(position() mod 2) = 1">#8caae6</xsl:when>
<xsl:otherwise>#CECFF6</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<tr bgcolor="{$bgcolor}">
<td align="center" valign="top">
<xsl:choose>
<xsl:when test="@Cat='2'">
<xsl:choose>
<xsl:when test="@ID='121'">
<xsl:value-of select="document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=7]/@alttext"/>
</xsl:when>
<xsl:when test="@ID='10121'">
<xsl:value-of select="document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=7]/@alttext"/>
</xsl:when>
<xsl:when test="@ID='101'">
<xsl:value-of select="document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=7]/@alttext"/>
</xsl:when>
<xsl:when test="@ID='10101'">
<xsl:value-of select="document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=7]/@alttext"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=4]/@alttext"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=$score]/@alttext" />
</xsl:otherwise>
</xsl:choose>
</td>
<td style="WIDTH:75" align="left" valign="top"><xsl:value-of select="@Name"/></td>
<td>
<TABLE width="100%">
<TR>
<TD align="left" colspan="3"><xsl:value-of select="Advice"/></TD>
</TR>
<xsl:choose>
<xsl:when test="Detail">
<TR>
<TD>
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="padding-left: 10px; padding-right: 10px;">
<tr class="ReportListHeader">
<xsl:for-each select="Detail/Head/Col">
<td Nowrap="true">
<B><xsl:value-of select="."/></B>
</td>
</xsl:for-each>
</tr>
<xsl:for-each select="Detail">
<xsl:apply-templates select="Row">
</xsl:apply-templates>
</xsl:for-each>
</table>
</TD>
</TR>
</xsl:when>
</xsl:choose>
</TABLE>
</td>
</tr>
</xsl:template>
<xsl:template match="Row">
<xsl:param name="score" select="@Grade"/>
<tr>
<xsl:for-each select="Col">
<td valign="top">
<xsl:choose>
<xsl:when test="@URL and @URL != '' and @URL != ' '">
<A href="{@URL}"><xsl:value-of select="."/></A>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="."/>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="@REQUIREDNAME">
<br/><font size="-1">This update requires
<xsl:value-of select="@REQUIREDNAME"/>
to be installed first.</font>
</xsl:if>
</td>
</xsl:for-each>
</tr>
<xsl:apply-templates select="SETTINGS">
</xsl:apply-templates>
</xsl:template>
<xsl:template match="SETTINGS">
<xsl:param name="numCols" select="count(Head/Col)"/>
<tr>
<td colspan="4">
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="padding-left: 10px; padding-right: 10px;">
<tr class="ReportListHeader">
<xsl:for-each select="Head/Col">
<td Nowrap="true">
<B><xsl:value-of select="."/></B>
</td>
</xsl:for-each>
</tr>
<xsl:apply-templates select="Row">
</xsl:apply-templates>
</table>
</td>
</tr>
</xsl:template>
<!-- SQL Instance section -->
<xsl:template match="SQLInstance">
<br />
<div class="reportheader"><b>SQL Server Scan Results: Instance <xsl:value-of select="@Name"/></b></div>
<xsl:choose>
<xsl:when test="Check[@Type='2'][@Cat='1']">
<br />
<div class="reportsubheader" style="MARGIN-LEFT: 5px;"><b>Vulnerabilities</b></div>
<br />
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr class="ReportListHeader">
<td style="width:40" align="center"><nobr> Score </nobr></td>
<td style="width:80" align="left"><nobr>Issue</nobr></td>
<td><nobr>Result</nobr></td>
</tr>
<xsl:for-each select=".">
<xsl:apply-templates select="Check[@Type='2'][@Cat='1']">
<xsl:sort order="sortorder" select="sortfield"/>
<xsl:sort select="@Rank"/>
</xsl:apply-templates>
</xsl:for-each>
</table>
</xsl:when>
</xsl:choose>
<xsl:choose>
<xsl:when test="Check[@Type='2'][@Cat='2']">
<br />
<div class="reportsubheader" style="MARGIN-LEFT: 5px;"><b>Additional System Information</b></div>
<br />
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr class="ReportListHeader">
<td style="width:40" align="center"><nobr> Score </nobr></td>
<td style="width:80" align="left"><nobr>Issue</nobr></td>
<td><nobr>Result</nobr></td>
</tr>
<xsl:for-each select=".">
<xsl:apply-templates select="Check[@Type='2'][@Cat='2']">
<xsl:sort order="sortorder" select="sortfield"/>
<xsl:sort select="@Rank"/>
</xsl:apply-templates>
</xsl:for-each>
</table>
</xsl:when>
</xsl:choose>
<xsl:choose>
<xsl:when test="Check[@Type='2'][@Cat='4']">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr class="ReportListHeader">
<td style="width:40" align="center"><nobr> Score </nobr></td>
<td style="width:80" align="left"><nobr>Issue</nobr></td>
<td><nobr>Result</nobr></td>
</tr>
<xsl:for-each select=".">
<xsl:apply-templates select="Check[@Type='2'][@Cat='4']">
<xsl:sort order="sortorder" select="sortfield"/>
<xsl:sort select="@Rank"/>
</xsl:apply-templates>
</xsl:for-each>
</table>
</xsl:when>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>