| 1 |
<?xml version="1.0" encoding="utf-8" ?> |
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
<xsl:stylesheet version="1.1" |
| 27 |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
| 28 |
xmlns:cdf="http://checklists.nist.gov/xccdf/1.2" |
| 29 |
xmlns:ovalres="http://oval.mitre.org/XMLSchema/oval-results-5" |
| 30 |
xmlns:sceres="http://open-scap.org/page/SCE_result_file" |
| 31 |
xmlns:exsl="http://exslt.org/common" |
| 32 |
xmlns:arf="http://scap.nist.gov/schema/asset-reporting-format/1.1" |
| 33 |
exclude-result-prefixes="xsl cdf ovalres sceres exsl arf"> |
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
<xsl:key name="references" match="//cdf:reference" use="@href"/> |
| 40 |
|
| 41 |
<xsl:include href="xccdf-branding.xsl" /> |
| 42 |
<xsl:include href="xccdf-references.xsl" /> |
| 43 |
<xsl:include href="xccdf-resources.xsl" /> |
| 44 |
<xsl:include href="xccdf-share.xsl" /> |
| 45 |
|
| 46 |
<xsl:include href="xccdf-report-oval-details.xsl" /> |
| 47 |
|
| 48 |
<xsl:output |
| 49 |
method="html" |
| 50 |
encoding="utf-8" |
| 51 |
indent="no" |
| 52 |
omit-xml-declaration="yes"/> |
| 53 |
|
| 54 |
<xsl:template name="introduction"> |
| 55 |
<xsl:param name="benchmark"/> |
| 56 |
<xsl:param name="profile"/> |
| 57 |
|
| 58 |
<div id="introduction"> |
| 59 |
<div class="row"> |
| 60 |
<xsl:call-template name="show-title-front-matter-description-notices"> |
| 61 |
<xsl:with-param name="benchmark" select="$benchmark"/> |
| 62 |
<xsl:with-param name="profile" select="$profile"/> |
| 63 |
</xsl:call-template> |
| 64 |
</div> |
| 65 |
</div> |
| 66 |
</xsl:template> |
| 67 |
|
| 68 |
<xsl:template name="characteristics"> |
| 69 |
<xsl:param name="testresult"/> |
| 70 |
<xsl:param name="benchmark"/> |
| 71 |
<xsl:param name="profile"/> |
| 72 |
|
| 73 |
<div id="characteristics"> |
| 74 |
<h2>Evaluation Characteristics</h2> |
| 75 |
<div class="row"> |
| 76 |
<div class="col-md-5 well well-lg horizontal-scroll"> |
| 77 |
<table class="table table-bordered"> |
| 78 |
<tr> |
| 79 |
<th>Evaluation target</th> |
| 80 |
<td> |
| 81 |
<xsl:value-of select="$testresult/cdf:target/text()"/> |
| 82 |
</td> |
| 83 |
</tr> |
| 84 |
<xsl:if test="$testresult/cdf:target-facts/cdf:fact[@name = 'urn:xccdf:fact:identifier']"> |
| 85 |
<tr> |
| 86 |
<th>Target ID</th> |
| 87 |
<td><xsl:value-of select="$testresult/cdf:target-facts/cdf:fact[@name = 'urn:xccdf:fact:identifier']/text()"/></td> |
| 88 |
</tr> |
| 89 |
</xsl:if> |
| 90 |
<xsl:if test="$testresult/cdf:benchmark"> |
| 91 |
<tr> |
| 92 |
<th>Benchmark URL</th> |
| 93 |
<td><xsl:value-of select="$testresult/cdf:benchmark/@href"/></td> |
| 94 |
</tr> |
| 95 |
<xsl:if test="$testresult/cdf:benchmark/@id"> |
| 96 |
<tr> |
| 97 |
<th>Benchmark ID</th> |
| 98 |
<td><xsl:value-of select="$testresult/cdf:benchmark/@id"/></td> |
| 99 |
</tr> |
| 100 |
</xsl:if> |
| 101 |
</xsl:if> |
| 102 |
<xsl:if test="$benchmark/cdf:version"> |
| 103 |
<tr> |
| 104 |
<th>Benchmark version</th> |
| 105 |
<td><xsl:value-of select="$benchmark/cdf:version[1]/text()"/></td> |
| 106 |
</tr> |
| 107 |
</xsl:if> |
| 108 |
<xsl:if test="$testresult/cdf:profile"> |
| 109 |
<tr> |
| 110 |
<th>Profile ID</th> |
| 111 |
<td><xsl:value-of select="$testresult/cdf:profile/@idref"/></td> |
| 112 |
</tr> |
| 113 |
</xsl:if> |
| 114 |
<tr> |
| 115 |
<th>Started at</th> |
| 116 |
<td> |
| 117 |
<xsl:choose> |
| 118 |
<xsl:when test="$testresult/@start-time"> |
| 119 |
<xsl:value-of select="$testresult/@start-time"/> |
| 120 |
</xsl:when> |
| 121 |
<xsl:otherwise> |
| 122 |
unknown time |
| 123 |
</xsl:otherwise> |
| 124 |
</xsl:choose> |
| 125 |
</td> |
| 126 |
</tr> |
| 127 |
<tr> |
| 128 |
<th>Finished at</th> |
| 129 |
<td> |
| 130 |
<xsl:value-of select="$testresult/@end-time"/> |
| 131 |
</td> |
| 132 |
</tr> |
| 133 |
<tr> |
| 134 |
<th>Performed by</th> |
| 135 |
<td> |
| 136 |
<xsl:choose> |
| 137 |
<xsl:when test="$testresult/cdf:identity"> |
| 138 |
<xsl:value-of select="$testresult/cdf:identity/text()"/> |
| 139 |
</xsl:when> |
| 140 |
<xsl:otherwise> |
| 141 |
unknown user |
| 142 |
</xsl:otherwise> |
| 143 |
</xsl:choose> |
| 144 |
</td> |
| 145 |
</tr> |
| 146 |
<tr> |
| 147 |
<th>Test system</th> |
| 148 |
<td> |
| 149 |
<xsl:choose> |
| 150 |
<xsl:when test="$testresult/@test-system"> |
| 151 |
<xsl:value-of select="$testresult/@test-system"/> |
| 152 |
</xsl:when> |
| 153 |
<xsl:otherwise> |
| 154 |
unknown |
| 155 |
</xsl:otherwise> |
| 156 |
</xsl:choose> |
| 157 |
</td> |
| 158 |
</tr> |
| 159 |
</table> |
| 160 |
</div> |
| 161 |
<div class="col-md-3 horizontal-scroll"> |
| 162 |
<h4>CPE Platforms</h4> |
| 163 |
<ul class="list-group"> |
| 164 |
|
| 165 |
<xsl:for-each select="$benchmark/cdf:platform"> |
| 166 |
<xsl:variable name="idref" select="@idref"/> |
| 167 |
<xsl:if test="$testresult/cdf:platform[@idref=$idref]"> |
| 168 |
<li class="list-group-item"> |
| 169 |
<span class="label label-success" title="CPE platform {@idref} was found applicable on the evaluated machine"><xsl:value-of select="@idref"/></span> |
| 170 |
</li> |
| 171 |
</xsl:if> |
| 172 |
</xsl:for-each> |
| 173 |
|
| 174 |
<xsl:for-each select="$benchmark/cdf:platform"> |
| 175 |
<xsl:variable name="idref" select="@idref"/> |
| 176 |
<xsl:if test="not($testresult/cdf:platform[@idref=$idref])"> |
| 177 |
<li class="list-group-item"> |
| 178 |
<span class="label label-default" title="This CPE platform was not applicable on the evaluated machine"><xsl:value-of select="@idref"/></span> |
| 179 |
</li> |
| 180 |
</xsl:if> |
| 181 |
</xsl:for-each> |
| 182 |
</ul> |
| 183 |
</div> |
| 184 |
<div class="col-md-4 horizontal-scroll"> |
| 185 |
<h4>Addresses</h4> |
| 186 |
<ul class="list-group"> |
| 187 |
|
| 188 |
<xsl:for-each select="$testresult/cdf:target-address[not(. = preceding::cdf:target-address)]"> |
| 189 |
<li class="list-group-item"> |
| 190 |
<xsl:choose> |
| 191 |
<xsl:when test="contains(text(), ':')"> |
| 192 |
<span class="label label-info">IPv6</span> |
| 193 |
</xsl:when> |
| 194 |
<xsl:when test="contains(text(), '.')"> |
| 195 |
<span class="label label-primary">IPv4</span> |
| 196 |
</xsl:when> |
| 197 |
<xsl:otherwise> |
| 198 |
</xsl:otherwise> |
| 199 |
</xsl:choose> |
| 200 |
|
| 201 |
 <xsl:value-of select="text()"/> |
