OpenVAS Change Request #48: Define OMP and OAP in RelaxNG Schema Language
Status: Voted +5. Done: OpenVAS Manager and OpenVAS Administrator of OpenVAS-4 can provide the protocol specification via command "help".
Purpose
- support API developers to implement OMP and OAP clients or client-APIs
- help to make and keep the protocols consistent
- enable test suites to be written for both client and server side of OMP and OAP
References
- Matthew Mundell about not working OMP tests in SVN
- Comments on OMP from Hartmut Goebel
- Several discussions on how to use the OMP command line client, e.g. this thread
Rationale
Documenting OMP and OAP in a formal schema would help keeping the OMP and OAP documentation up to date. This would
- support API developers to implement OMP and OAP client-APIs
- help finding redundancies, contradictions and other inconsistencies in the OMP and OAP specification and during further development of these protocols
- enable test suites to be written for both client and server side of OMP and OAP
Design and Implementation
For the schema syntax, Relax NG compact syntax (RNC) is proposed. While there are many other schema definition syntaxes (DTD, Relax NG normal syntax, XML Schema Definition, etc.) RNC has the benefits of being compact and easy to read. RNC uses some kind of Backus-Naur-Form (BNF), which many software developers should be used to.
If required, Relax NG compact syntax can be converted into DTD, Relax NG normal syntax or XML Schema Definition using the tool trang (or others). XML documents can be validated against Relax NG using e.g. libxml2 or emacs' nXML-mode. Syntax-highlighting can be done with e.g. Syntax-higlight.
Here is a simple RelaxNG example for the create_agent OMP command:
create_agent = element create_agent { elem.name, comment?, installer, howto_use?, howto_install? } installer = element installer { Base64.datatype } howto_use = element howto_use { text } howto_install = element howto_install { text }
And here is an example for the OAP get_settings_response:
get_settings = element get_settings { empty } get_settings_response = element get_settings_response { Status.attribs, element scanner_settings { attribute sourcefile, attribute editable [ "0" | "1" ], setting.get } setting.get = element setting { attribute name, text } modify_settings = element modify_settings { setting.modify? } setting.modify = element setting { element name { text }, element value { text } }
- A draft version of omp-1.0.rnc exists, written by Hartmut Goebel (see attachment to this message on openvas-devel). As of this initial writing, this draft is known to be incomplete and erroneous. Developers of openvas-manager are requested to complete and correct this draft.
- A draft version of oap-1.0.rnc exists, written by Hartmut Goebel. This draft is quite complete yet. Nevertheless developers of openvas-administrator are requested to complete and correct this draft.
Suggested Changes
- A file omp-1.0.rnc will be added to openvas-manager. This file defines the schema syntax of OMP Version 1.0. Until OMP Version 1.0 has stabilised, this file has to be updated whenever the implementation changes. This has to be done by the developer implementing the change.
- A file oap-1.0.rnc will be added to openvas-administrator. This file defines the schema syntax of OAP Version 1.0. Until OAP Version 1.0 has stabilised, this file has to be updated whenever the implementation changes. This has to be done by the developer implementing the change.
Future directions
Matthew Mundell suggested to extend the RNG file to also describe the behaviour of the commands. So the RNG could replace the description in the CR. Maybe with Doxygen comments can be used for this.
Effects
This is a new component. No effects to any currently existing component.
History
- 2010-01-24 Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>:
Setting status to "Done". - 2010-08-18 Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>:
Setting status to "in progress". - 2010-08-09 Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>:
Editorial Changes. Move technical design aspects from section "rationale" to "design and implementation". - 2010-05-17 Hartmut Goebel <h.goebel@goebel-consult.de>:
Editorial Changes. Added "Future directions". - 2010-05-06 Hartmut Goebel <h.goebel@goebel-consult.de>:
Added OAP and OAP example. Syntax highlight for examples. - 2010-04-22 Hartmut Goebel <h.goebel@goebel-consult.de>:
Initial text.
English |
