The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

OpenVAS::OMP - Pure-perl interface to the OpenVAS Management Protocol

SYNOPSIS

        use OpenVAS::OMP;

        my $omp = OpenVAS::OMP->new(
                host            => 'localhost',
                ssl_verify      => 1,
                username        => 'ttester',
                password        => 'Th!s-Is,S3crEt',
                port            => 9390,
        );

        my $hashrefRequest      = $omp->commandHash( $hashref );
        my $xmlRequest          = $omp->commandXML( '<get_info name="CVE-2010-1234" type="cve" details="1"/>', 1 );
        my $version             = $omp->getVersion;

DESCRIPTION

This module is a simple pure perl interface to the OpenVAS Management Protocol (OMP). It provides and similar functionality as the OMP-CLI client (shipped with OpenVAS).

METHODS

new( configuration hash )

The class constructor. It accepts serveral configuration arguments (some of them which are optional).

host

Optional argument. Defaults to 'localhost'. This arguments tells the module the hostname of the server to connect to.

port

Optional argument. Defaults to '9390'. Use this argument to provide the server port for the OMP server.

username

Provide a username to authenticate to the OMP server. This argument is not needed for the getVersion() call.

password

Provide a password to authenticate to the OMP server. This argument is not needed for the getVersion() call.

ssl_verify

Optional argument. Defaults to '1' (true). Tell IO::Socket::SSL to verify the SSL certificate on the OMP server. If this argument is set to true and the server certificate is not valid, no connection will be established. If set to '0' or 'undef' the module will not perform any SSL certificate validation (which is not a good idea).

getVersion()

Get the version string from the OMP server. This call doesn't require any user authentication, so username and password arguments are not required in the constructor call.

commandXML( XML string [, request raw response ] )

Query the OMP server with the provided XML string. The resposne will be a hashref with the server response. If you prefer the raw XML output from the server, the optional request raw response argument can be set.

commandHash( hashref [, request raw response ] )

Query the OMP server with the provided hashref. The call will take the hashref and convert it to a XML string and will then query the OMP server. The resposne will be a hashref with the server response. If you prefer the raw XML output from the server, the optional request raw response argument can be set.

DEVELOPMENT

The project and the latest code can be found on BitBucket: https://bitbucket.org/wneessen/openvas-omp/

COPYRIGHT

Copyright (C) 2013 by Winfried Neessen <wn@neessen.net>. Published under the terms of the Artistic License 2.0.