Net::SecurityCenter::API::Scan - Perl interface to Tenable.sc (SecurityCenter) Scan REST API
use Net::SecurityCenter::REST; use Net::SecurityCenter::API::Scan; my $sc = Net::SecurityCenter::REST->new('sc.example.org'); $sc->login('secman', 'password'); my $api = Net::SecurityCenter::API::Scan->new($sc); my $scan_id = $api->add( name => 'Test API scan', target => [ '192.168.1.2', '192.168.1.3' ], description => 'Test from Net::SecurityCenter Perl module', policy => 1, repository => 2, zone => 1 ); $sc->logout();
This module provides Perl scripts easy way to interface the Scan REST API of Tenable.sc (SecurityCenter).
For more information about the Tenable.sc (SecurityCenter) REST API follow the online documentation:
https://docs.tenable.com/sccv/api/index.html
Create a new instance of Net::SecurityCenter::API::Scan using Net::SecurityCenter::REST class.
Get list of scans.
Params:
fields : List of fields
fields
filter : Filter (usable, manageable)
filter
usable
manageable
Create a new scan on Tenable.sc (SecurityCenter) and return the scan_id (or scan_result_id for schedule=now argument).
scan_id
scan_result_id
schedule=now
my $scan_id = $scan->add( name => 'Test API scan', target => [ '192.168.1.2', '192.168.1.3' ], description => 'Test from Net::SecurityCenter Perl module', policy => 1, repository => 2, zone => 1 );
name : Name of scan (required)
name
description : Description of scan
description
type : Type of scan
type
policy: Create a policy scan (need policy)
policy
plugin: Create a plugin scan (need plugin)
plugin
targets : Array of targets (IP, subnet or ranges)
targets
assets : Array of Asset ID
assets
zone : Scan Zone ID (default: 0)
zone
0
policy : Policy ID for type=policy scan type
type=policy
plugin : Plugin ID for type=plugin scan type
type=plugin
repository : Repository ID
repository
credentials : Array of credential ID (default: [])
credentials
[]
max_time : Max scan time (default: 3600)
max_time
3600
email_on_launch : Send the email on scan launch (default: 0)
email_on_launch
email_on_finish : Send the email on scan finish (default: 0)
email_on_finish
dhcp_tracking : Enable DHCP tracking (default: 0)
dhcp_tracking
rollover : Rollover type on timeout action
rollover
timeout
Allowed values:
nextDay
template (default)
template
timeout : Timeout action
discard
import (default)
import
reports : Reports hash ( id => type )
reports
schedule : Schedule type
schedule
dependent
ical
never
now (Execute the scan on Nessus scanner and return the scan result id)
now
id
Launches the scan associated with id to Nessus scanner.
id : Scan ID
diagnostic_target : Valid IP/hostname
diagnostic_target
diagnostic_password : Diagnostic password
diagnostic_password
This is a facility for run immediatly a scan in Tenable.sc (SecurityCenter) using Nessus Scanner without create a scan.
NOTE: This method is an alias for $sc->add ( schedule => 'now', ... ).
$sc->add ( schedule => 'now', ... )
See $sc->add paragraph for information about the allowed params.
$sc->add
params
Delete the scan associated with id.
Please report any bugs or feature requests through the issue tracker at https://github.com/giterlizzi/perl-Net-SecurityCenter/issues. You will be notified automatically of any progress on your issue.
This is open source software. The code repository is available for public review and contribution under the terms of the license.
https://github.com/giterlizzi/perl-Net-SecurityCenter
git clone https://github.com/giterlizzi/perl-Net-SecurityCenter.git
Giuseppe Di Terlizzi <gdt@cpan.org>
This software is copyright (c) 2018-2023 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.
To install Net::SecurityCenter, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::SecurityCenter
CPAN shell
perl -MCPAN -e shell install Net::SecurityCenter
For more information on module installation, please visit the detailed CPAN module installation guide.