Net::Cisco::FMC::v1 - Cisco Firepower Management Center (FMC) API version 1 client library
version 0.001001
use strict; use warnings; use Net::Cisco::FMC::v1; use Data::Dumper::Concise; my $fmc = Net::Cisco::FMC::v1->new( server => 'https://fmcrestapisandbox.cisco.com', user => 'admin', passwd => '$password', clientattrs => { timeout => 30 }, ); # login to populate domains $fmc->login; # list all domain uuids and names print Dumper($fmc->domains); # switch domain $fmc->domain_uuid("e276abec-e0f2-11e3-8169-6d9ed49b625f");
This module is a client library for the Cisco Firepower Management Center (FMC) REST API version 1. Currently it is developed and tested against FMC version 6.2.3.6. Older FMC versions have bugs like:
Returns a list of hashrefs containing name and uuid of all domains which gets populated by login.
The UUID of the domain which is used by all methods.
Logs into the FMC by fetching an authentication token via http basic authentication.
Refreshes the session by loging in again (not using the refresh token) and restores the currently set domain_uuid.
Takes an access policy id and a hashref of the rule which should be created.
Takes an access policy id and query parameters and returns a hashref with a single key 'items' that has a list of access rules similar to the FMC API.
Takes an access policy id, rule id and query parameters and returns the access rule.
Takes an access policy id, rule object and a hashref of the rule and returns a hashref of the updated access rule.
Takes an access policy id and a rule object id.
Returns true on success.
Takes a ProtocolPortObject and renames it to protocol_port, e.g. tcp_443. If it has no port 'any' is used instead of the port number no avoid 'predefined name' errors. Returns the ProtocolPortObject with the updated attributes.
Takes a ICMPv4Object and renames it to protocol_type[_code], e.g. icmp_8_0. If it has no code only protocol and type is used.
Takes an access policy name and a hashref of optional arguments.
Defaults to access policy name with the postfix '-cleaned'.
Gets passed the rule number and rule object and must return the new rule name.
Creates a new access policy with the target name containing all rules of the input access policy but cleaned by the following rules:
Only if they don't contain more than 50 items because of the current limit in FMC.
By passing a coderef named 'rule_name_coderef' in the optional arguments hashref.
The new access policy is created with a defaultAction of:
action => 'BLOCK' logBegin => true sendEventsToFMC => true
This is mainly for access policies migrated by the Cisco Firepower Migration Tool from a Cisco ASA.
Supports resuming.
No workaround on client side possible, only a FMC update helps.
Workaround by logging in again.
Alexander Hartmaier <abraxxa@cpan.org>
This software is copyright (c) 2018 by Alexander Hartmaier.
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::Cisco::FMC::v1, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::Cisco::FMC::v1
CPAN shell
perl -MCPAN -e shell install Net::Cisco::FMC::v1
For more information on module installation, please visit the detailed CPAN module installation guide.