Net::SecurityCenter::REST - Perl interface to (SecurityCenter) REST API


    use Net::SecurityCenter::REST;

    my $sc = Net::SecurityCenter::REST('');

    if (! $sc->login('secman', 'password')) {
        die $sc->error;

    my $running_scans = $sc->get('/scanResult', { filter => 'running' });



This module provides Perl scripts easy way to interface the REST API of (SecurityCenter).

For more information about the (SecurityCenter) REST API follow the online documentation:


Net::SecurityCenter::REST->new ( host [, $params ] )

Create a new instance of Net::SecurityCenter::REST.


  • timeout : Request timeout in seconds (default is 180) If a socket open, read or write takes longer than the timeout, an exception is thrown.

  • ssl_options : A hashref of SSL_* options to pass through to IO::Socket::SSL.

  • logger : A logger instance (eg. Log::Log4perl, Log::Any or Mojo::Log) for log the REST request and response messages.

  • scheme : URI scheme (default: HTTPS).


$sc->post|get|put|delete|patch ( $path [, \%params ] )

Execute a request to REST API. These methods are shorthand for calling request() for the given method.

    my $nessus_scan = $sc->post('/scanResult/1337/download',  { 'downloadType' => 'v2' });

$sc->request ( $method, $path [, \%params ] )

Execute a HTTP request of the given method type ('GET', 'POST', 'PUT', 'DELETE', ''PATCH') to REST API.

$sc->login ( ... )

Login into using username/password or API Key.

Username and password authentication

    $sc->login( $username, $password ):
    $sc->login( username => ..., password => ... );

API Key authentication

Since Tenable.SC 5.13 it's possibile to use API Key authentication using access_key and secret_key:

    $sc->login( access_key => ..., secret_key => ... );

More information about API Key authentication:


Logout from

$sc->upload ( $file )

Upload a file into


Catch the errors and return Net::SecurityCenter::Error class.


Bugs / Feature Requests

Please report any bugs or feature requests through the issue tracker at You will be notified automatically of any progress on your issue.

Source Code

This is open source software. The code repository is available for public review and contribution under the terms of the license.

    git clone


  • Giuseppe Di Terlizzi <>


This software is copyright (c) 2018-2020 by Giuseppe Di Terlizzi.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.