| 202 |
</li> |
| 203 |
</xsl:for-each> |
| 204 |
|
| 205 |
<xsl:for-each select="$testresult/cdf:target-facts/cdf:fact[@name = 'urn:xccdf:fact:ethernet:MAC'][not(. = preceding::cdf:fact)]"> |
| 206 |
<li class="list-group-item"> |
| 207 |
<span class="label label-default">MAC</span> |
| 208 |
|
| 209 |
 <xsl:value-of select="text()"/> |
| 210 |
</li> |
| 211 |
</xsl:for-each> |
| 212 |
</ul> |
| 213 |
</div> |
| 214 |
</div> |
| 215 |
</div> |
| 216 |
</xsl:template> |
| 217 |
|
| 218 |
<xsl:template name="compliance-and-scoring"> |
| 219 |
<xsl:param name="testresult"/> |
| 220 |
|
| 221 |
<div id="compliance-and-scoring"> |
| 222 |
<h2>Compliance and Scoring</h2> |
| 223 |
|
| 224 |
<xsl:variable name="total_rules_count" select="count($testresult/cdf:rule-result[cdf:result])"/> |
| 225 |
<xsl:variable name="ignored_rules_count" select="count($testresult/cdf:rule-result[cdf:result/text() = 'notselected' or cdf:result/text() = 'notapplicable'])"/> |
| 226 |
<xsl:variable name="passed_rules_count" select="count($testresult/cdf:rule-result[cdf:result/text() = 'pass' or cdf:result/text() = 'fixed'])"/> |
| 227 |
<xsl:variable name="failed_rules_count" select="count($testresult/cdf:rule-result[cdf:result/text() = 'fail'])"/> |
| 228 |
<xsl:variable name="uncertain_rules_count" select="count($testresult/cdf:rule-result[cdf:result/text() = 'error' or cdf:result/text() = 'unknown'])"/> |
| 229 |
<xsl:variable name="not_ignored_rules_count" select="$total_rules_count - $ignored_rules_count"/> |
| 230 |
|
| 231 |
<xsl:choose> |
| 232 |
<xsl:when test="$failed_rules_count > 0"> |
| 233 |
<div class="alert alert-danger"> |
| 234 |
<strong>The target system did not satisfy the conditions of <xsl:value-of select="$failed_rules_count"/> rules!</strong> |
| 235 |
<xsl:if test="$uncertain_rules_count > 0"> |
| 236 |
Furthermore, the results of <xsl:value-of select="$uncertain_rules_count"/> rules were inconclusive. |
| 237 |
</xsl:if> |
| 238 |
Please review rule results and consider applying remediation. |
| 239 |
</div> |
| 240 |
</xsl:when> |
| 241 |
<xsl:when test="$uncertain_rules_count > 0"> |
| 242 |
<div class="alert alert-warning"> |
| 243 |
<strong>There were no failed rules, but the results of <xsl:value-of select="$uncertain_rules_count"/> rules were inconclusive!</strong> |
| 244 |
Please review rule results and consider applying remediation. |
| 245 |
</div> |
| 246 |
</xsl:when> |
| 247 |
<xsl:otherwise> |
| 248 |
<div class="alert alert-success"> |
| 249 |
<strong>There were no failed or uncertain rules.</strong> It seems that no action is necessary. |
| 250 |
</div> |
| 251 |
</xsl:otherwise> |
| 252 |
</xsl:choose> |
| 253 |
|
| 254 |
<h3>Rule results</h3> |
| 255 |
<xsl:choose> |
| 256 |
<xsl:when test="$not_ignored_rules_count > 0" > |
| 257 |
<div class="progress" title="Displays proportion of passed/fixed, failed/error, and other rules (in that order). There were {$not_ignored_rules_count} rules taken into account."> |
| 258 |
<div class="progress-bar progress-bar-success" style="width: {$passed_rules_count div $not_ignored_rules_count * 100}%"> |
| 259 |
<xsl:value-of select="$passed_rules_count"/> passed |
| 260 |
</div> |
| 261 |
<div class="progress-bar progress-bar-danger" style="width: {$failed_rules_count div $not_ignored_rules_count * 100}%"> |
| 262 |
<xsl:value-of select="$failed_rules_count"/> failed |
| 263 |
</div> |
| 264 |
<div class="progress-bar progress-bar-warning" style="width: {(1 - ($passed_rules_count + $failed_rules_count) div $not_ignored_rules_count) * 100}%"> |
| 265 |
<xsl:value-of select="$not_ignored_rules_count - $passed_rules_count - $failed_rules_count"/> other |
| 266 |
</div> |
| 267 |
</div> |
| 268 |
</xsl:when> |
| 269 |
<xsl:otherwise> |
| 270 |
<div>No rules were evaluated.</div> |
| 271 |
</xsl:otherwise> |
| 272 |
</xsl:choose> |
| 273 |
|
| 274 |
<xsl:variable name="failed_rules_low_severity" select="count($testresult/cdf:rule-result[(cdf:result/text() = 'fail') and (@severity = 'low')])"/> |
| 275 |
<xsl:variable name="failed_rules_medium_severity" select="count($testresult/cdf:rule-result[(cdf:result/text() = 'fail') and (@severity = 'medium')])"/> |
| 276 |
<xsl:variable name="failed_rules_high_severity" select="count($testresult/cdf:rule-result[(cdf:result/text() = 'fail') and (@severity = 'high')])"/> |
| 277 |
|
| 278 |
<xsl:variable name="failed_rules_other_severity" select="$failed_rules_count - $failed_rules_high_severity - $failed_rules_medium_severity - $failed_rules_low_severity"/> |
| 279 |
|
| 280 |
<xsl:if test="$failed_rules_count > 0"> |
| 281 |
<h3>Severity of failed rules</h3> |
| 282 |
<div class="progress" title="Displays proportion of high, medium, low, and other severity failed rules (in that order). There were {$failed_rules_count} total failed rules."> |
| 283 |
<div class="progress-bar progress-bar-success" style="width: {$failed_rules_other_severity div $failed_rules_count * 100}%"> |
| 284 |
<xsl:value-of select="$failed_rules_other_severity"/> other |
| 285 |
</div> |
| 286 |
<div class="progress-bar progress-bar-info" style="width: {$failed_rules_low_severity div $failed_rules_count * 100}%"> |
| 287 |
<xsl:value-of select="$failed_rules_low_severity"/> low |
| 288 |
</div> |
| 289 |
<div class="progress-bar progress-bar-warning" style="width: {$failed_rules_medium_severity div $failed_rules_count * 100}%"> |
| 290 |
<xsl:value-of select="$failed_rules_medium_severity"/> medium |
| 291 |
</div> |
| 292 |
<div class="progress-bar progress-bar-danger" style="width: {$failed_rules_high_severity div $failed_rules_count * 100}%"> |
| 293 |
<xsl:value-of select="$failed_rules_high_severity"/> high |
| 294 |
</div> |
| 295 |
</div> |
| 296 |
</xsl:if> |
| 297 |
|
| 298 |
<h3 title="As per the XCCDF specification">Score</h3> |
| 299 |
<table class="table table-striped table-bordered"> |
| 300 |
<thead> |
| 301 |
<tr> |
| 302 |
<th>Scoring system</th> |
| 303 |
<th class="text-center">Score</th> |
| 304 |
<th class="text-center">Maximum</th> |
| 305 |
<th class="text-center" style="width: 40%">Percent</th> |
| 306 |
</tr> |
| 307 |
</thead> |
| 308 |
<tbody> |
| 309 |
<xsl:for-each select="$testresult/cdf:score"> |
| 310 |
<xsl:variable name="percent" select="(text() div @maximum) * 100"/> |
| 311 |
<tr> |
| 312 |
<td><xsl:value-of select="@system"/></td> |
| 313 |
<td class="text-center"><xsl:value-of select="text()"/></td> |
| 314 |
<td class="text-center"><xsl:value-of select="@maximum"/></td> |
| 315 |
<td> |
| 316 |
<div class="progress"> |
| 317 |
<div class="progress-bar progress-bar-success" style="width: {$percent}%"><xsl:if test="$percent >= 50"><xsl:value-of select="round($percent * 100) div 100"/>%</xsl:if></div> |
| 318 |
<div class="progress-bar progress-bar-danger" style="width: {100 - $percent}%"><xsl:if test="$percent < 50"><xsl:value-of select="round($percent * 100) div 100"/>%</xsl:if></div> |
| 319 |
</div> |
| 320 |
</td> |
| 321 |
</tr> |
| 322 |
</xsl:for-each> |
| 323 |
</tbody> |
| 324 |
</table> |
| 325 |
</div> |
| 326 |
</xsl:template> |
| 327 |
|
| 328 |
<xsl:template name="references-to-json"> |
| 329 |
<xsl:param name="item"/> |
| 330 |
<xsl:text>{</xsl:text> |
| 331 |
<xsl:for-each select="$item/cdf:reference"> |
| 332 |
<xsl:sort select="@href"/> |
| 333 |
<xsl:variable name="href" select="@href"/> |
| 334 |
<xsl:if test="not(preceding-sibling::cdf:reference[@href=$href]) and @href"> |
| 335 |
<xsl:if test="position() != 1"> |
| 336 |
<xsl:text>,</xsl:text> |
| 337 |
</xsl:if> |
| 338 |
<xsl:text>"</xsl:text> |
| 339 |
<xsl:call-template name="convert-reference-url-to-name"> |
| 340 |
<xsl:with-param name="href" select="$href"/> |
| 341 |
</xsl:call-template> |
| 342 |
<xsl:text>":[</xsl:text> |
| 343 |
<xsl:for-each select="$item/cdf:reference[@href=$href]"> |
| 344 |
<xsl:text>"</xsl:text> |
| 345 |
<xsl:choose> |
| 346 |
<xsl:when test="normalize-space(.)"> |
| 347 |
<xsl:value-of select="."/> |
| 348 |
</xsl:when> |
| 349 |
<xsl:otherwise> |
| 350 |
<xsl:text>unknown</xsl:text> |
| 351 |
</xsl:otherwise> |
| 352 |
</xsl:choose> |
| 353 |
<xsl:text>"</xsl:text> |
| 354 |
<xsl:if test="position() != last()"> |
| 355 |
<xsl:text>,</xsl:text> |
| 356 |
</xsl:if> |
| 357 |
</xsl:for-each> |
| 358 |
<xsl:text>]</xsl:text> |
| 359 |
</xsl:if> |
| 360 |
</xsl:for-each> |
| 361 |
<xsl:text>}</xsl:text> |
| 362 |
</xsl:template> |
| 363 |
|
| 364 |
<xsl:template name="rule-overview-leaf-table-row"> |
| 365 |
<xsl:param name="result" /> |
| 366 |
<xsl:param name="item" /> |
| 367 |
<xsl:param name="indent" /> |
| 368 |
<xsl:param name="testresult" /> |
| 369 |
<xsl:param name="profile" /> |
| 370 |
|
| 371 |
<tr data-tt-id="{$item/@id}" class="rule-overview-leaf rule-overview-leaf-{$result} rule-overview-leaf-id-{$item/@id}" id="rule-overview-leaf-{generate-id(.)}"> |
| 372 |
<xsl:attribute name="data-tt-parent-id"> |
| 373 |
<xsl:value-of select="$item/parent::cdf:*/@id"/> |
| 374 |
</xsl:attribute> |
| 375 |
<xsl:attribute name="data-references"> |
| 376 |
<xsl:call-template name="references-to-json"> |
| 377 |
<xsl:with-param name="item" select="$item"/> |
| 378 |
</xsl:call-template> |
| 379 |
</xsl:attribute> |
| 380 |
<xsl:if test="$result = 'fail' or $result = 'error' or $result = 'unknown'"> |
| 381 |
<xsl:attribute name="class">rule-overview-leaf rule-overview-leaf-<xsl:value-of select="$result"/> rule-overview-needs-attention</xsl:attribute> |
| 382 |
</xsl:if> |
| 383 |
|
| 384 |
<td style="padding-left: {$indent * 19}px"> |
| 385 |
<a href="#rule-detail-{generate-id(.)}" onclick="return openRuleDetailsDialog('{generate-id(.)}')"> |
| 386 |
<xsl:call-template name="item-title"> |
| 387 |
<xsl:with-param name="item" select="$item"/> |
| 388 |
<xsl:with-param name="testresult" select="$testresult"/> |
| 389 |
<xsl:with-param name="profile" select="$profile"/> |
| 390 |
</xsl:call-template> |
| 391 |
</a> |
| 392 |
<xsl:if test="cdf:check[@multi-check='true']"> |
| 393 |
(<xsl:value-of select="cdf:check/cdf:check-content-ref/@name" />) |
| 394 |
</xsl:if> |
| 395 |
<xsl:if test="cdf:override"> |
| 396 |
 <span class="label label-warning">waived</span> |
