Infoblox::Grid::ThreatProtection::Profile - Threat Protection profile object.


NAME

Infoblox::Grid::ThreatProtection::Profile - Threat Protection profile object.


DESCRIPTION

The Threat Protection profile object facilitates configuring groups of Threat Protection members that have similar traffic properties. A member can be either associated with a Threat Protection profile or inherit the ruleset from the Grid or override the ruleset individually at the member level.


CONSTRUCTOR

 my $object = Infoblox::Grid::ThreatProtection::Profile->new(
     name                                      => $string,                                                               #Required
     comment                                   => $string,                                                               #Optional / Default is undefined
     current_ruleset                           => $ruleset,                                                              #Optional / Default is undefined
     disable_multiple_dns_tcp_request          => 'true' | 'false',                                                      #Optional / Default is 'true'
     events_per_second_per_rule                => $uint,                                                                 #Optional / Default is undefined
     extattrs                                  => { $string => $extattr, ... },                                          #Optional / Default is undefined
     extensible_attributes                     => {$string => $string | $num, $string => [ $string | $num, ... ], ... }, #Optional / Default is undefined
     members                                   => [$host_name | ... ],                                                   #Optional / Default is empty list
     override_current_ruleset                  => 'true' | 'false',                                                      #Optional / Default is 'false'
     override_disable_multiple_dns_tcp_request => 'true' | 'false',                                                      #Optional / Default is 'false'
     override_events_per_second_per_rule       => 'true' | 'false',                                                      #Optional / Default is 'false'
     source                                    => $tp_member | $tp_profile,                                              #Optional / Default is undefined
 );

You cannot set both extattrs and extensible_attributes attributes at the same time.


SESSION METHODS

The following functions can be applied to a Infoblox::Grid::ThreatProtection::Profile object.

Infoblox::Session->add( )

Use this method to add the object to the Infoblox appliance. See Infoblox::Session->add() for parameters and return values.

Example
 #Construct object
 my $object = Infoblox::Grid::ThreatProtection::Profile->new(
     name => 'profile1',
 );
 #Submit object for addition 
 $session->add($object);

Infoblox::Session->get( )

Use this method to retrieve all the matching objects from the Infoblox appliance. See Infoblox::Session->get() for parameters and return values.

Key References
 Apply the following attributes to get a specific Threat Protection profile object:
     name                  - Optional. The Threat Protection profile name.
     comment               - Optional. The Threat Protection profile comment.
     extattrs              - Optional. A hash reference containing Infoblox::Grid::Extattr object.
     extensible_attributes - Optional. A hash reference containing extensible attributes.
Example
 my @retrieved_objs = $session->get(
     'object' => 'Infoblox::Grid::ThreatProtection::Profile',
     'name'   => 'profile1',
 );

Infoblox::Session->modify( )

Use this method to modify an object in the Infoblox appliance. See Infoblox::Session->modify() for parameters and return values.

Example
 #Modify events_per_second_per_rule value
 $object->events_per_second_per_rule('2');
 #Submit modification
 my $response = $session->modify($object);

Infoblox::Session->remove( )

Use this method to remove the object from the Infoblox appliance. See Infoblox::Session->remove() for parameters and return values.

To remove a specific object, first use get() or search() to retrieve the specific DHCP range object, and then submit this object for removal.

Example
 #Get the objects
 my @retrieved_objs = $session->get(
     object => 'Infoblox::Grid::ThreatProtection::Profile',
     name   => 'profile1',
 );
 #Find the desired object from the retrieved list
 my $desired_object = $retrieved_objs[0];
 #Submit for removal
 my $response = $session->remove($desired_object);

Infoblox::Session->search( )

Use this method to search for objects in the Infoblox appliance. See Infoblox::Session->search() for parameters and return values.

Key References
 Apply the following attributes to search for the Threat Protection profile object:
     name                  - Optional. The Threat Protection profile name (regular expression).
     comment               - Optional. The Threat Protection profile comment (regular expression).
     extattrs              - Optional. A hash reference containing Infoblox::Grid::Extattr object.
     extensible_attributes - Optional. A hash reference containing extensible attributes.

