Qualys - connect to the Qualys scanner API with perl


  use Qualys;
  $q = new Qualys;
  #.... and so on
  #or set multiple attributes
  save_report => 'yes',
  specific_vuln => $number
  #.. any other attributes you'd like
  $script = 'scan.php';
  $xml_data = $q->connect_to($script); #scanning takes a while

  #now just process the XML data in $xml_data as you wish
  #maybe use XML::Twig

Again, see the for all the other functions and attributes that you can use.


This module is a wrapper for connecting and using the QualysGuard API for all Qualys partners. It will take care of authentication and creating the correct uri based on the options provided and the selected API script.

Using the Qualys (specifically QualysGuard) API one can integrate QualysGuard into individual appplications using perl. The QualysGuard partners can access security auditing, network discovery, preferences, remediation ticket updates, and user enrollment functions using this interface.


The Qualys module inherits the LWP::UserAgent module in order to provide a specific authentication function for get_basic_credentials(). Most likely, you are using this module because you own some Qualys scanners. Therefore, please go through all the Qualys documentation, specifically


Sets the username to use when authenticating to the QualysGuard API.


Sets the password to use when authenticating to the QualysGuard API.


Sets the Qualys API host. The default value is and it should probably be this unless it is changed in a future release.


Sets the URI to the API. Please note a url should be given with the https. This is to ensure that if the URL ever changes in the future, this module is still adaptable. The default path is set to:


Sets the attributes that will be given to the API script. Example,

  iscanner_name => 'qualys_scanner_name',
  save_report => 'yes',
  ref => '{referenceCode}',
  domain => '',
  ... whatever your heart desires ...


Clears all the attributes saved so far using set_attribs().


Connects to the API and executes the specific script name (usually a php script) with the given attributes (see set_attrib()) and returns the xml response from the server. Depending on the script executed, this can take from seconds to minutes.


For some advanced programmers that know what they are doing, I have written a fancy version AUTOLOAD() that automatically creates and sets the corresponding attributes -- this is in order to support all possible attributes. Therefore, you can use any attributes mentioned in the Qualys API documentation, to set the attributes that will be used when you connect to the API script.

 $qapi->asset_groups('ThisIsMyGroup'); #sets asset_groups to ThisIsMyGroup
 $qapi->loadbalancer('no'); #sets loadbalancer attribute to 'no'
 $qapi->ip('{,}'); #sets ip attribute to {,}
 .. and so on ...

I mention this is for advanced users, because doing this is a short cut to using set_attribs() - and therefore watch mispellings.


XML::Twig, The Qualys Scanner website: For all the QualysGuard API information see


Anthony G Persaud <>


This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.7 or, at your option, any later version of Perl 5 you may have available.

QualysGuard is a registered trademark of Qualys, Inc. Qualys and the Qualys logo are trademarks of Qualys, Inc. All other trademarks are the property of their respective owners.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 200:

=back doesn't take any parameters, but you said =back 4