| 397 |
</xsl:if> |
| 398 |
</td> |
| 399 |
<td class="rule-severity" style="text-align: center"> |
| 400 |
<xsl:call-template name="item-severity"> |
| 401 |
<xsl:with-param name="item" select="." /> |
| 402 |
<xsl:with-param name="profile" select="$profile" /> |
| 403 |
</xsl:call-template> |
| 404 |
</td> |
| 405 |
<td class="rule-result rule-result-{$result}"> |
| 406 |
<xsl:variable name="result_tooltip"> |
| 407 |
<xsl:call-template name="rule-result-tooltip"> |
| 408 |
<xsl:with-param name="ruleresult" select="$result"/> |
| 409 |
</xsl:call-template> |
| 410 |
</xsl:variable> |
| 411 |
<div> |
| 412 |
<abbr title="{$result_tooltip}"><xsl:value-of select="$result"/></abbr> |
| 413 |
</div> |
| 414 |
</td> |
| 415 |
</tr> |
| 416 |
</xsl:template> |
| 417 |
|
| 418 |
<xsl:key name="testresult_ruleresults" match="//cdf:rule-result" use="concat(ancestor::cdf:TestResult/@id, '|', @idref)"/> |
| 419 |
|
| 420 |
<xsl:template name="rule-overview-leaf"> |
| 421 |
<xsl:param name="testresult"/> |
| 422 |
<xsl:param name="item"/> |
| 423 |
<xsl:param name="profile"/> |
| 424 |
<xsl:param name="indent"/> |
| 425 |
|
| 426 |
<xsl:variable name="ruleresult" select="key('testresult_ruleresults', concat($testresult/@id, '|', $item/@id))"/> |
| 427 |
|
| 428 |
|
| 429 |
<xsl:for-each select="$ruleresult"> |
| 430 |
<xsl:variable name="result" select="cdf:result/text()"/> |
| 431 |
<xsl:if test="$result != 'notselected'"> |
| 432 |
<xsl:call-template name="rule-overview-leaf-table-row"> |
| 433 |
<xsl:with-param name="item" select="$item"/> |
| 434 |
<xsl:with-param name="result" select="$result"/> |
| 435 |
<xsl:with-param name="indent" select="$indent"/> |
| 436 |
<xsl:with-param name="testresult" select="$testresult"/> |
| 437 |
<xsl:with-param name="profile" select="$profile"/> |
| 438 |
</xsl:call-template> |
| 439 |
</xsl:if> |
| 440 |
</xsl:for-each> |
| 441 |
</xsl:template> |
| 442 |
|
| 443 |
<xsl:template name="rule-overview-inner-node"> |
| 444 |
<xsl:param name="testresult"/> |
| 445 |
<xsl:param name="item"/> |
| 446 |
<xsl:param name="profile"/> |
| 447 |
<xsl:param name="indent"/> |
| 448 |
|
| 449 |
<xsl:param name="failed_rule_results"/> |
| 450 |
<xsl:param name="error_rule_results"/> |
| 451 |
<xsl:param name="unknown_rule_results"/> |
| 452 |
<xsl:param name="notchecked_rule_results"/> |
| 453 |
<xsl:param name="notselected_rule_results"/> |
| 454 |
|
| 455 |
<xsl:variable name="descendant_rules" select="$item/descendant::cdf:Rule"/> |
| 456 |
|
| 457 |
<xsl:variable name="contained_rules_fail" select="count($descendant_rules[@id = $failed_rule_results/@idref])"/> |
| 458 |
<xsl:variable name="contained_rules_error" select="count($descendant_rules[@id = $error_rule_results/@idref])"/> |
| 459 |
<xsl:variable name="contained_rules_unknown" select="count($descendant_rules[@id = $unknown_rule_results/@idref])"/> |
| 460 |
<xsl:variable name="contained_rules_notchecked" select="count($descendant_rules[@id = $notchecked_rule_results/@idref])"/> |
| 461 |
<xsl:variable name="contained_rules_notselected" select="count($descendant_rules[@id = $notselected_rule_results/@idref])"/> |
| 462 |
<xsl:variable name="contained_rules_need_attention" select="$contained_rules_fail + $contained_rules_error + $contained_rules_unknown + $contained_rules_notchecked"/> |
| 463 |
|
| 464 |
<xsl:if test="$contained_rules_notselected < count($descendant_rules)"> |
| 465 |
<tr data-tt-id="{$item/@id}" class="rule-overview-inner-node rule-overview-inner-node-id-{$item/@id}"> |
| 466 |
<xsl:if test="$item/parent::cdf:Group or $item/parent::cdf:Benchmark"> |
| 467 |
<xsl:attribute name="data-tt-parent-id"> |
| 468 |
<xsl:value-of select="$item/parent::cdf:*/@id"/> |
| 469 |
</xsl:attribute> |
| 470 |
</xsl:if> |
| 471 |
|
| 472 |
<td colspan="3" style="padding-left: {$indent * 19}px"> |
| 473 |
<xsl:choose> |
| 474 |
<xsl:when test="$contained_rules_need_attention > 0"> |
| 475 |
<strong> |
| 476 |
<xsl:call-template name="item-title"> |
| 477 |
<xsl:with-param name="item" select="$item"/> |
| 478 |
<xsl:with-param name="testresult" select="$testresult"/> |
| 479 |
<xsl:with-param name="profile" select="$profile"/> |
| 480 |
</xsl:call-template> |
| 481 |
</strong> |
| 482 |
<xsl:if test="$contained_rules_fail > 0"> <span class="badge"><xsl:value-of select="$contained_rules_fail"/>x fail</span></xsl:if> |
| 483 |
<xsl:if test="$contained_rules_error > 0"> <span class="badge"><xsl:value-of select="$contained_rules_error"/>x error</span></xsl:if> |
| 484 |
<xsl:if test="$contained_rules_unknown > 0"> <span class="badge"><xsl:value-of select="$contained_rules_unknown"/>x unknown</span></xsl:if> |
| 485 |
<xsl:if test="$contained_rules_notchecked > 0"> <span class="badge"><xsl:value-of select="$contained_rules_notchecked"/>x notchecked</span></xsl:if> |
| 486 |
</xsl:when> |
| 487 |
<xsl:otherwise> |
| 488 |
<xsl:call-template name="item-title"> |
| 489 |
<xsl:with-param name="item" select="$item"/> |
| 490 |
<xsl:with-param name="testresult" select="$testresult"/> |
| 491 |
<xsl:with-param name="profile" select="$profile"/> |
| 492 |
</xsl:call-template> |
| 493 |
<script>$(document).ready(function(){$('.treetable').treetable("collapseNode","<xsl:value-of select="$item/@id"/>");});</script> |
| 494 |
</xsl:otherwise> |
| 495 |
</xsl:choose> |
| 496 |
</td> |
| 497 |
</tr> |
| 498 |
|
| 499 |
<xsl:for-each select="$item/cdf:Group"> |
| 500 |
<xsl:call-template name="rule-overview-inner-node"> |
| 501 |
<xsl:with-param name="testresult" select="$testresult"/> |
| 502 |
<xsl:with-param name="item" select="."/> |
| 503 |
<xsl:with-param name="profile" select="$profile"/> |
| 504 |
<xsl:with-param name="indent" select="$indent + 1"/> |
| 505 |
|
| 506 |
<xsl:with-param name="failed_rule_results" select="$failed_rule_results"/> |
| 507 |
<xsl:with-param name="error_rule_results" select="$error_rule_results"/> |
| 508 |
<xsl:with-param name="unknown_rule_results" select="$unknown_rule_results"/> |
| 509 |
<xsl:with-param name="notchecked_rule_results" select="$notchecked_rule_results"/> |
| 510 |
<xsl:with-param name="notselected_rule_results" select="$notselected_rule_results"/> |
| 511 |
</xsl:call-template> |
| 512 |
</xsl:for-each> |
| 513 |
|
| 514 |
<xsl:for-each select="$item/cdf:Rule"> |
| 515 |
<xsl:call-template name="rule-overview-leaf"> |
| 516 |
<xsl:with-param name="testresult" select="$testresult"/> |
| 517 |
<xsl:with-param name="item" select="."/> |
| 518 |
<xsl:with-param name="profile" select="$profile"/> |
| 519 |
<xsl:with-param name="indent" select="$indent + 1"/> |
| 520 |
</xsl:call-template> |
| 521 |
</xsl:for-each> |
| 522 |
</xsl:if> |
| 523 |
</xsl:template> |
| 524 |
|
| 525 |
<xsl:template name="rule-overview"> |
| 526 |
<xsl:param name="testresult"/> |
| 527 |
<xsl:param name="benchmark"/> |
| 528 |
<xsl:param name="profile"/> |
| 529 |
|
| 530 |
<div id="rule-overview"> |
| 531 |
<h2>Rule Overview</h2> |
| 532 |
|
| 533 |
<div class="form-group js-only hidden-print"> |
| 534 |
<div class="row"> |
| 535 |
<div title="Filter rules by their XCCDF result"> |
| 536 |
<div class="col-sm-2 toggle-rule-display-success"> |
| 537 |
<div class="checkbox"> |
| 538 |
<label><input class="toggle-rule-display" type="checkbox" onclick="toggleRuleDisplay(this)" checked="checked" value="pass"/>pass</label> |
| 539 |
</div> |
| 540 |
<div class="checkbox"> |
| 541 |
<label><input class="toggle-rule-display" type="checkbox" onclick="toggleRuleDisplay(this)" checked="checked" value="fixed"/>fixed</label> |
| 542 |
</div> |
| 543 |
<div class="checkbox"> |
| 544 |
<label><input class="toggle-rule-display" type="checkbox" onclick="toggleRuleDisplay(this)" checked="checked" value="informational"/>informational</label> |
| 545 |
</div> |
| 546 |
</div> |
| 547 |
|
| 548 |
<div class="col-sm-2 toggle-rule-display-danger"> |
| 549 |
<div class="checkbox"> |
| 550 |
<label><input class="toggle-rule-display" type="checkbox" onclick="toggleRuleDisplay(this)" checked="checked" value="fail"/>fail</label> |
| 551 |
</div> |
| 552 |
<div class="checkbox"> |
| 553 |
<label><input class="toggle-rule-display" type="checkbox" onclick="toggleRuleDisplay(this)" checked="checked" value="error"/>error</label> |
| 554 |
</div> |
| 555 |
<div class="checkbox"> |
| 556 |
<label><input class="toggle-rule-display" type="checkbox" onclick="toggleRuleDisplay(this)" checked="checked" value="unknown"/>unknown</label> |
| 557 |
</div> |
| 558 |
</div> |
| 559 |
|
| 560 |
<div class="col-sm-2 toggle-rule-display-other"> |
| 561 |
<div class="checkbox"> |
| 562 |
<label><input class="toggle-rule-display" type="checkbox" onclick="toggleRuleDisplay(this)" checked="checked" value="notchecked"/>notchecked</label> |
| 563 |
</div> |
| 564 |
<div class="checkbox"> |
| 565 |
<label><input class="toggle-rule-display" type="checkbox" onclick="toggleRuleDisplay(this)" checked="checked" value="notapplicable"/>notapplicable</label> |
| 566 |
</div> |
| 567 |
</div> |
| 568 |
</div> |
| 569 |
<div class="col-sm-6"> |
| 570 |
<div class="input-group"> |
| 571 |
<input type="text" class="form-control" placeholder="Search through XCCDF rules" id="search-input" oninput="ruleSearch()"/> |
| 572 |
|
| 573 |
<div class="input-group-btn"> |
| 574 |
<button class="btn btn-default" onclick="ruleSearch()">Search</button> |
| 575 |
</div> |
| 576 |
</div> |
| 577 |
<p id="search-matches"></p> |
| 578 |
Group rules by: |
| 579 |
<select name="groupby" onchange="groupRulesBy(value)"> |
| 580 |
<option value="default" selected="selected">Default</option> |
| 581 |
<option value="severity">Severity</option> |
| 582 |
<option value="result">Result</option> |
| 583 |
<option disabled="disabled">──────────</option> |
| 584 |
<xsl:call-template name="get-all-references"> |
| 585 |
<xsl:with-param name="benchmark" select="$benchmark"/> |
| 586 |
</xsl:call-template> |
| 587 |
</select> |
| 588 |
</div> |
| 589 |
</div> |
| 590 |
</div> |
| 591 |
|
| 592 |
<table class="treetable table table-bordered"> |
| 593 |
<thead> |
| 594 |
<tr> |
| 595 |
<th>Title</th> |
| 596 |
<th style="width: 120px; text-align: center">Severity</th> |
| 597 |
<th style="width: 120px; text-align: center">Result</th> |
| 598 |
</tr> |
| 599 |
</thead> |
| 600 |
<tbody> |
| 601 |
<xsl:variable name="failed_rule_results" select="$testresult/cdf:rule-result[cdf:result/text() = 'fail']"/> |
| 602 |
<xsl:variable name="error_rule_results" select="$testresult/cdf:rule-result[cdf:result/text() = 'error']"/> |
| 603 |
<xsl:variable name="unknown_rule_results" select="$testresult/cdf:rule-result[cdf:result/text() = 'unknown']"/> |
| 604 |
<xsl:variable name="notchecked_rule_results" select="$testresult/cdf:rule-result[cdf:result/text() = 'notchecked']"/> |
| 605 |
<xsl:variable name="notselected_rule_results" select="$testresult/cdf:rule-result[cdf:result/text() = 'notselected']"/> |
| 606 |
|
| 607 |
<xsl:call-template name="rule-overview-inner-node"> |
| 608 |
<xsl:with-param name="testresult" select="$testresult"/> |
| 609 |
<xsl:with-param name="item" select="$benchmark"/> |
| 610 |
<xsl:with-param name="profile" select="$profile"/> |
| 611 |
<xsl:with-param name="indent" select="0"/> |
| 612 |
|
| 613 |
<xsl:with-param name="failed_rule_results" select="$failed_rule_results"/> |
| 614 |
<xsl:with-param name="error_rule_results" select="$error_rule_results"/> |
| 615 |
<xsl:with-param name="unknown_rule_results" select="$unknown_rule_results"/> |
| 616 |
<xsl:with-param name="notchecked_rule_results" select="$notchecked_rule_results"/> |
| 617 |
<xsl:with-param name="notselected_rule_results" select="$notselected_rule_results"/> |
| 618 |
</xsl:call-template> |
| 619 |
</tbody> |
| 620 |
</table> |
| 621 |
</div> |
| 622 |
</xsl:template> |
| 623 |
|
| 624 |
<xsl:template name="check-system-details-oval5"> |
| 625 |
<xsl:param name="check"/> |
| 626 |
<xsl:param name="oval-tmpl"/> |
| 627 |
<xsl:param name="result"/> |
| 628 |
|
| 629 |
<xsl:variable name="filename"> |
| 630 |
<xsl:choose> |
| 631 |
<xsl:when test='contains($oval-tmpl, "%")'><xsl:value-of select='concat(substring-before($oval-tmpl, "%"), $check/cdf:check-content-ref/@href, substring-after($oval-tmpl, "%"))'/></xsl:when> |
| 632 |
<xsl:otherwise><xsl:value-of select='$oval-tmpl'/></xsl:otherwise> |
| 633 |
</xsl:choose> |
| 634 |
</xsl:variable> |
| 635 |
|
| 636 |
<xsl:variable name="arf_results" select="(/arf:asset-report-collection/arf:reports/arf:report/arf:content/ovalres:oval_results)[1]"/> |
| 637 |
|
| 638 |
<xsl:variable name="details"> |
| 639 |
<xsl:if test="$filename != ''"> |
| 640 |
<xsl:apply-templates select="document($filename)/ovalres:oval_results" mode="brief"> |
| 641 |
<xsl:with-param name='definition-id' select='$check/cdf:check-content-ref/@name'/> |
| 642 |
<xsl:with-param name='result' select='$result'/> |
| 643 |
</xsl:apply-templates> |
| 644 |
</xsl:if> |
| 645 |
|
| 646 |
|
| 647 |
|
| 648 |
|
| 649 |
|
| 650 |
|
| 651 |
|
| 652 |
|
| 653 |
|
| 654 |
|
| 655 |
|
| 656 |
|
| 657 |
|
| 658 |
|
| 659 |
|
| 660 |
|
| 661 |
|
| 662 |
|
| 663 |
|
| 664 |
|
| 665 |
|
| 666 |
|
| 667 |
|
| 668 |
<xsl:apply-templates select="$arf_results" mode="brief"> |
| 669 |
<xsl:with-param name='definition-id' select='$check/cdf:check-content-ref/@name'/> |
| 670 |
<xsl:with-param name='result' select='$result'/> |
| 671 |
</xsl:apply-templates> |
| 672 |
</xsl:variable> |
| 673 |
|
| 674 |
<xsl:if test="normalize-space($details)"> |
| 675 |
<xsl:variable name="details_origin"> |
| 676 |
<xsl:choose> |
| 677 |
<xsl:when test="$filename != ''">file '<xsl:value-of select="$filename"/>'</xsl:when> |
| 678 |
<xsl:otherwise>arf:report with id='<xsl:value-of select="$arf_results/parent::arf:content/parent::arf:report/@id"/>'</xsl:otherwise> |
| 679 |
</xsl:choose> |
| 680 |
</xsl:variable> |
| 681 |
<span class="label label-default"><abbr title="OVAL details taken from {$details_origin}">OVAL test results details</abbr></span> |
| 682 |
<div class="panel panel-default"> |
| 683 |
<div class="panel-body"> |
| 684 |
<xsl:copy-of select="$details"/> |
| 685 |
</div> |
| 686 |
</div> |
| 687 |
</xsl:if> |
| 688 |
</xsl:template> |
| 689 |
|
| 690 |
<xsl:template name="check-system-details-sce"> |
| 691 |
<xsl:param name="check"/> |
| 692 |
<xsl:param name="sce-tmpl"/> |
| 693 |
|
| 694 |
<xsl:choose> |
| 695 |
<xsl:when test="$check/cdf:check-import[@import-name = 'stdout']/text() or $check/cdf:check-import[@import-name = 'stderr']/text()"> |
| 696 |
<xsl:if test="$check/cdf:check-import[@import-name = 'stdout']/text()"> |
| 697 |
<span class="label label-default"><abbr title="Script Check Engine stdout taken from check-import">SCE stdout</abbr></span> |
| 698 |
<pre><code> |
| 699 |
<xsl:value-of select="$check/cdf:check-import[@import-name = 'stdout']/text()"/> |
| 700 |
</code></pre> |
| 701 |
</xsl:if> |
| 702 |
<xsl:if test="$check/cdf:check-import[@import-name = 'stderr']/text()"> |
| 703 |
<span class="label label-default"><abbr title="Script Check Engine stderr taken from check-import">SCE stderr</abbr></span> |
| 704 |
<pre><code> |
| 705 |
<xsl:value-of select="$check/cdf:check-import[@import-name = 'stderr']/text()"/> |
| 706 |
</code></pre> |
| 707 |
</xsl:if> |
| 708 |
</xsl:when> |
| 709 |
<xsl:otherwise> |
| 710 |
<xsl:variable name="filename"> |
| 711 |
<xsl:choose> |
| 712 |
<xsl:when test='contains($sce-tmpl, "%")'><xsl:value-of select='concat(substring-before($sce-tmpl, "%"), $check/cdf:check-content-ref/@href, substring-after($sce-tmpl, "%"))'/></xsl:when> |
| 713 |
<xsl:otherwise><xsl:value-of select='$sce-tmpl'/></xsl:otherwise> |
| 714 |
</xsl:choose> |
| 715 |
</xsl:variable> |
| 716 |
|
| 717 |
<xsl:if test="$filename != ''"> |
| 718 |
<xsl:variable name="stdout" select="document($filename)/sceres:sce_results/sceres:stdout/text()"/> |
| 719 |
<xsl:variable name="stderr" select="document($filename)/sceres:sce_results/sceres:stderr/text()"/> |
| 720 |
|
| 721 |
<xsl:if test="normalize-space($stdout)"> |
| 722 |
<span class="label label-default"><abbr title="Script Check Engine stdout taken from '{$filename}'">SCE stdout</abbr></span> |
| 723 |
<pre><code> |
| 724 |
<xsl:copy-of select="$stdout"/> |
| 725 |
</code></pre> |
| 726 |
</xsl:if> |
| 727 |
<xsl:if test="normalize-space($stderr)"> |
| 728 |
<span class="label label-default"><abbr title="Script Check Engine stderr taken from '{$filename}'">SCE stderr</abbr></span> |
| 729 |
<pre><code> |
| 730 |
<xsl:copy-of select="$stderr"/> |
| 731 |
</code></pre> |
| 732 |
</xsl:if> |
| 733 |
</xsl:if> |
| 734 |
</xsl:otherwise> |
| 735 |
</xsl:choose> |
| 736 |
</xsl:template> |
| 737 |
|
| 738 |
<xsl:template name="check-system-details"> |
| 739 |
<xsl:param name="check"/> |
| 740 |
<xsl:param name="oval-tmpl"/> |
| 741 |
<xsl:param name="sce-tmpl"/> |
| 742 |
<xsl:param name="result"/> |
| 743 |
|
| 744 |
<xsl:choose> |
| 745 |
<xsl:when test="$check/@system = 'http://oval.mitre.org/XMLSchema/oval-definitions-5'"> |
| 746 |
<xsl:call-template name="check-system-details-oval5"> |
| 747 |
<xsl:with-param name="check" select="$check"/> |
| 748 |
<xsl:with-param name="oval-tmpl" select="$oval-tmpl"/> |
| 749 |
<xsl:with-param name="result" select="$result"/> |
| 750 |
</xsl:call-template> |
| 751 |
</xsl:when> |
| 752 |
<xsl:when test="$check/@system = 'http://open-scap.org/page/SCE'"> |
| 753 |
<xsl:call-template name="check-system-details-sce"> |
| 754 |
<xsl:with-param name="check" select="$check"/> |
| 755 |
<xsl:with-param name="sce-tmpl" select="$sce-tmpl"/> |
| 756 |
</xsl:call-template> |
| 757 |
</xsl:when> |
| 758 |
<xsl:otherwise> |
| 759 |
</xsl:otherwise> |
| 760 |
</xsl:choose> |
| 761 |
|
| 762 |
</xsl:template> |
| 763 |
|
| 764 |
|
| 765 |
<xsl:template name="result-details-leaf-table"> |
| 766 |
<xsl:param name="item"/> |
| 767 |
<xsl:param name="testresult"/> |
| 768 |
<xsl:param name="profile"/> |
| 769 |
<xsl:param name="result"/> |
| 770 |
|
| 771 |
<table class="table table-striped table-bordered"> |
| 772 |
<tbody> |
| 773 |
<tr><td class="col-md-3">Rule ID</td><td class="rule-id col-md-9"><xsl:value-of select="$item/@id"/></td></tr> |
| 774 |
<tr><td>Result</td> |
| 775 |
<td class="rule-result rule-result-{$result}"> |
| 776 |
<xsl:variable name="result_tooltip"> |
| 777 |
<xsl:call-template name="rule-result-tooltip"> |
| 778 |
<xsl:with-param name="ruleresult" select="$result"/> |
| 779 |
</xsl:call-template> |
| 780 |
</xsl:variable> |
| 781 |
<div> |
| 782 |
<abbr title="{$result_tooltip}"><xsl:value-of select="$result"/></abbr> |
| 783 |
</div> |
| 784 |
</td></tr> |
| 785 |
<tr> |
| 786 |
<td>Multi-check rule</td> |
| 787 |
<td> |
| 788 |
<xsl:choose> |
| 789 |
<xsl:when test="cdf:check[@multi-check='true']">yes</xsl:when> |
| 790 |
<xsl:otherwise>no</xsl:otherwise> |
| 791 |
</xsl:choose> |
| 792 |
</td> |
| 793 |
</tr> |
| 794 |
<xsl:if test="cdf:check[@system='http://oval.mitre.org/XMLSchema/oval-definitions-5']"> |
| 795 |
<tr> |
| 796 |
<td>OVAL Definition ID</td> |
| 797 |
<td> |
| 798 |
<xsl:value-of select="cdf:check/cdf:check-content-ref/@name" /> |
| 799 |
</td> |
| 800 |
</tr> |
| 801 |
</xsl:if> |
| 802 |
<tr><td>Time</td><td><xsl:value-of select="@time"/></td></tr> |
| 803 |
<tr> |
| 804 |
<td>Severity</td> |
| 805 |
<td> |
| 806 |
<xsl:call-template name="item-severity"> |
| 807 |
<xsl:with-param name="item" select="." /> |
| 808 |
<xsl:with-param name="profile" select="$profile" /> |
| 809 |
</xsl:call-template> |
| 810 |
</td> |
| 811 |
</tr> |
| 812 |
<xsl:call-template name="item-idents-refs"> |
| 813 |
<xsl:with-param name="item" select="$item"/> |
| 814 |
</xsl:call-template> |
| 815 |
<xsl:if test="cdf:override"> |
| 816 |
<tr><td colspan="2"> |
| 817 |
<xsl:for-each select="cdf:override"> |
| 818 |
<xsl:variable name="old-result" select="cdf:old-result/text()"/> |
| 819 |
|
| 820 |
<div class="alert alert-warning waiver"> |
| 821 |
This rule has been waived by <strong><xsl:value-of select="@authority"/></strong> at <strong><xsl:value-of select="@date"/></strong>. |
| 822 |
<blockquote> |
| 823 |
<xsl:value-of select="cdf:remark/text()"/> |
| 824 |
</blockquote> |
| 825 |
<small> |
| 826 |
The previous result was <span class="rule-result rule-result-{$old-result}"> <xsl:value-of select="$old-result"/> </span>. |
| 827 |
</small> |
| 828 |
</div> |
| 829 |
</xsl:for-each> |
| 830 |
</td></tr> |
| 831 |
</xsl:if> |
| 832 |
<xsl:if test="$item/cdf:description"> |
| 833 |
<tr><td>Description</td><td><div class="description"> |
| 834 |
<xsl:apply-templates mode="sub-testresult" select="$item/cdf:description"> |
| 835 |
<xsl:with-param name="testresult" select="$testresult"/> |
| 836 |
<xsl:with-param name="benchmark" select="$item/ancestor::cdf:Benchmark"/> |
| 837 |
<xsl:with-param name="profile" select="$profile"/> |
| 838 |
</xsl:apply-templates> |
| 839 |
</div></td></tr> |
| 840 |
</xsl:if> |
| 841 |
<xsl:if test="$item/cdf:rationale"> |
| 842 |
<tr><td>Rationale</td><td><div class="rationale"> |
| 843 |
<xsl:apply-templates mode="sub-testresult" select="$item/cdf:rationale"> |
| 844 |
<xsl:with-param name="testresult" select="$testresult"/> |
| 845 |
<xsl:with-param name="benchmark" select="$item/ancestor::cdf:Benchmark"/> |
| 846 |
<xsl:with-param name="profile" select="$profile"/> |
| 847 |
</xsl:apply-templates> |
| 848 |
</div></td></tr> |
| 849 |
</xsl:if> |
| 850 |
<xsl:if test="count($profile/cdf:select[@idref=$item/@id]/cdf:remark) > 0"> |
| 851 |
<tr><td>Remarks</td><td class="remarks"> |
| 852 |
<xsl:for-each select="$profile/cdf:select[@idref=$item/@id]/cdf:remark"> |
| 853 |
<blockquote class="small"> |
| 854 |
<xsl:value-of select="text()" /> |
| 855 |
</blockquote> |
| 856 |
</xsl:for-each> |
| 857 |
</td></tr> |
| 858 |
</xsl:if> |
| 859 |
<xsl:if test="$item/cdf:warning"> |
| 860 |
<tr><td>Warnings</td><td> |
| 861 |
<xsl:for-each select="$item/cdf:warning"> |
| 862 |
<div class="panel panel-warning"> |
| 863 |
<div class="panel-heading"> |
| 864 |
<span class="label label-warning">warning</span>  |
| 865 |
<xsl:apply-templates mode="sub-testresult" select="."> |
| 866 |
<xsl:with-param name="benchmark" select="$item/ancestor::cdf:Benchmark"/> |
| 867 |
<xsl:with-param name="profile" select="$profile"/> |
| 868 |
</xsl:apply-templates> |
| 869 |
</div> |
| 870 |
</div> |
| 871 |
</xsl:for-each> |
| 872 |
</td></tr> |
| 873 |
</xsl:if> |
| 874 |
<xsl:if test="cdf:message"> |
| 875 |
<tr><td colspan="2"><div class="evaluation-messages"> |
| 876 |
<span class="label label-default"><abbr title="Messages taken from rule-result">Evaluation messages</abbr></span> |
| 877 |
<div class="panel panel-default"> |
| 878 |
<div class="panel-body"> |
| 879 |
<xsl:for-each select="cdf:message"> |
| 880 |
<xsl:if test="./@severity"> |
| 881 |
<span class="label label-primary"><xsl:value-of select="./@severity"/></span>  |
| 882 |
</xsl:if> |
| 883 |
<pre><xsl:apply-templates mode="sub-testresult" select="."> |
| 884 |
<xsl:with-param name="benchmark" select="$item/ancestor::cdf:Benchmark"/> |
| 885 |
<xsl:with-param name="profile" select="$profile"/> |
| 886 |
</xsl:apply-templates></pre> |
| 887 |
</xsl:for-each> |
| 888 |
</div> |
| 889 |
</div> |
| 890 |
</div></td></tr> |
| 891 |
</xsl:if> |
| 892 |
<xsl:if test="$result = 'fail' or $result = 'error' or $result = 'unknown'"> |
| 893 |
<xsl:for-each select="$item/cdf:fixtext"> |
| 894 |
<tr><td colspan="2"><div class="remediation-description"> |
| 895 |
<xsl:call-template name="show-fixtext"> |
| 896 |
<xsl:with-param name="fixtext" select="."/> |
| 897 |
<xsl:with-param name="testresult" select="$testresult"/> |
| 898 |
<xsl:with-param name="benchmark" select="$item/ancestor::cdf:Benchmark"/> |
| 899 |
<xsl:with-param name="profile" select="$profile"/> |
| 900 |
</xsl:call-template> |
| 901 |
</div></td></tr> |
| 902 |
</xsl:for-each> |
| 903 |
<xsl:for-each select="$item/cdf:fix"> |
| 904 |
<tr class="noprint"><td colspan="2"><div class="remediation"> |
| 905 |
<xsl:call-template name="show-fix"> |
| 906 |
<xsl:with-param name="fix" select="."/> |
| 907 |
<xsl:with-param name="testresult" select="$testresult"/> |
| 908 |
<xsl:with-param name="benchmark" select="$item/ancestor::cdf:Benchmark"/> |
| 909 |
<xsl:with-param name="profile" select="$profile"/> |
| 910 |
</xsl:call-template> |
| 911 |
</div></td></tr> |
| 912 |
</xsl:for-each> |
| 913 |
</xsl:if> |
| 914 |
</tbody> |
| 915 |
</table> |
| 916 |
</xsl:template> |
| 917 |
|
| 918 |
<xsl:template name="result-details-leaf"> |
| 919 |
<xsl:param name="testresult"/> |
| 920 |
<xsl:param name="item"/> |
| 921 |
<xsl:param name="profile"/> |
| 922 |
|
| 923 |
<xsl:variable name="ruleresult" select="key('testresult_ruleresults', concat($testresult/@id, '|', $item/@id))"/> |
| 924 |
<xsl:for-each select="$ruleresult"> |
| 925 |
<xsl:variable name="result" select="cdf:result/text()"/> |
| 926 |
<xsl:if test="$result != 'notselected'"> |
| 927 |
<div class="panel panel-default rule-detail rule-detail-{$result} rule-detail-id-{$item/@id}" id="rule-detail-{generate-id(.)}"> |
| 928 |
<div class="keywords sr-only"> |
| 929 |
<xsl:comment>This allows OpenSCAP JS to search the report rules</xsl:comment> |
| 930 |
<xsl:call-template name="item-title"> |
| 931 |
<xsl:with-param name="item" select="$item"/> |
| 932 |
<xsl:with-param name="testresult" select="$testresult"/> |
| 933 |
<xsl:with-param name="profile" select="$profile"/> |
| 934 |
</xsl:call-template> |
| 935 |
<xsl:value-of select="concat($item/@id, ' ')"/> |
| 936 |
<xsl:value-of select="@severity"/> |
| 937 |
<xsl:for-each select="cdf:ident"> |
| 938 |
<xsl:value-of select="concat(text(), ' ')"/> |
| 939 |
</xsl:for-each> |
| 940 |
<xsl:for-each select="cdf:reference"> |
| 941 |
<xsl:value-of select="concat(text(), ' ')"/> |
| 942 |
</xsl:for-each> |
| 943 |
</div> |
| 944 |
<div class="panel-heading"> |
| 945 |
<h3 class="panel-title"> |
| 946 |
<xsl:call-template name="item-title"> |
| 947 |
<xsl:with-param name="item" select="$item"/> |
| 948 |
<xsl:with-param name="testresult" select="$testresult"/> |
| 949 |
<xsl:with-param name="profile" select="$profile"/> |
| 950 |
</xsl:call-template> |
| 951 |
</h3> |
| 952 |
</div> |
| 953 |
<div class="panel-body"> |
| 954 |
<xsl:call-template name="result-details-leaf-table"> |
| 955 |
<xsl:with-param name="item" select="$item"/> |
| 956 |
<xsl:with-param name="testresult" select="$testresult"/> |
| 957 |
<xsl:with-param name="profile" select="$profile"/> |
| 958 |
<xsl:with-param name="result" select="$result"/> |
| 959 |
</xsl:call-template> |
| 960 |
<xsl:variable name="check_system_details_ret"> |
| 961 |
<xsl:call-template name="check-system-details"> |
| 962 |
<xsl:with-param name="check" select="cdf:check"/> |
| 963 |
<xsl:with-param name="oval-tmpl" select="$oval-tmpl"/> |
| 964 |
<xsl:with-param name="sce-tmpl" select="$sce-tmpl"/> |
| 965 |
<xsl:with-param name="result" select="$result"/> |
| 966 |
</xsl:call-template> |
| 967 |
</xsl:variable> |
| 968 |
|
| 969 |
<xsl:if test="normalize-space($check_system_details_ret)"> |
| 970 |
<div class="check-system-details"> |
| 971 |
<xsl:copy-of select="$check_system_details_ret"/> |
| 972 |
</div> |
| 973 |
</xsl:if> |
| 974 |
</div> |
| 975 |
</div> |
| 976 |
</xsl:if> |
| 977 |
</xsl:for-each> |
| 978 |
</xsl:template> |
| 979 |
|
| 980 |
<xsl:template name="result-details-inner-node"> |
| 981 |
<xsl:param name="testresult"/> |
| 982 |
<xsl:param name="item"/> |
| 983 |
<xsl:param name="profile"/> |
| 984 |
|
| 985 |
<xsl:for-each select="$item/cdf:Group"> |
| 986 |
<xsl:call-template name="result-details-inner-node"> |
| 987 |
<xsl:with-param name="testresult" select="$testresult"/> |
| 988 |
<xsl:with-param name="item" select="."/> |
| 989 |
<xsl:with-param name="profile" select="$profile"/> |
| 990 |
</xsl:call-template> |
| 991 |
</xsl:for-each> |
| 992 |
|
| 993 |
<xsl:for-each select="$item/cdf:Rule"> |
| 994 |
<xsl:call-template name="result-details-leaf"> |
| 995 |
<xsl:with-param name="testresult" select="$testresult"/> |
| 996 |
<xsl:with-param name="item" select="."/> |
| 997 |
<xsl:with-param name="profile" select="$profile"/> |
| 998 |
</xsl:call-template> |
| 999 |
</xsl:for-each> |
| 1000 |
</xsl:template> |
| 1001 |
|
| 1002 |
<xsl:template name="result-details"> |
| 1003 |
<xsl:param name="testresult"/> |
| 1004 |
<xsl:param name="benchmark"/> |
| 1005 |
<xsl:param name="profile"/> |
| 1006 |
|
| 1007 |
<div class="js-only hidden-print"> |
| 1008 |
<button type="button" class="btn btn-info" onclick="return toggleResultDetails(this)">Show all result details</button> |
| 1009 |
</div> |
| 1010 |
<div id="result-details"> |
| 1011 |
<h2>Result Details</h2> |
| 1012 |
|
| 1013 |
<xsl:call-template name="result-details-inner-node"> |
| 1014 |
<xsl:with-param name="testresult" select="$testresult"/> |
| 1015 |
<xsl:with-param name="item" select="$benchmark"/> |
| 1016 |
<xsl:with-param name="profile" select="$profile"/> |
| 1017 |
</xsl:call-template> |
| 1018 |
<a href="#result-details" class="btn btn-info noprint">Scroll back to the first rule</a> |
| 1019 |
</div> |
| 1020 |
</xsl:template> |
| 1021 |
|
| 1022 |
<xsl:template name="generate-report"> |
| 1023 |
<xsl:param name="testresult"/> |
| 1024 |
<xsl:param name="benchmark"/> |
| 1025 |
|
| 1026 |
<xsl:variable name="profile" select="$benchmark/cdf:Profile[@id = $testresult/cdf:profile/@idref]"/> |
| 1027 |
|
| 1028 |
<xsl:text disable-output-escaping='yes'><!DOCTYPE html></xsl:text> |
| 1029 |
<html lang="en"> |
| 1030 |
<head> |
| 1031 |
<meta http-equiv="X-UA-Compatible" content="IE=edge"/> |
| 1032 |
<meta name="viewport" content="width=device-width, initial-scale=1"/> |
| 1033 |
<title><xsl:value-of select="$testresult/@id"/> | OpenSCAP Evaluation Report</title> |
| 1034 |
|
| 1035 |
<style><xsl:call-template name="css-sources"/></style> |
| 1036 |
<script><xsl:call-template name="js-sources"/></script> |
| 1037 |
</head> |
| 1038 |
|
| 1039 |
<body> |
| 1040 |
<xsl:call-template name="xccdf-report-header"/> |
| 1041 |
|
| 1042 |
<div class="container"><div id="content"> |
| 1043 |
<xsl:call-template name="introduction"> |
| 1044 |
<xsl:with-param name="benchmark" select="$benchmark"/> |
| 1045 |
<xsl:with-param name="profile" select="$profile"/> |
| 1046 |
</xsl:call-template> |
| 1047 |
<xsl:call-template name="characteristics"> |
| 1048 |
<xsl:with-param name="testresult" select="$testresult"/> |
| 1049 |
<xsl:with-param name="benchmark" select="$benchmark"/> |
| 1050 |
<xsl:with-param name="profile" select="$profile"/> |
| 1051 |
</xsl:call-template> |
| 1052 |
<xsl:call-template name="compliance-and-scoring"> |
| 1053 |
<xsl:with-param name="testresult" select="$testresult"/> |
| 1054 |
<xsl:with-param name="benchmark" select="$benchmark"/> |
| 1055 |
<xsl:with-param name="profile" select="$profile"/> |
| 1056 |
</xsl:call-template> |
| 1057 |
<xsl:call-template name="rule-overview"> |
| 1058 |
<xsl:with-param name="testresult" select="$testresult"/> |
| 1059 |
<xsl:with-param name="benchmark" select="$benchmark"/> |
| 1060 |
<xsl:with-param name="profile" select="$profile"/> |
| 1061 |
</xsl:call-template> |
| 1062 |
<xsl:call-template name="result-details"> |
| 1063 |
<xsl:with-param name="testresult" select="$testresult"/> |
| 1064 |
<xsl:with-param name="benchmark" select="$benchmark"/> |
| 1065 |
<xsl:with-param name="profile" select="$profile"/> |
| 1066 |
</xsl:call-template> |
| 1067 |
<xsl:call-template name="rear-matter"> |
| 1068 |
<xsl:with-param name="benchmark" select="$benchmark"/> |
| 1069 |
<xsl:with-param name="profile" select="$profile"/> |
| 1070 |
</xsl:call-template> |
| 1071 |
</div></div> |
| 1072 |
|
| 1073 |
<xsl:call-template name="xccdf-report-footer"/> |
| 1074 |
|
| 1075 |
</body> |
| 1076 |
</html> |
| 1077 |
</xsl:template> |
| 1078 |
|
| 1079 |
</xsl:stylesheet> |