#!/usr/bin/perl

use strict;
use warnings;
use utf8;

use App::TenableSC::API;

App::TenableSC::API->run();

__END__
=encoding utf-8

=head1 NAME

sc-api - Tenable.sc (SecurityCenter) API command line interface

=head1 SYNOPSIS

    sc-api [COMMAND] [OPTIONS]

    Commands:

        analysis
        credential
        device-info
        feed
        file
        notification
        plugin
        plugin-family
        policy
        report
        repository
        scan
        scan-result
        scanner
        status
        system
        user
        zone

    Options:
        --help              Brief help message
        --man               Full documentation
        --verbose           Print more info during run

        --hostname          Tenable.sc (SecurityCenter) host/IP address
        --username          Username
        --password          Password

        --access_key        Access Key
        --secrey_key        Secret Key

        --ssl_cert_file     Certificate file
        --ssl_cert_key      Certificate private key
        --ssl_password      Private key password (optional)

        --config [FILE]     Configuration file

        --format [TYPE]     Output format (default: json)
                                - json (require JSON or JSON::XS modules)
                                - dumper (Data::Dumper)
                                - csv (Comma Separated Values)
                                - tsv (Tab Separated Values)
                                - table
                                - yaml (require YAML or YAML::XS modules)

        --table             Table output format (--format=table)
        --csv               CSV output format (--format=csv)
        --tsv               TSV output format (--format=tsv)
        --dumper            Data::Dumper format (--format=dumper)
        --json              JSON output format (--format=json)
        --yaml              YAML output format (--format=yaml)

    Examples:

        Download a plugin from Tenable.sc:

            sc-api plugin download id=19506

        View Tenable.sc policy:

            sc-api policy get id=1

=head1 DESCRIPTION

C<sc-api> Tenable.sc (SecurityCenter) API command line interface.

=head1 COMMANDS

=head2 analysis

See L<Net::SecurityCenter::API::Analysis> class.

=head2 credential

See L<Net::SecurityCenter::API::Analysis> class.

=head2 device-info

See L<Net::SecurityCenter::API::DeviceInfo> class.

=head2 feed

See L<Net::SecurityCenter::API::Feed> class.

=head2 file

See L<Net::SecurityCenter::API::File> class.

=head2 notification

See L<Net::SecurityCenter::API::Notification> class.

=head2 plugin

See L<Net::SecurityCenter::API::Plugin> class.

=head2 plugin-family

See L<Net::SecurityCenter::API::PluginFamily> class.

=head2 policy

See L<Net::SecurityCenter::API::Policy> class.

=head2 report

See L<Net::SecurityCenter::API::Report> class.

=head2 repository

See L<Net::SecurityCenter::API::Repository> class.

=head2 scan

See L<Net::SecurityCenter::API::Scan> class.

=head2 scan-result

See L<Net::SecurityCenter::API::ScanResult> class.

=head2 scanner

See L<Net::SecurityCenter::API::Scanner> class.

=head2 status

See L<Net::SecurityCenter::API::Scanner> class.

=head2 system

See L<Net::SecurityCenter::API::System> class.

=head2 ticket

See L<Net::SecurityCenter::API::Ticket> class.

=head2 user

See L<Net::SecurityCenter::API::User> class.

=head2 zone

See L<Net::SecurityCenter::API::Zone> class.

=head1 OUTPUT FORMATS

C<sc-api> can export the Tenable.sc API output in different format (B<CSV>, B<TSV>, B<Table>, B<JSON>, B<YAML>, B<Dumper>).

=head1 CONFIGURATION FILE

Sample configuration file:

    [SecurityCenter]
    hostname = tenable-sc.example.org:443
    username = secman
    password = mypass

Sample configuration file with API Authentication:

    [SecurityCenter]
    hostname = tenable-sc.example.org:443
    secret_key = <SECRET KEY>
    access_key = <ACCESS KEY>

Sample configuration file with SSL Mutual-Auth:

    [SecurityCenter]
    hostname      = tenable-sc.example.org:443
    username      = secman
    password      = mypass
    ssl_cert_file = /path/my-cert.crt
    ssl_key_file  = /path/my-private.key
    ssl_password  = <SECRET>

=head1 AUTHOR

L<Giuseppe Di Terlizzi|https://metacpan.org/author/gdt>

=head1 COPYRIGHT AND LICENSE

Copyright © 2018-2023 L<Giuseppe Di Terlizzi|https://metacpan.org/author/gdt>

You may use and distribute this module according to the same terms
that Perl is distributed under.
