NAME

Firewall::PaloAlto::Panorama - Interact with a Palo Alto Panorama controller's API through Perl.

SYNOPSIS

The Firewall::PaloAlto::Panorama module provides interfaces into the XML API of a Palo Alto Panorama contoller.

use Firewall::PaloAlto::Panorama;

my $fw = Firewall::PaloAlto::Panorama->new(host => 'panorama.local', username => 'admin', password => 'admin');
$fw->connect();

CLASS METHODS

new(%parameters)

The constructor generates a new object to interact with a specific firewall.

The host, username and password parameters are mandatory. If not specified, SSL is used, but it can be disabled using the argument ssl => 0

Detailed debugging can be turned on using the debu => 1 argument. It is off by default.

my $palo = Firewall::PaloAlto::Panorama->new(host => 'panorama.local', username => 'admin', password => 'admin', ssl => 0, debug => 1);

Parameters

  • host - the hostname or IP of the Panorama to connect to.

  • username - a username to connect to the Panorama.

  • password - a password to connect to the Panorama.

  • ssl (optional, default: 1) - use SSL to connect to the firewall.

  • debug (optional, default: 0) - print debugging messages.

OBJECT METHODS

connect()

The connect functions connects to the Palo Alto, validates and saves the API key. It has no parameters

$pa->connect();

managed_device($action, serial => 'device_serial')

Adds or removes a devices from Panorama.

$pano->managed_device('set', serial => '001801003449');

template($action, %parameters)

Creates or retreives a new template

$pano->template('set', name => "New_Template"); 

Parameters

  • $action - perform an action: ['get' | 'set' | 'delete']

  • name - the name of the template

  • description - a description of the template

template_stack($action, %parameters)

Creates or retreives a new template stack.

$pano->template_stack('set', name => "New_Template", templates => [ Template1, Template2 ], description => "A Template Stack"); 

Parameters

  • $action - perform an action: ['get' | 'set' | 'delete']

  • name - the name of the template stack

  • templates - an anonymous array of templates that make up the stack

  • description - a description of the template

devicegroup($action, %parameters)

Creates or retreives a new device group.

$pano->devicegroup('set', name => "DG_Name", description => "A Device Group"); 

Parameters

  • $action - perform an action: ['get' | 'set' | 'delete']

  • name - the name of the device group

  • description - a description of the device group

vsys($action, %parameters)

Creates a new virtual system through a template

$pano->vsys('set', template => "DG_Name", name => "VSys Name", max_sessions => 100, max_rules => 100); 

Parameters

  • $action - perform an action: ['get' | 'set' | 'delete']

  • template - the name of the template to provision the vsys through

  • name - the name of the new virtual system

  • max_sessions - the maximum number of sessions the vsys can supprot

  • max_rules - the maximum number of security rules the vsys can support

subinterface($action, %parameters)

Creates a new subinterface through a template

$pano->subinterface('set', template => "Template_Name", parent => ethernet1/1, tag => 16, comment => 'Subinterface 16');

Parameters

  • $action - perform an action: ['get' | 'set' | 'delete']

  • template - the name of the template to provision the interface into

  • parent - the parent interface to place the sub-interface under

  • tag - the sub-interface ID and VLAN tag

  • comment - a string to describe the sub-interface

virtual_router($action, %parameters)

Creates a new virtual router through a template

$pano->virtual_router('set', template => "Template_Name", name => "VR Name", interface => [ 'ethernet1/1', 'ethernet1/2']); 

Parameters

  • $action - perform an action: ['get' | 'set' | 'delete']

  • template - the name of the template to provision the interface into

  • name - the name of the virtual router

  • interface - an anonymous list of interfaces to add to the virtual router

OPERATIONAL COMMANDS

commit_panorama()

Commits the current candidate configuration on the Panorama device

$pano->commit_panorama();

commit_template

Commit a template to the device that it is associated with

commit_device_group

Commit a device_group to the device that it is associated with

AUTHOR

Greg Foletta, <greg at foletta.org>

BUGS

Please report any bugs or feature requests to bug-firewall-paloalto at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Firewall-PaloAlto. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc Firewall::PaloAlto

You can also look for information at:

ACKNOWLEDGEMENTS

LICENSE AND COPYRIGHT

Copyright 2015 Greg Foletta.

This program is free software; you can redistribute it and/or modify it under the terms of the the Artistic License (2.0). You may obtain a copy of the full license at:

http://www.perlfoundation.org/artistic_license_2_0

Any use, modification, and distribution of the Standard or Modified Versions is governed by this Artistic License. By using, modifying or distributing the Package, you accept this license. Do not use, modify, or distribute the Package, if you do not accept this license.

If your Modified Version has been derived from a Modified Version made by someone other than you, you are nevertheless required to ensure that your Modified Version complies with the requirements of this license.

This license does not grant you the right to use any trademark, service mark, tradename, or logo of the Copyright Holder.

This license includes the non-exclusive, worldwide, free-of-charge patent license to make, have made, use, offer to sell, sell, import and otherwise transfer the Package with respect to any patent claims licensable by the Copyright Holder that are necessarily infringed by the Package. If you institute patent litigation (including a cross-claim or counterclaim) against any party alleging that the Package constitutes direct or contributory patent infringement, then this Artistic License to you shall terminate on the date that such litigation is filed.

Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.