NAME
Net::SecurityCenter - Perl interface to Tenable SecurityCenter REST API
SYNOPSIS
use Net::SecurityCenter;
my $sc = Net::SecurityCenter('sc.example.org');
$sc->login('secman', 'password');
my $running_scans = $sc->get_running_scan;
$sc->logout();
DESCRIPTION
This module provides Perl scripts easy way to interface the REST API of Tenable SecurityCenter.
For more information about the SecurityCenter REST API follow the online documentation:
https://docs.tenable.com/sccv/api/index.html
CONSTRUCTOR
Net::SecurityCenter->new ( host [, { timeout => $timeout , ssl_options => $ssl_options } ] )
Create a new instance of Net::Security::Center using Net::Security::Center::REST package.
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 ofSSL_*options to pass through to IO::Socket::SSL.
CORE METHODS
$sc->rest ()
Return the instance of Net::SecurityCenter::REST class
$sc->login ( username, password )
Login into SecurityCenter.
$sc->logout
Logout from SecurityCenter.
SCAN METHODS
$sc->add_scan ( name => $name, ipList => $ip_list, description => $description, policy => $policy_id, repository => $repository_id, zone => $zone_id )
Create a new scan on SecurityCenter.
$sc->add_scan(
name => 'Test API scan',
ipList => [ '192.168.1.2', '192.168.1.3' ],
description => 'Test from Net::SecurityCenter Perl module',
policy => 1,
repository => 2,
zone => 1
);
Params:
name: Name of scan (required)description: Description of scanipList: One or more IP addresszone: Scan Zone IDpolicy: Policy IDrepository: Repository IDmaxScanTime: Max Scan Time
$sc->download_nessus_scan ( scan_id [, filename ] )
Download the Nessus (XML) scan result.
my $nessus_scan = $sc->download_nessus_scan(1337);
$sc->download_nessus_scan(1337, '/var/nessus/scans/1337.nessus');
$sc->get_scan_list ( [ fields => $fields, filter => $filter ] )
Get list of scans (completed, running, etc.).
$sc->get_running_scans ( [fields] )
Get list of running scans.
$sc->get_completed_scans ( [fields] )
Get list of completed scans
$sc->get_scan ( scan_id [, fields ] )
Get scan information.
$sc->get_scan_progress ( scan_id )
Get scan progress.
print 'Scan progress: ' . $sc->get_scan_progress(1337) . '%';
$sc->get_scan_status ( scan_id )
Get scan status.
print 'Scan status: ' . $sc->get_scan_status(1337);
$sc->pause_scan ( scan_id )
Pause a scan.
if ($sc->get_scan_status(1337) eq 'running') {
$sc->pause_scan(1337);
}
$sc->resume_scan ( scan_id )
Resume a paused scan.
if ($sc->get_scan_status(1337) eq 'paused') {
$sc->resume_scan(1337);
}
$sc->stop_scan ( scan_id )
Stop a scan.
if ($sc->get_scan_status(1337) eq 'running') {
$sc->stop_scan(1337);
}
PLUGIN METHODS
$sc->get_plugin_list ( [ fields ] )
Gets the list of all Nessus Plugins.
$sc->get_plugin ( plugin_id [, fields ] )
Get information about Nessus Plugin.
$sc->get_plugin(19506, [ 'description', 'name' ]);
$sc->get_plugin_family_list ( [ fields ] )
Get list of Nessus Plugin Family.
$sc->get_plugin_family ( plugin_family_id [, fields ])
Get ifnrmation about Nessus Plugin Family.
SYSTEM INFORMATION AND MAINTENANCE METHODS
$sc->get_status ( [ fields ] )
Gets a collection of status information, including license.
$sc->get_system_info ()
Gets the system initialization information.
$sc->get_system_diagnostics_info ()
Gets the system diagnostics information.
$sc->generate_app_status_diagnostics ()
Starts an on-demand, diagnostics analysis for the System that can be downloaded after its job completes.
$sc->generate_diagnostics_file ( [ options ] )
Starts an on-demand, diagnostics analysis for the System that can be downloaded after its job completes.
$sc->download_system_diagnostics ()
Downloads the system diagnostics, debug file that was last generated.
$sc->get_feed ( [ type ] )
REPOSITORY METHODS
$sc->get_repository_list ( [ fields ] )
$sc->get_repository ( repository_id [, fields ])
$sc->get_device_info ( repository_id, ip_address [, params ] )
$sc->get_ip_info ( ip_address [, params ])
SCAN ZONE METHODS
$sc->get_scan_zone_list ( [ fields ] )
$sc->get_scan_zone ( zone_id [, fields ] )
SCAN POLICY METHODS
$sc->get_policy_list ( [ fields ] )
$sc->get_policy ( policy_id [, fields ])
REPORT METHODS
$sc->get_report_list ( [ fields ] )
$sc->get_report ( report_id [, fields ])
$sc->download_report ( report_id )
USER METHODS
$sc->get_user_list ( [ fields ] )
$sc->get_user ( user_id [, fields ] )
CREDENTIAL METHODS
$sc->get_credential_list ( [ fields ] )
$sc->get_credential ( credential_id [, fields ] )
SUPPORT
Bugs / Feature Requests
Please report any bugs or feature requests through the issue tracker at https://github.com/LotarProject/perl-Net-SecurityCenter/issues. 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.
https://github.com/LotarProject/perl-Net-SecurityCenter
git clone https://github.com/LotarProject/perl-Net-SecurityCenter.git
AUTHORS
Giuseppe Di Terlizzi <gdt@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2018 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.