For more information about searching extensible attributes, see Infoblox::Grid::ExtensibleAttributeDef/Searching Extensible Attributes.

Examples
 # search for objects
 my @retrieved_objs = $session->search(
     object       => 'Infoblox::Grid::ThreatProtection::Profile',
     comment      => '.*comment',
 );
 # search for objects defining 'Santa Clara' for 'Site' extensible attribute
 my @retrieved_objs = $session->search(
     object                => 'Infoblox::Grid::ThreatProtection::Profile',
     extensible_attributes => {'Site' => 'Santa Clara'},
 );


METHODS

This object provides information about the Threat Protection profile settings.

comment( )

Use this method to set or retrieve the Threat Protection profile descriptive comment.

Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.

Parameter

Valid value is a desired comment in a string format.

Returns

If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.

If you did not specify a parameter, the method returns the attribute value.

Example
 #Get comment value
 my $value = $object->comment();
 #Modify comment value
 $object->comment('new comment');

current_ruleset( )

Use this method to set or retrieve the current Threat Protection profile ruleset.

Setting this method to a defined value implicitly sets the override_current_ruleset method to 'true'. Setting the parameter to undefined causes the appliance to use the Grid default and automatically resets the override_current_ruleset attribute to 'false'.

Note that when current_ruleset is set to a defined value and override_dcurrent_ruleset is set to 'false', the last operation takes precedence. Thus the sequence $object->current_ruleset($rs); $object->override_current_ruleset('false'); will set override_current_ruleset to 'false', and the sequence $object->override_current_ruleset('false'); $object->current_ruleset($rs); will result in override_current_ruleset='true'.

Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.

Parameter

Valid value is an Infoblox::Grid::ThreatProtection::Ruleset object.

Returns

If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.

If you did not specify a parameter, the method returns the attribute value.

Example
 #Get current_ruleset value
 my $value = $object->current_ruleset();
 #Modify current_ruleset value
 $object->current_ruleset($rs);

disable_multiple_dns_tcp_request( )

Use this method to disable multiple BIND responses via TCP connection.

Setting this method to a defined value implicitly sets the override_disable_multiple_dns_tcp_request method to 'true'. Setting the parameter to undefined causes the appliance to use the Grid default and automatically resets the override_disable_multiple_dns_tcp_request attribute to 'false'.

Note that when config is set to a defined value and override_disable_multiple_dns_tcp_request is set to 'false', the last operation takes precedence. Thus the sequence $object->disable_multiple_dns_tcp_request($value); $object->override_disable_multiple_dns_tcp_request('false'); will set override_disable_multiple_dns_tcp_request to 'false', and the sequence $object->override_disable_multiple_dns_tcp_request('false'); $object->disable_multiple_dns_tcp_request($value); will result in override_disable_multiple_dns_tcp_request='true'.

Parameter

Set the parameter to 'true' to disable multiple TCP requests. Set the parameter to 'false' to enable multiple TCP requests.

Returns

If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.

If you did not specify a parameter, the method returns the attribute value.

Example
 # Get attribute value
 my $value = $object->disable_multiple_dns_tcp_request();
 # Modify attribute value
 $object->disable_multiple_dns_tcp_request('true');

events_per_second_per_rule( )

Use this method to set or retrieve the number of events logged per second per rule.

Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.

Parameter

The number of events logged per second per rule in string format.

Returns

If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.

If you did not specify a parameter, the method returns the attribute value.

Example
 #Get events_per_second_per_rule value
 my $value = $object->events_per_second_per_rule();
 #Modify events_per_second_per_rule value
 $object->events_per_second_per_rule('2');

extattrs( )

Use this method to set or retrieve the extensible attributes that are associated with a Threat Protection profile object.

Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.

Parameter

Valid value is a hash reference that contains the names of extensible attributes and their associated values (Infoblox::Grid::Extattr objects).

