Security Mistakes That Leave You Vulnerable To Compromise #2 Failure to Record Data Flow Information

NetCraftsmen®

Network flow information, via Cisco’s Netflow, Juniper’s Jflow, or more recently, the standards-based IPFIX, is perhaps the most powerful tool for detecting and responding to network attacks.  I once attended a security conference, and asked a panel of defense and intelligence security experts (the people who really need to care about security) what was the most important tool to have in their arsenal.  They unanimously agreed that Netflow was the most important.

Why?

Netflow allows you to analyze network traffic – not at the packet level, like Ethereal – but at the conversation level.   With Netflow, you can easily determine which hosts communicated with each other, on what ports, and for how long.  With this information, you can recreate network activity to analyze it for unusual behavior.

How it Works

The Netflow process on a router (or L3 switch) generates a Netflow record for every data flow that passes through the device.  Like a phone bill, each call (data flow) that passes through the router is logged in a Netflow record.  The record contains the source and destination addresses and ports, the number of bytes transferred, the date, time and duration of the flow, among other info.  In this way, Netflow acts much like your cell phone bill:  it shows whom you talked to, when, and for how long.

Your router generates these Netflow records, but you will also need a device to collect the records.    Netflow collectors are software applications that run on workstations or servers and receive the Netflow records from your router.  There are both commercial and open-source Netflow applications that will collect the records and let you search through them.  Essentially, they all create a searchable database of flow events.  You can search by source IP or port, destination IP or port, number of bytes transferred, time of day, etc.  Some collectors provide analytical capabilities that can alert you to anomalies.

Here are a few collectors worth looking at:

What Do I Do With it?

Netflow complements other security tools like IDS or syslog, and allowing you to confirm or refute alerts.  For example, let’s say your IDS alerts you that a workstation downloaded a Java exploit.  When you look at the alert signature, you see that it is rated at only 60% accurate.  In other words, the alert is a true alert only 6 out of 10 times.  The rest of the time it is a false alarm.  So how do you determine if the workstation really downloaded an exploit?

You could analyze that workstation, examining the files, processes, etc. – a lengthy and disruptive process.   Or, you could look at Netflow records to gather corroborative information such as:

  • What Internet site did that workstation connect to before and after the exploit was downloaded, and how much data was transferred?
  • After that event, did the workstation initiate a connection out of the internal network?  To where?
  • After that event, did the workstation exhibit suspicious behavior, such as scanning the internal network or making odd DNS requests?

The answer to these questions will help you confirm or refute the IDS alarm and allow you to take appropriate action.  Forensically analyzing a user’s workstation is a time consuming process, not to mention disruptive to the user.  Netflow data can more easily tell you when further action is necessary.

Here’s another example:

You are concerned that large amounts of data are being exfiltrated from your organization.  With Netflow, you can rank hosts by the amount of transferred data.   Your mail servers might be at the top of that list, but any other workstations that rank high ought to be investigated.

Unlike full packet capture, Netflow records have the advantage of being relatively small. Capturing full packets is a powerful tool, but in a busy network the amount of data stored can be enormous.  Most organizations only capture data for the last week or two.  Netflow, by contrast takes up little space. This means storage and retrieval of large amounts of Netflow data are usually not a big issue, so months or years of data are not at all unreasonable.

Setting up Netflow

Setting up Netflow is pretty simple.   You need to enable Netflow collection on interfaces and tell the router where to send the records.  Here’s a sample configuration for Cisco devices:

! enable Netflow on an interface
!
interface GigibitEthernet 0/0
ip route-cache flow
exit
!
! Send the Netflow records to a collector at IP address 1.2.3.4.
!Port 2055 is the standard UDP port.
!
ip flow-export 1.2.3.4 2055 version 5

That’s all you need to do.

Where To Enable Netflow

While you could enable Netflow on every capable device, that would just generate a lot of duplicate information, making it harder to find useful information. Generally speaking, you should enable Netflow on your perimeter devices – Internet routers, extranet routers and WAN routers.  You should also enable Netflow on your core devices.  This strategy will give you good flow information without generating too many duplicate flow records.  There may be other places where you want to record flow data, such as data center distribution devices.  These need to be evaluated on a case-by-case basis.

Netflow version 5 is currently the most widely used version.  Version 9 is the latest version of Netflow, and contains additional flow information.  It is now an open standard, called Internet Protocol Flow Information eXport (IPFIX).  You can read about IPFIX in RFC 5101.

With information on all the flows through your network, you have a powerful tool for understanding how data flows through your network.  Armed with this data, you can start to compare normal traffic to anomalous traffic and begin to identify devices that have suspicious activity.

Leave a Reply

 

Nick Kelly

Cybersecurity Engineer, Cisco

Nick has over 20 years of experience in Security Operations and Security Sales. He is an avid student of cybersecurity and regularly engages with the Infosec community at events like BSides, RVASec, Derbycon and more. The son of an FBI forensics director, Nick holds a B.S. in Criminal Justice and is one of Cisco’s Fire Jumper Elite members. When he’s not working, he writes cyberpunk and punches aliens on his Playstation.

 

Virgilio “BONG” dela Cruz Jr.

CCDP, CCNA V, CCNP, Cisco IPS Express Security for AM/EE
Field Solutions Architect, Tech Data

Virgilio “Bong” has sixteen years of professional experience in IT industry from academe, technical and customer support, pre-sales, post sales, project management, training and enablement. He has worked in Cisco Technical Assistance Center (TAC) as a member of the WAN and LAN Switching team. Bong now works for Tech Data as the Field Solutions Architect with a focus on Cisco Security and holds a few Cisco certifications including Fire Jumper Elite.

 

John Cavanaugh

CCIE #1066, CCDE #20070002, CCAr
Chief Technology Officer, Practice Lead Security Services, NetCraftsmen

John is our CTO and the practice lead for a talented team of consultants focused on designing and delivering scalable and secure infrastructure solutions to customers across multiple industry verticals and technologies. Previously he has held several positions including Executive Director/Chief Architect for Global Network Services at JPMorgan Chase. In that capacity, he led a team managing network architecture and services.  Prior to his role at JPMorgan Chase, John was a Distinguished Engineer at Cisco working across a number of verticals including Higher Education, Finance, Retail, Government, and Health Care.

He is an expert in working with groups to identify business needs, and align technology strategies to enable business strategies, building in agility and scalability to allow for future changes. John is experienced in the architecture and design of highly available, secure, network infrastructure and data centers, and has worked on projects worldwide. He has worked in both the business and regulatory environments for the design and deployment of complex IT infrastructures.