Infoblox Exchange Cybersecurity Roadshow 2020 – Join us!
North America | Europe | Middle East/Africa | Asia-Pacific

Security

Reply

Retrieving all records

JBurt
Techie
Posts: 6
3496     0

 

I'm looking to retrieve all of the IPAM::Address, DNS::Record::A and DNS:Record:AAAAA records from the IB database without regard to any other values. Once I get the records back, I plan to search for particular IP addresses and/or domain names.

Is there any easy way to do this? 

Jeff Burt

AT&T Government Solutions

Re: Retrieving all records

I-Team Employee
Employee
Posts: 171
3496     0

I haven't tried this, but you should be able to use something like this:

 

 
my @retrieved_objs = $session->search( object => "Infoblox:Smiley Very HappyNS::Record::A" , 
view => "default" ); 
 
my @retrieved_objs = $session->search( object => "Infoblox:Smiley Very HappyNS::Record::AAAAA" ,  view => "default" ); 
 
my @ipam_objects = $session->get( 'object' => 'Infoblox::IPAM::Address''); 
 
The ipam call is limited to 2000 items in a call; if your network is larger, then you're going to have to pulling it out in chunks, perhaps by identifying your networks and pulling it out a network at a time. 
 
You might want to consider using a cursor to pull the data in chunks. Look at InfoBlox::Cursor()
 

Re: Retrieving all records

JBurt
Techie
Posts: 6
3496     0

Thanks for the tip - I just tried this and it doesn't seem to work. 

This is the code that I tried:

## my @ipam_objects = $session->get('object' => 'Infoblox::IPAM::Address');

 

my @ipam_objects = $session->get('object' => 'Infoblox::IPAM::Address',
                'network' => '164.157.10.0/24');
 
my $numElements = $#ipam_objects + 1;
print "WE got $numElements entries from Infoblox\n";
 
if  ( $numElements == 0) {
        print "\nNothing else to do so just exit\n\n";
        exit 0;
};
 
If I use line 1 (without the network parameter) I get 0 records returned. If I add the network I get 256 entries (the network is full). 
 
Is there an easy way to get all the allocated network values so I can then iterate through the IPAM records with the network IDs? This would be preferable since I really only want to look at particular networks anyway.
 
I've also tried using the search method for IPAM records looking for particular IP addresses and the search method returns 0. 
 
Could it be that something in the API is not configured properly? We are using a GM installed on an ESX host. 
 
This is perl, v5.8.8 built for x86_64-linux-thread-multi
 

 

Re: Retrieving all records

JBurt
Techie
Posts: 6
3496     0

I also tried specifying the start and end addresses for "everything"  and that doesn't find anything either.

 

 

my @ipam_objects = $session->get('object' => 'Infoblox::IPAM::Address',
                                'start_addr' => '0.0.0.0',
                                'end_addr'   => '255.255.255.255');
 
Specifying a small subset of addresses does return data:
my @ipam_objects = $session->get('object' => 'Infoblox::IPAM::Address',
                                'start_addr' => '164.157.10.0',
                                'end_addr'   => '164.157.10.0255');
 
returns all 256 address records.
 
Why do I need to  be so specific?

 

Highlighted

Instead of IPAM::Address, try

CRhea
Techie
Posts: 7
3496     0

Instead of IPAM::Address, try DNS::Host for the search (In addition to DNS::Record::A, DNS::Record::AAAAA).  IPAM::Address is "special".

Showing results for 
Search instead for 
Do you mean 

Recommended for You