Returns

If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.

If you did not specify a parameter, the method returns the attribute value.

Example
 #Get extattrs value
 my $value = $object->extattrs();
 #Modify extattrs value
 $object->extattrs({'Site' => $extattr1, 'Administrator' => $extattr2});

extensible_attributes( )

Use this method to set or retrieve the extensible attributes that are associated with a Threat Protection profile object.

Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.

Parameter

For valid values for extensible attributes, see Infoblox::Grid::ExtensibleAttributeDef/Extensible Attribute Values.

Returns

If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.

If you did not specify a parameter, the method returns the attribute value.

Example
 #Get extensible attributes value
 my $value = $object->extensible_attributes();
 #Modify extensible attributes value
 $object->extensible_attributes({'Site' => 'Santa Clara', 'Administrator' => ['Peter', 'Tom']});

members( )

Use this method to set or retrieve the list of members that are using the Threat Protection profile.

Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.

Parameter

The valid value is an array reference that contains desired Threat Protection member names in a string format.

Returns

If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.

If you did not specify a parameter, the method returns the attribute value.

Example
 #Get members value
 my $value = $object->members();
 #Modify members value
 $object->members(['infoblox.localdomain']);

name( )

Use this method to retrieve a Threat Protection profile name.

Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.

Parameter

The valid value is a desired Threat Protection profile name in a string format.

Returns

If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.

If you did not specify a parameter, the method returns the attribute value.

Example
 #Get name value
 my $value = $object->name();
 #Modify name value
 $object->name('new_name');

override_events_per_second_per_rule( )

Use this method to set or retrieve the override flag for the number of events logged per second per rule.

Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.

Parameter

Specify 'true' to set the override_events_per_second_per_rule flag or 'false' to deactivate/unset it. The default value is 'false'.

Returns

If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.

If you did not specify a parameter, the method returns the attribute value.

Example
 #Get override_events_per_second_per_rule value
 my $value = $object->override_events_per_second_per_rule();
 #Modify override_events_per_second_per_rule value
 $object->override_events_per_second_per_rule('true');

override_current_ruleset( )

The override_current_ruleset attribute controls whether the current ruleset value is used for Threat Protection profile instead of the Grid default.

The override_current_ruleset attribute can be specified explicitly. It is also set implicitly when current_ruleset is set to a defined value.

Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.

Parameter

Specify 'true' to set the override_current_ruleset flag or 'false' to deactivate/unset it. The default value is 'false'.

Returns

If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.

If you did not specify a parameter, the method returns the attribute value.

Example
 #Get override_current_ruleset value 
 my $override = $object->override_current_ruleset();
 #Modify override_current_ruleset
 $object->override_current_ruleset('true');

override_disable_multiple_dns_tcp_request( )

The override_disable_multiple_dns_tcp_request attribute controls whether the Threat Protection profile disable_multiple_dns_tcp_request value is used instead of the Grid default.

The override_disable_multiple_dns_tcp_request attribute can be specified explicitly. It is also set implicitly when disable_multiple_dns_tcp_request is set to a defined value.

Include the specified parameter to set the attribute value. Omit the parameter to retrieve the attribute value.

Parameter

Specify 'true' to set the override_disable_multiple_dns_tcp_request flag or 'false' to unset it. The default value is 'false'.

Returns

If you specified a parameter, the method returns true when the modification succeeds, and returns false when the operation fails.

If you did not specify a parameter, the method returns the attribute value.

Example
 #Get override_disable_multiple_dns_tcp_request value
 my $value = $object->override_disable_multiple_dns_tcp_request();
 #Modify override_disable_multiple_dns_tcp_request value
 $object->override_disable_multiple_dns_tcp_request('true');

source( )

Use this method to set the source for cloning the profile settings. This is a write-only attribute and can be used only on create operation.

Include the specified parameter to set the attribute value.

Parameter

The valid value is an Infoblox::Grid::Member::ThreatProtection or Infoblox::Grid::ThreatProtection::Profile object reference.

