components/openscap/patches/os-brand.patch
branchs11-update
changeset 3806 bdc70b98921a
parent 3804 83478bd23f4f
child 3807 5252dce7cc09
equal deleted inserted replaced
3804:83478bd23f4f 3806:bdc70b98921a
     1 This patch provides a new configure option --with-report-branding to generate
       
     2  the reports with vendor specific brand and logo. If the option is not used
       
     3  reports get generated using the default template and colors.
       
     4 This change was developed in-house and has not been submitted upstream.
       
     5 
       
     6 
       
     7 --- openscap-0.9.7/xsl/Makefile.am.~1~  2013-10-17 19:32:43.848277759 -0700
       
     8 +++ openscap-0.9.7/xsl/Makefile.am      2013-10-17 19:31:32.960110050 -0700
       
     9 @@ -17,7 +17,8 @@
       
    10                         xccdf_1.1_remove_dangling_sub.xsl \
       
    11               xccdf-tailor.xsl \
       
    12               xccdf-substitute.xsl \
       
    13 -             xccdf-share.xsl
       
    14 +             xccdf-share.xsl \
       
    15 +             os-brand.xsl
       
    16  
       
    17  EXTRA_DIST = security-guide.xsl \
       
    18               xccdf-report.xsl \
       
    19 @@ -35,5 +36,6 @@
       
    20               oscap-share.xsl \
       
    21               xccdf-tailor.xsl \
       
    22               xccdf-substitute.xsl \
       
    23 -             xccdf-share.xsl
       
    24 +             xccdf-share.xsl \
       
    25 +             os-brand.xsl
       
    26 
       
    27 --- /dev/null	2013-10-17 20:38:34.000000000 -0700
       
    28 +++ openscap-0.9.7/xsl/os-brand.xsl.in	2013-10-17 20:57:48.565359270 -0700
       
    29 @@ -0,0 +1,5 @@
       
    30 +<?xml version="1.0" encoding="UTF-8" ?>
       
    31 +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
       
    32 +<xsl:variable name="branded" select="'@BRANDED@'"/>
       
    33 +@BRANDTEMPLATE@
       
    34 +</xsl:stylesheet>
       
    35 --- openscap-0.9.7/configure.ac.~2~	2013-10-18 10:46:29.041272020 -0700
       
    36 +++ openscap-0.9.7/configure.ac	2013-10-18 10:49:44.494855545 -0700
       
    37 @@ -233,6 +233,7 @@
       
    38  probe_dpkginfo_req_deps_missing=
       
    39  probe_dpkginfo_opt_deps_ok=yes
       
    40  probe_dpkginfo_opt_deps_missing=
       
    41 +report_branding=
       
    42  
       
    43  #
       
    44  # env
       
    45 @@ -990,6 +991,22 @@
       
    46       [],
       
    47       [crypto=gcrypt])
       
    48  
       
    49 +#used for generating os-brand.xsl
       
    50 +AC_ARG_WITH([report-branding],
       
    51 +     [AS_HELP_STRING([--with-report-branding=<location of the branded logo template> enables report-branding.])],
       
    52 +     [report_branding="${with_report_branding}"],
       
    53 +     [])
       
    54 +
       
    55 +notbranded='<xsl:template name="operating-system-logo"/>'
       
    56 +osbranded="<xsl:include href='${report_branding}' />"
       
    57 +if test  "x${report_branding}" = "x" ; then
       
    58 +AC_SUBST([BRANDED], "no")
       
    59 +AC_SUBST([BRANDTEMPLATE], "${notbranded}")
       
    60 +else
       
    61 +AC_SUBST([BRANDED], "yes")
       
    62 +AC_SUBST([BRANDTEMPLATE], "${osbranded}")
       
    63 +fi
       
    64 +
       
    65  if test "x${libexecdir}" = xNONE; then
       
    66  	probe_dir="/usr/local/libexec/openscap"
       
    67  else
       
    68 @@ -1196,6 +1213,7 @@
       
    69                   lib/Makefile
       
    70                   src/Makefile
       
    71                   xsl/Makefile
       
    72 +		 xsl/os-brand.xsl
       
    73                   schemas/Makefile
       
    74                   cpe/Makefile
       
    75  		 selinux/Makefile
       
    76 --- openscap-0.9.7/xsl/dbout-html.xsl.~1~	2013-04-23 06:21:52.991000001 -0700
       
    77 +++ openscap-0.9.7/xsl/dbout-html.xsl	2013-10-21 11:38:46.988422014 -0700
       
    78 @@ -36,6 +36,7 @@
       
    79      xmlns:xlink="http://www.w3.org/1999/xlink"
       
    80      exclude-result-prefixes="xsl db exsl htm"
       
    81  	>
       
    82 +<xsl:include href='os-brand.xsl' />
       
    83  
       
    84  <xsl:output method="xml" encoding="UTF-8" indent="no"
       
    85    doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
       
    86 @@ -254,7 +255,23 @@
       
    87  </xsl:template>
       
    88  
       
    89  <xsl:template mode='dbout.html.title' match='db:book/db:title|db:book/db:info/db:title|db:article/db:title|db:article/db:info/db:title'>
       
    90 -  <h1><xsl:call-template name='dbout.html.inline'/></h1>
       
    91 +  <xsl:choose>
       
    92 +    <xsl:when test="$branded='yes'" >
       
    93 +      <table id="header" width="100%">
       
    94 +	<tr id="header" valign="middle">
       
    95 +	  <td id="header">
       
    96 +	    <xsl:call-template name='operating-system-logo'/>
       
    97 +	  </td>
       
    98 +	  <td id="header">
       
    99 +	    <h1><xsl:call-template name='dbout.html.inline'/></h1>
       
   100 +	  </td>
       
   101 +	</tr>
       
   102 +      </table>
       
   103 +    </xsl:when>
       
   104 +    <xsl:otherwise>
       
   105 +      <h1><xsl:call-template name='dbout.html.inline'/></h1>
       
   106 +    </xsl:otherwise>
       
   107 +  </xsl:choose> 
       
   108  </xsl:template>
       
   109  
       
   110  <xsl:template mode='dbout.html.title' match='db:chapter/db:title|db:chapter/db:info/db:title|db:preface/db:title|db:preface/db:info/db:title|db:bibliography/db:title|db:bibliography/db:info/db:title'>
       
   111 @@ -433,7 +450,14 @@
       
   112  <!-- CSS stylesheet -->
       
   113  <xsl:template name='css'>
       
   114    <style type='text/css' media='all'>
       
   115 +    <xsl:choose>
       
   116 +      <xsl:when test="$branded='yes'" >
       
   117 +    html, body { background-color: white; font-family:sans-serif; margin:0; padding:0; }
       
   118 +      </xsl:when>	
       
   119 +      <xsl:otherwise>
       
   120      html, body { background-color: black; font-family:sans-serif; margin:0; padding:0; }
       
   121 +      </xsl:otherwise>
       
   122 +    </xsl:choose>
       
   123      abbr { text-transform:none; border:none; font-variant:normal; }
       
   124      div.score-outer { height: .8em; width:100%; min-width:100px; background-color: red; }
       
   125      div.score-inner { height: 100%; background-color: green; }
       
   126 @@ -476,7 +500,18 @@
       
   127    <style type='text/css' media='screen'>
       
   128      div#content, div#header, div#footer { margin-left:1em; margin-right:1em; }
       
   129      div#content { background-color: white; padding:2em; }
       
   130 +    <xsl:choose>
       
   131 +      <xsl:when test="$branded='yes'" >
       
   132 +    div#header { background-color:red; color:black; text-align:center; }
       
   133 +    div#footer { background-color:red; color:white; text-align:center; }
       
   134 +    table#header { border: 0px solid red; cellpadding="0"; cellspacing="0"; }
       
   135 +    table tr#header { border-bottom: 0px solid red; }
       
   136 +    table td#header { border-right: 0px solid red; }
       
   137 +      </xsl:when>
       
   138 +      <xsl:otherwise>
       
   139      div#footer, div#header { color:white; text-align:center; }
       
   140 +      </xsl:otherwise>
       
   141 +    </xsl:choose>
       
   142      a, a:visited { color:blue; text-decoration:underline; }
       
   143      div#content p.link { text-align:right; font-size:.8em; }
       
   144      div#footer a { color:white; }
       
   145 --- openscap-1.0.0/xsl/oval-results-report.xsl.~1~	2013-11-09 23:53:15.704238495 -0800
       
   146 +++ openscap-1.0.0/xsl/oval-results-report.xsl	2013-11-25 09:52:24.057654433 -0800
       
   147 @@ -79,6 +79,8 @@
       
   148  	<xsl:output method="xml" indent="yes" omit-xml-declaration="no" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
       
   149  	<xsl:key name="definition-index" use="@id" match="//oval-def:oval_definitions/oval-def:definitions/oval-def:definition"/>
       
   150  
       
   151 +        <xsl:include href='os-brand.xsl' />
       
   152 +
       
   153  	<!-- Style declarations for pretty formatting -->
       
   154  	<xsl:template name="oval_res_style">
       
   155  		<style type="text/css">
       
   156 @@ -202,6 +204,21 @@
       
   157  				<xsl:call-template name="oval_res_style"/>
       
   158  			</head>
       
   159  			<body>
       
   160 +                               <xsl:choose>
       
   161 +                                 <xsl:when test="$branded='yes'" >
       
   162 +                                  <div class="header">
       
   163 +                                     <table width="100%" background-color="red">
       
   164 +                                         <tr>
       
   165 +                                             <td>
       
   166 +                                             <xsl:call-template name='operating-system-logo'/>
       
   167 +                                             </td>
       
   168 +                                         </tr>
       
   169 +                                     </table>
       
   170 +                                  </div>
       
   171 +                                  <br/>
       
   172 +                                 </xsl:when>
       
   173 +                               </xsl:choose>
       
   174 +
       
   175  				<!-- display results and definition generator information -->
       
   176  				<table class="noborder nomargin">
       
   177  					<tr>
       
   178 --- openscap-1.0.0/xsl/xccdf-report.xsl.~1~	2013-11-09 23:53:15.704238495 -0800
       
   179 +++ openscap-1.0.0/xsl/xccdf-report.xsl	2013-12-11 08:28:42.382923806 -0800
       
   180 @@ -40,6 +40,7 @@
       
   181  <xsl:import href="security-guide.xsl" />
       
   182  <xsl:import href="oval-report.xsl" />
       
   183  <xsl:import href="sce-report.xsl" />
       
   184 +<xsl:import href="os-brand.xsl" />
       
   185  
       
   186  <xsl:output method="xml" encoding="UTF-8" indent="yes"/>
       
   187  
       
   188 @@ -134,7 +135,14 @@
       
   189          id='{@id}'
       
   190      >
       
   191      <info>
       
   192 -        <title>XCCDF Test Result</title>
       
   193 +        <xsl:choose>
       
   194 +          <xsl:when test="$branded='yes'" >
       
   195 +            <title>Compliance Report</title>
       
   196 +          </xsl:when>
       
   197 +          <xsl:otherwise>
       
   198 +            <title>XCCDF Test Report</title>
       
   199 +          </xsl:otherwise>
       
   200 +        </xsl:choose>
       
   201          <xsl:call-template name='footerinfo'/>
       
   202      </info>
       
   203  
       
   204 @@ -348,8 +356,10 @@
       
   205      <xsl:call-template name='idents'/>
       
   206      <!-- overrides (n) -->
       
   207      <!-- messages (n) -->
       
   208 -    <xsl:apply-templates select='$rule/cdf:fixtext[1]'/>
       
   209 -    <xsl:apply-templates select='($rule/cdf:fix|cdf:fix)[last()]'/>
       
   210 +        <xsl:if test="cdf:result='fail'" >
       
   211 +          <xsl:apply-templates select='$rule/cdf:fixtext[1]'/>
       
   212 +          <xsl:apply-templates select='($rule/cdf:fix|cdf:fix)[last()]'/>
       
   213 +        </xsl:if>
       
   214      <xsl:apply-templates select='.' mode='engine-results'/>
       
   215      <xsl:call-template name='references'/>
       
   216    </section>