OpenVAS: Customizing PDF-Reports

introduction

On this page I describe a few simple steps to individualize the standard pdf reports of openvas.

The two files for the PDF report are in the directory

/usr/local/share/openvas/openvasmd/global_report_formats/c402cc3e-b531-11e1-9163-406186ea4fc5/

generate = Batch file that generates a latex file from an xml report with the help of an xsl file and converts it later to a pdf
latex.xsl = Stylesheet to transform xml-report to latex.

In order to individualize the report, the latex.xsl must be edited.

The own logo on the first page

I use a logo with 360 x 360 pixels, which is available as png file.

First copy the file logo.png into the above mentioned folder.

Before you edited the latex.xsl should make a security copy. 🙂

To use images, the package “graphicx” has to be imported in the header section.

<!-- The latex header. -->
 <xsl:template name="header">
 <xsl:text>\documentclass{article}
\pagestyle{empty}

%\usepackage{color}
\usepackage{tabularx}
\usepackage{geometry}
\usepackage{comment}
\usepackage{longtable}
\usepackage{titlesec}
\usepackage{chngpage}
\usepackage{calc}
\usepackage{url}
\usepackage[utf8x]{inputenc}
\usepackage{graphicx}

At the start page, a distinction is made between the type of report to be created

  • Delta Report
  • Prognostic Report
  • Scan report
<xsl:choose>
 <xsl:when test="openvas:report()/delta">
 <xsl:text>\title{Delta Report}</xsl:text>
 </xsl:when>
 <xsl:when test="openvas:report()/@type = 'prognostic'">
 <xsl:text>\title{Prognostic Report}</xsl:text>
 </xsl:when>
 <xsl:otherwise>
 <xsl:text>\title{Scan Report}</xsl:text>
 </xsl:otherwise>
</xsl:choose>

Since I currently use only scanreports I add the logo at this point and changed the text.

The command to include the picture is:

\includegraphics[width=3cm]{Logo}

The whole section now looks like this:

<xsl:otherwise>
<xsl:text>\title{\includegraphics[width=3cm]{Logo}\newline Scan Bericht -Stadtverwaltung Neustadt an der Weinstraße \newline }</xsl:text>
 </xsl:otherwise>

And the first page of the report now graces my logo.

Bericht-nw

In the occasion I have translated a few texts.

My second attempt OpenVAS: PDF report insert head an foot

 

Advertisements

One thought on “OpenVAS: Customizing PDF-Reports

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s