Returns

The method returns true when the modification succeeds, and returns false when the operation fails.

Example
 #Modify source value
 $object->source($profile1);


SAMPLE CODE

The following sample code demonstrates the different functions that can be applied to an object, such as add, search, modify, and remove. This sample also includes error handling for the operations.

#Preparation prior to a Threat Protection profile insertion

 #PROGRAM STARTS: Include all the modules that will be used
 use strict;
 use Infoblox;
 #Create a session to the Infoblox appliance
 my $session = Infoblox::Session->new(
                master   => "192.168.1.2", #appliance host ip
                username => "admin",       #appliance user login
                password => "infoblox"     #appliance password
                );
 unless ($session) {
        die("Construct session failed: ",
                Infoblox::status_code() . ":" . Infoblox::status_detail());
 }
 print "Session created successfully\n";

#Create a Threat Protection profile

 my $atp_profile = Infoblox::Grid::ThreatProtection::Profile->new(
                name    => "atp_profile1",
                comment => "add TP profile",
                );
 unless ($atp_profile) {
        die("Construct Threat Protection profile failed: ",
                Infoblox::status_code() . ":" . Infoblox::status_detail());
 }
 #Add the Threat Protection profile object to the Infoblox appliance through a session
 $session->add($atp_profile)
        or die("Add Threat Protection profile failed: ",
                        $session->status_code() . ":" . $session->status_detail());
 print "Threat Protection profile object added to server successfully\n";

#Search for a specific Threat Protection profile

 #Search all Threat Protection profiles that matches "atp"
 my @retrieved_objs = $session->search(
                object => "Infoblox::Grid::ThreatProtection::Profile",
                name   => 'atp'
                );
 my $object = $retrieved_objs[0];
 unless ($object) {
        die("Search Threat Protection profile failed: ",
                $session->status_code() . ":" . $session->status_detail());
 }
 print "Search Threat Protection profile object found at least 1 matching entry\n";

#Get and modify a Threat Protection profile

 #Get a Threat Protection profile through the session
 my @retrieved_objs = $session->get(
                object => "Infoblox::Grid::ThreatProtection::Profile",
                name   => "atp_profile1"
                );
 my $object = $retrieved_objs[0];
 unless ($object) {
        die("Get Threat Protection profile failed: ",
                $session->status_code() . ":" . $session->status_detail());
 }
 print "Get Threat Protection profile object found at least 1 matching entry\n";
 #Modify one of the attributes of the specified Threat Protection profile 
 $object->comment("this is new comment");
 #Apply the changes
 $session->modify($object)
        or die("Modify Threat Protection profile failed: ",
                $session->status_code() . ":" . $session->status_detail());
 print "Threat Protection profile object modified successfully \n";

#Remove a Threat Protection profile

 #Get Threat Protection profile through the session
 my @retrieved_objs = $session->get(
     object => "Infoblox::Grid::ThreatProtection::Profile",
     name   => "atp_profile1"
 );
 my $object = $retrieved_objs[0];
 unless ($object) {
     die("Get Threat Protection profile failed: ",
         $session->status_code() . ":" . $session->status_detail());
 }
 print "Get Threat Protection profile object found at least 1 matching entry\n";
 #Submit the object for removal
 $session->remove($object)
        or die("Remove Threat Protection profile failed: ",
                $session->status_code() . ":" . $session->status_detail());
 print "Threat Protection profile object removed successfully \n";
 ####PROGRAM ENDS####


AUTHOR

Infoblox Inc. http://www.infoblox.com/


SEE ALSO

Infoblox::Session, Infoblox::Session->add(), Infoblox::Session->get(), Infoblox::Session->modify(), Infoblox::Session->remove(), Infoblox::Session->search(), Infoblox::Grid::ThreatProtection::Ruleset, Infoblox::Grid::Member::ThreatProtection, Infoblox::Grid::ThreatProtection::Profile,


COPYRIGHT

Copyright (c) 2017 Infoblox Inc.