[Openvas-commits] r8859 - in trunk/openvas-manager: . doc
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Fri Aug 20 02:17:49 CEST 2010
Author: mattm
Date: 2010-08-20 02:17:44 +0200 (Fri, 20 Aug 2010)
New Revision: 8859
Modified:
trunk/openvas-manager/ChangeLog
trunk/openvas-manager/doc/report-format-HOWTO
Log:
* report_formats/README: Reorder sections. Rewrite the "Developing
a new..." section in terms of the example report formats.
Modified: trunk/openvas-manager/ChangeLog
===================================================================
--- trunk/openvas-manager/ChangeLog 2010-08-19 22:06:54 UTC (rev 8858)
+++ trunk/openvas-manager/ChangeLog 2010-08-20 00:17:44 UTC (rev 8859)
@@ -1,5 +1,10 @@
2010-08-19 Matthew Mundell <matthew.mundell at greenbone.net>
+ * report_formats/README: Reorder sections. Rewrite the "Developing
+ a new..." section in terms of the example report formats.
+
+2010-08-19 Matthew Mundell <matthew.mundell at greenbone.net>
+
* src/manage_sql.c (create_lsc_credential): Limit name to alphanums.
* src/omp.c (omp_xml_handle_end_element): In CLIENT_CREATE_LSC_CREDENTIAL
Modified: trunk/openvas-manager/doc/report-format-HOWTO
===================================================================
--- trunk/openvas-manager/doc/report-format-HOWTO 2010-08-19 22:06:54 UTC (rev 8858)
+++ trunk/openvas-manager/doc/report-format-HOWTO 2010-08-20 00:17:44 UTC (rev 8859)
@@ -8,61 +8,76 @@
Global report formats are visible to all users.
-Creating a new predefined report format
----------------------------------------
+Adding a report format to an existing OpenVAS Manager installation
+------------------------------------------------------------------
-To add a new predefined global report format to OpenVAS Manager (typically in
-SVN):
+Use the CREATE_REPORT_FORMAT OMP command to install the report format. The
+GSA provides an upload option for this on the "Report Formats" page.
- - Add a new directory in src/report_formats for the format. The directory
- must have the same name as the report.
- - Add a file called "generate" in this new directory. This is the generator
- shell script. The Manager passes this to bin/sh to create the report.
- The generator is passed a single argument: the location of a file containing
- the report as XML.
+Developing a new report format for upload into a running OpenVAS Manager
+------------------------------------------------------------------------
- - Add any files that the generator needs to the directory. Typically this is
- a single XSLT file.
+To create a new report format
- - In init_manage in src/manage_sql.c add code to initialise the format in
- the database.
+ - Copy the source directory for one of the example reports included with
+ the Manager source. They are located in openvas-manager/report_formats.
- - Update src/CMakeLists.txt to install the new files in src/report_format.
+ - There is a "create_report_import" script in the directory. It contains the
+ data that describes the new format, like the name and file extension.
+ Modify the data to suit the new format.
+ - There is also a script called "generate". This is what the Manager will run
+ to generate the report. The Manager will pass the script a single argument,
+ the location of a file containing the OMP report (in XML, as returned by
+ GET_REPORTS). The output of the script will be the resulting report.
-Adding a report format to an existing OpenVAS Manager installation
-------------------------------------------------------------------
+ Modify this script to suit the new format. Typically the script will call
+ xsltproc to transform the XML in some way.
-Use the CREATE_REPORT_FORMAT OMP command to install the report format. The
-GSA provides an upload option for this on the "Report Formats" page.
+ - Add any files required by the "generate" script to the directory. Typically
+ this is a single XSLT file that is passed to xsltproc.
+ - Update the "create_report_import" script to include the files added to the
+ directory in the last step.
-Developing a new report format using an existing OpenVAS Manager installation
------------------------------------------------------------------------------
+ - Test the generate script
-To add a new global report format to an OpenVAS Manager that is installed
-in PREFIX:
+ - Get an OMP report (download the report with the GSA, or do a GET_REPORTS
+ request with some other client like the omp command).
- - Add a new directory in PREFIX/etc/openvas/openvasmd/global_report_formats
- for the format. The directory must have the same name as the report.
+ - Run the command
+ . generate report.xml
+
+ in the report format directory, where report.xml is the name of the
+ report from the previous step. The output should be the required
+ report.
+
+ - Create the report format by running
+
+ . create_report_import
+
+ in the report format directory.
+
+Creating a new predefined report format
+---------------------------------------
+
+To add a new predefined global report format to OpenVAS Manager (typically in
+SVN):
+
+ - Add a new directory in src/report_formats for the format. The directory
+ must have the same name as the report.
+
- Add a file called "generate" in this new directory. This is the generator
shell script. The Manager passes this to bin/sh to create the report.
The generator is passed a single argument: the location of a file containing
the report as XML.
- - Add files that the generator needs to the directory. Typically this is
+ - Add any files that the generator needs to the directory. Typically this is
a single XSLT file.
- - Make a UUID for the report (for example with the uuid command).
+ - In init_manage in src/manage_sql.c add code to initialise the format in
+ the database.
- - Manually add the report format to the database with this UUID. The SQL to
- add report format "CPE" is
-
- INSERT into report_formats
- (uuid, owner, name, summary, description, extension, content_type)
- VALUES
- (NEW_UUID, NULL, 'CPE', 'Summary of CPE format (one line).',"
- 'Desciption of CPE format (longer than summary).\n',"
- 'csv', 'text/csv');"
+ - Update src/CMakeLists.txt to install the new files in src/report_format.
More information about the Openvas-commits
mailing list