[Open-scap] report branding patch.

Jacob Varughese jacob.varughese at oracle.com
Wed May 28 16:41:43 UTC 2014


On 05/28/14 05:37 AM, Greg Elin wrote:
> Jacob,
> +1 for a customization option. I think it is critical.
>
> FWIW, the best situation would be to reference customizations in a directory outside of the SSG directories.
>
> Greg Elin
> P: 917-304-3488
> E:  gregelin at gitmachines.com
>
> Sent from my iPhone
>
>> On May 28, 2014, at 7:18 AM, Martin Preisler <mpreisle at redhat.com> wrote:
>>
>> ----- Original Message -----
>>> From: "Jacob Varughese" <jacob.varughese at oracle.com>
>>> To: open-scap-list at redhat.com
>>> Sent: Tuesday, May 27, 2014 6:43:22 PM
>>> Subject: [Open-scap] report branding patch.
>>>
>>>
>>> Hi All,
>>> The following is a patch to generate a branded report.
>>> What we have done is added a configure option --with-report-branding to
>>> generate the reports with vendor specific brand and logo.
>>> If the option is not used reports get generated using the default
>>> template and colors. It generates an os-brand.xsl file in source/xsl
>>> folder which gets used to generate a report with a logo and branded
>>> colors or one without.
>>> The argument to --with-report-branding option is the path to the logo
>>> file. This is what we did to tailor our report. Not sure if you
>>> would want such a patch. Please take a look and let me know.
>>> Thank you, Jacob.
>> Hi,
>> the intended use is for downstreams to patch os-brand.xml with their own logo and colors, is that correct? Could you send the rest of the patch? I don't see any configure option added in these hunks.
>>
>> The patch has inconsistent indentation, please try to match the indentation of the original file.
Sorry, attached the configure fix and also the xccdf-report says Scan 
Report.
Thank you,
Jacob.
>>
>>>  From 960e4e53a5e0ac6d52679e687b9265f17c6e490b Mon Sep 17 00:00:00 2001
>> This sha doesn't reference any object in the git repo and the date is definitely wrong, unless you have a time machine ;-)
>>
>>> -        <title>Scan Report</title>
>>> +        <xsl:choose>
>>> +          <xsl:when test="$branded='yes'" >
>>> +            <title>Compliance Report</title>
>>> +          </xsl:when>
>>> +          <xsl:otherwise>
>>> +            <title>XCCDF Test Report</title>
>>> +          </xsl:otherwise>
>>> +        </xsl:choose>
Sorry that should have been Scan Report. It was XCCDF Test Report at 
some earlier point.
>> This changes behavior needlessly. "Scan Report" -> "XCCDF Test Report". Is there any reason for that?
>>
>> Wouldn't it be easier to just let downstreams patch one file that is included by both OVAL and XCCDF reports? Upstream release would just have a title in there.
>>
>> -- 
>> Martin Preisler
>>
>> _______________________________________________
>> Open-scap-list mailing list
>> Open-scap-list at redhat.com
>> https://www.redhat.com/mailman/listinfo/open-scap-list

-------------- next part --------------
>From 9098ea2e1f9758249bbf34fe552d8a8be2cfea0c Mon Sep 17 00:00:00 2001
From: Jacob Varughese <jacob.varughese at oracle.com>
Date: Wed, 28 May 2014 09:39:08 -0700
Subject: [PATCH] report branding

---
 configure.ac         |   18 ++++++++++++++++++
 xsl/xccdf-report.xsl |   10 +++++++++-
 2 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 5538edb..759c5ab 100644
--- a/configure.ac
+++ b/configure.ac
@@ -249,6 +249,7 @@ probe_dpkginfo_req_deps_ok=yes
 probe_dpkginfo_req_deps_missing=
 probe_dpkginfo_opt_deps_ok=yes
 probe_dpkginfo_opt_deps_missing=
+report_branding=
 
 #
 # env
@@ -1043,6 +1044,22 @@ AC_ARG_WITH([crypto],
      [],
      [crypto=gcrypt])
 
+#used for generating os-brand.xsl
+AC_ARG_WITH([report-branding],
+     [AS_HELP_STRING([--with-report-branding=<location of the branded logo template> enables report-branding.])],
+     [report_branding="${with_report_branding}"],
+     [])
+
+notbranded='<xsl:template name="operating-system-logo"/>'
+osbranded="<xsl:include href='${report_branding}' />"
+if test  "x${report_branding}" = "x" ; then
+AC_SUBST([BRANDED], "no")
+AC_SUBST([BRANDTEMPLATE], "${notbranded}")
+else
+AC_SUBST([BRANDED], "yes")
+AC_SUBST([BRANDTEMPLATE], "${osbranded}")
+fi
+
 if test "x${libexecdir}" = xNONE; then
 	probe_dir="/usr/local/libexec/openscap"
 else
@@ -1254,6 +1271,7 @@ AC_CONFIG_FILES([Makefile
                  lib/Makefile
                  src/Makefile
                  xsl/Makefile
+		 xsl/os-brand.xsl
                  schemas/Makefile
                  cpe/Makefile
 		 selinux/Makefile
diff --git a/xsl/xccdf-report.xsl b/xsl/xccdf-report.xsl
index 5d72ddf..eb84012 100644
--- a/xsl/xccdf-report.xsl
+++ b/xsl/xccdf-report.xsl
@@ -40,6 +40,7 @@ Authors:
 <xsl:import href="security-guide.xsl" />
 <xsl:import href="oval-report.xsl" />
 <xsl:import href="sce-report.xsl" />
+<xsl:import href="os-brand.xsl" />
 
 <xsl:output method="xml" encoding="UTF-8" indent="yes"/>
 
@@ -134,7 +135,14 @@ Authors:
         id='{@id}'
     >
     <info>
-        <title>Scan Report</title>
+        <xsl:choose>
+          <xsl:when test="$branded='yes'" >
+            <title>Compliance Report</title>
+          </xsl:when>
+          <xsl:otherwise>
+            <title>Scan Report</title>
+          </xsl:otherwise>
+        </xsl:choose>
         <xsl:call-template name='footerinfo'/>
     </info>
 
-- 
1.7.9.2



More information about the Open-scap-list mailing list