Network Security With NetFlow and IPFIX - Arianserver - Net
Network Security With NetFlow and IPFIX - Arianserver - Net
Network Security With NetFlow and IPFIX - Arianserver - Net
I II I I I
CISCO ~
Network Security
with NetFlow and IPFIX
Big Data Analytics for Information Security
Omar Santos
Cisco Press
800 East 96th Street
Published by:
Cisco Press
800 East 96th Street
Indianapolis, IN 46240 USA
All rights reserved. No part of this book may be reproduced or transmitted in any form or by any means,
electronic or mechanical, including photocopying, recording, or by any information storage and retrieval
system, without written permission from the publisher, except for the inclusion of brief quotations in a
review.
ISBN-13: 978-1-58714-438-7
ISBN-10: 1-58714-438-7
The information is provided on an “as is” basis. The authors, Cisco Press, and Cisco Systems, Inc. shall
have neither liability nor responsibility to any person or entity with respect to any loss or damages
arising from the information contained in this book or from the use of the discs or programs that may
accompany it.
The opinions expressed in this book belong to the author and are not necessarily those of Cisco
Systems, Inc.
Trademark Acknowledgments
All terms mentioned in this book that are known to be trademarks or service marks have been
appropriately capitalized. Cisco Press or Cisco Systems, Inc., cannot attest to the accuracy of this infor-
mation. Use of a term in this book should not be regarded as affecting the validity of any trademark or
service mark.
Special Sales
For information about buying this title in bulk quantities, or for special sales opportunities (which may
include electronic versions; custom cover designs; and content particular to your business, training
goals, marketing focus, or branding interests), please contact our corporate sales department at
[email protected] or (800) 382-3419.
For questions about sales outside the U.S., please contact [email protected].
iii
Feedback Information
At Cisco Press, our goal is to create in-depth technical books of the highest quality and value. Each book
is crafted with care and precision, undergoing rigorous development that involves the unique expertise
of members from the professional technical community.
Readers’ feedback is a natural continuation of this process. If you have any comments regarding how we
could improve the quality of this book, or otherwise alter it to better suit your needs, you can contact us
through email at [email protected]. Please make sure to include the book title and ISBN in your
message.
Associate Publisher: Dave Dusthimer Technical Editors: Lou Ronnau, John Stuppi
Omar is an active member of the security community, where he leads several industry-
wide initiatives and standard bodies. His active role helps businesses, academic institu-
tions, state and local law enforcement agencies, and other participants that are dedicated
to increasing the security of the critical infrastructure.
Omar is the author of several books and numerous whitepapers, articles, and security
configuration guidelines and best practices. He has also delivered numerous technical
presentations at many conferences and to Cisco customers and partners, in addition to
many C-level executive presentations to many organizations. Omar is the author of the
following Cisco Press books:
n Cisco ASA Next-Generation Firewall, IPS, and VPN Services (3rd Edition),
ISBN-10: 1587143070
n Cisco ASA: All-in-One Firewall, IPS, Anti-X, and VPN Adaptive Security
Appliance (2nd Edition), ISBN-10: 1587058197
n Cisco ASA: All-in-One Firewall, IPS, and VPN Adaptive Security Appliance,
ISBN-10: 1587052091
Lou Ronnau is a Consulting Engineer in the Cisco Security Solutions group at Cisco
Systems, where he has worked for more than 20 years. In this position, he works with
customers to identify and mitigate threats to the secure operation of their data networks.
Lou has presented at Cisco Live and other industry security conferences and is a Cisco
Press author. In his spare time, Lou enjoys flying as a private pilot and scuba diving.
vi Network Security with NetFlow and IPFIX
Dedication
I want to dedicate this book to my lovely wife, Jeannette, and my two beautiful children,
Hannah and Derek, who have inspired and supported me throughout the development
of this book.
I also dedicate this book to my father, Jose, and write in memory of my mother,
Generosa. Without their knowledge, wisdom, and guidance, I would not have the goals
that I strive to achieve today.
vii
Acknowledgments
I want to thank the technical editors, John Stuppi and Lou Ronnau, for their time and
technical expertise. They verified my work and corrected me in all the major and minor
mistakes that were hard to find.
I also want to thank the Cisco Press team, especially Denise Lincoln, Chris Cleveland,
and Mandie Frank for their patience, guidance, and consideration. Their efforts are
greatly appreciated.
Kudos to the Cisco product development teams for delivering such a great product
portfolio.
Finally, I want to acknowledge the Cisco PSIRT and Security Research and Operations.
Some of the best and brightest minds in the network security industry work there,
supporting and protecting our Cisco customers, often under very stressful conditions
and working miracles daily.
viii Network Security with NetFlow and IPFIX
Contents at a Glance
Introduction xvi
Chapter 4 NetFlow Commercial and Open Source Monitoring and Analysis Software
Packages 75
Index 273
ix
Contents
Introduction xvi
NfSen 86
SiLK 86
SiLK Configuration Files 87
Filtering, Displaying, and Sorting NetFlow Records with SiLK 87
SiLK’s Python Extension 88
Counting, Grouping, and Mating NetFlow Records with Silk 88
SiLK IPset, Bag, and Prefix Map Manipulation Tools 88
IP and Port Labeling Files 89
SiLK Runtime Plug-Ins 89
SiLK Utilities for Packet Capture and IPFIX Processing 90
Utilities to Detect Network Scans 90
SiLK Flow File Utilities 90
Additional SiLK Utilities 91
Elasticsearch, Logstash, and Kibana Stack 92
Elasticsearch 92
Logstash 92
Kibana 93
Elasticsearch Marvel and Shield 94
ELK Deployment Topology 94
Installing ELK 95
Installing Elasticsearch 96
Install Kibana 105
Installing Nginx 106
Install Logstash 107
Summary 109
Kafka 120
Storm 121
Hive 122
Elasticsearch 123
HBase 124
Third-Party Analytic Tools 125
Other Big Data Projects in the Industry 126
Understanding Big Data Scalability: Big Data Analytics in the Internet of
Everything 127
Summary 128
Index 273
xv
n Boldface indicates commands and keywords that are entered literally as shown.
In actual configuration examples and output (not general command syntax),
boldface indicates commands that are manually input by the user (such as a
show command).
n Braces within brackets ([{ }]) indicate a required choice within an optional
element.
xvi Network Security with NetFlow and IPFIX
Introduction
Cisco NetFlow is now the primary network accounting technology in the industry.
Visibility into the network is an indispensable tool for network and security
professionals. In response to new requirements and cyber security headaches, network
operators and security professionals are finding it critical to understand how the network
is behaving. Cisco NetFlow creates an environment where network administrators and
security professionals have the tools to understand who, what, when, where, and how
network traffic is flowing.
n Chapter 2, “Cisco NetFlow Versions and Features”: This chapter covers the
different Cisco NetFlow versions and features available on each version. It also
covers the NetFlow v9 export format and packet details, and includes a detailed
comparison between NetFlow and IPFIX.
n Chapter 5, “Big Data Analytics and NetFlow”: Big data analytics is a key
and growing network security, monitoring, and troubleshooting trend. Cisco
NetFlow provides a source of relevant big data that customers should be
analyzing to improve the performance, stability, and security of their networks.
This chapter describes how NetFlow is used for big data analytics for cyber
security, along with other network telemetry capabilities such as firewall
logs, syslog, SNMP, and authentication, authorization and accounting logs,
in addition to logs from routers and switches, servers, and endpoint stations,
among others.
n Chapter 6, “Cisco Cyber Threat Defense and NetFlow”: Cisco has partnered
with Lancope to deliver a solution that provides visibility into security threats
by identifying suspicious traffic patterns in the corporate network. These
suspicious patterns are then augmented with circumstantial information
necessary to determine the level of threat associated with a particular incident.
This solution allows a network administrator or security professional to analyze
this information in a timely, efficient, and cost-effective manner for advanced
cyber threats. This chapter provides detailed coverage of Cisco Cyber Threat
Defense Solution. Cisco Cyber Threat Defense Solution utilizes the Lancope
StealthWatch System to analyze NetFlow information from Cisco switches,
routers, and the Cisco ASA 5500 Next-Generation Firewalls to detect advanced
and persistent security threats such as internally spreading malware, data leakage,
botnet command-and-control traffic, and network reconnaissance. The Cisco ISE
solution supplements StealthWatch NetFlow-based behavioral threat detection
data with contextual information such as user identity, user authorization
level, device type, and posture. This chapter provides design and configuration
guidance when deploying the Cisco Cyber Threat Defense Solution.
n Chapter 8, “Case Studies”: This chapter covers several case studies and real-
life scenarios on how NetFlow is deployed in large enterprises and in small and
medium-sized businesses.
This page intentionally left blank
Chapter 1
Introduction to NetFlow
and IPFIX
n Introduction to NetFlow
n Supported platforms
n Deployment scenarios
This chapter provides an overview of Cisco NetFlow. Cisco NetFlow provides a key set
of services for IP applications, including network traffic accounting, usage-based net-
work billing, network planning, security, denial-of-service (DoS) monitoring capabilities,
and network monitoring. NetFlow provides valuable information about network users
and applications, peak usage times, and traffic routing.
Introduction to NetFlow
NetFlow is a Cisco application that provides comprehensive visibility into all network
traffic that traverses a Cisco-supported device. Cisco invented NetFlow and is the leader
in IP traffic flow technology. NetFlow was initially created for billing and accounting
of network traffic and to measure other IP traffic characteristics such as bandwidth
2 Chapter 1: Introduction to NetFlow and IPFIX
utilization and application performance. NetFlow has also been used as a network-capac-
ity planning tool and to monitor network availability. Nowadays, NetFlow is used as a
network security tool because its reporting capabilities provide nonrepudiation, anomaly
detection, and investigative capabilities. As network traffic traverses a NetFlow-enabled
device, the device collects traffic flow information and provides a network administrator
or security professional with detailed information about such flows.
n Encryption
n Droppers
n Social engineering
n Zero-day attacks
Security technologies and processes should not focus only on defending against Internet
threats, but should also provide the ability to detect and mitigate the impact after a suc-
cessful attack. Cisco has defined a framework around the attack continuum. Figure 1-1
illustrates the attack continuum.
Introduction to NetFlow 3
Attack Continuum
Network as a Sensor
Network as an Enforcer
Security professionals must maintain visibility and control across the extended network
during the full attack continuum:
Cisco next-generation security products provide protection throughout the attack con-
tinuum. Devices such as the ASA with FirePOWER Services available on the Cisco ASA
5500-X series and ASA 5585-X Adaptive Security Appliances and Cisco’s Advanced
Malware Protection (AMP) provide a security solution that help discover threats and
enforce and harden policies before an attack takes place. In addition, you can detect
attacks before, during, and after they have already taken place with NetFlow. These
solutions provide the capabilities to contain and remediate an attack to minimize data
loss and additional network degradation.
n The network as a sensor: NetFlow allows you to use the network as a sensor, giving
you deep and broad visibility into unknown and unusual traffic patterns, in addition
into compromised devices.
n The network as an enforcer: You can use Cisco TrustSec to contain attacks by
enforcing segmentation and user access control. Even when bad actors successfully
breach your network defenses, you thus limit their access to only one segment of
the network.
n The network as a mitigation accelerator: The network can help you contain and
mitigate breaches faster through automation with the Cisco Application Policy
Infrastructure Controller Enterprise Module (APIC-EM). APIC-EM allows you to
apply mitigations in an automated way in near real time to your whole enterprise.
You can also combine these solutions with Cisco AMP and next-generation firewalls.
What Is a Flow?
A flow is a unidirectional series of packets between a given source and destination. In
a flow, the same source and destination IP addresses, source and destination ports, and
IP protocol are shared. This is often referred to as the five-tuple. Figure 1-2 shows an
example of a flow between a client and a server.
Client HTTP
(Source) Server
(Destination)
NetFlow
Collector
In Figure 1-2, the client (source) establishes a connection to the server (destination).
When the traffic traverses the router (configured for NetFlow), it generates a flow
record. At the very minimum, the five-tuple is used to identify the flow in the NetFlow
database of flows kept on the device. This database is often called the NetFlow cache.
Introduction to NetFlow 5
Table 1-1 shows the five-tuple for the basic flow represented in Figure 1-2.
Depending on the version of NetFlow, the router can also gather additional informa-
tion, such as type of service (ToS) byte, differentiated services code point (DSCP), the
device’s input interface, TCP flags, byte counters, and start and end times.
Flexible NetFlow, Cisco’s next-generation NetFlow, can track a wide range of Layer 2,
IPv4, and IPv6 flow information, such as the following:
n ToS
n DSCP
n TCP flags and encapsulated protocol (TCP/UDP) and individual TCP flags
n All fields in IPv6 header, including Flow Label, Option Header, and others
Note You can find detailed information about the versions of NetFlow in Chapter 2,
“Cisco NetFlow Versions and Features.”
6 Chapter 1: Introduction to NetFlow and IPFIX
NetFlow protocol data unit (PDU)s, also referred to as flow records, are generated and
sent to a NetFlow collector after the flow concludes or expires (times out).
Note Examples of open source and commercial NetFlow collectors are covered in
detail in Chapter 4, “NetFlow Commercial and Open Source Monitoring and Analysis
Software Packages.”
n Normal cache: This is the default cache type in many infrastructure devices enabled
with NetFlow and Flexible NetFlow. The entries in the flow cache are removed
(aged out) based on the configured timeout active seconds and timeout inactive
seconds settings.
n Immediate cache:
n Desirable for real-time traffic monitoring and distributed DoS (DDoS) detection
n Used when only very small flows are expected (for example, sampling)
n Permanent cache:
n Used to track a set of flows without expiring the flows from the cache.
Many people often confuse a flow with a session. All traffic in a flow is going in the
same direction; however, when the client establishes the HTTP connection (session) to
the server and accesses a web page, it represents two separate flows. The first flow is the
traffic from the client to the server, and the other flow is from the server to the client.
n Network security
n Traffic engineering
NetFlow for Network Security 7
n Network planning
n Network troubleshooting
Do not confuse the feature in Cisco IOS Software called IP Accounting with NetFlow.
IP Accounting is a great Cisco IOS tool, but it is not as robust or as well known as
NetFlow.
Table 1-2 provides a comparison between some of the fundamental features provided by
NetFlow and the IP Accounting feature in Cisco IOS.
Note An overview of Cisco CTD is covered later in this chapter and in detail in Chapter 6,
“Cisco Cyber Threat Defense and NetFlow.”
The first step in the process of preparing your network and staff to successfully identify
security threats is achieving complete network visibility. You cannot protect against or
mitigate what you cannot view/detect. You can achieve this level of network visibility
through existing features on network devices you already have and on devices whose
potential you do not even realize. In addition, you should create strategic network dia-
grams to clearly illustrate your packet flows and where, within the network, you may
enable security mechanisms to identify, classify, and mitigate the threat. Remember that
8 Chapter 1: Introduction to NetFlow and IPFIX
network security is a constant war. When defending against the enemy, you must know
your own territory and implement defense mechanisms in place.
Typically, an anomaly-detection system monitors network traffic and alerts and then
reacts to any sudden increase in traffic and any other anomalies.
Note NetFlow, along with other mechanisms such as syslog and SNMP, can be
enabled within your infrastructure to provide the necessary data used for identifying
and classifying threats and anomalies. Before implementing these anomaly-detection
capabilities, you should perform traffic analysis to gain an understanding of general
traffic rates and patterns. In anomaly detection, learning is generally performed over a
significant interval, including both the peaks and valleys of network activity.
As you can see in the graph illustrated in Figure 1-3, the amount of traffic (in gigabits
per second) increases around 2:00 p.m.. If the 2:00 p.m. spike is not a normal occurrence
on other days, this may be an anomaly. In some cases, misconfigured hosts and servers
can send traffic that consumes network resources unnecessarily. Having the necessary
tools and mechanisms to identify and classify security threats and anomalies in the net-
work is crucial.
NetFlow for Network Security 9
25
20
15
10
0
8:00 AM 9:00 AM 10:00 AM 11:00 AM 12:00 PM 1:00 PM 2:00 PM 3:00 PM 4:00 PM
Traffic in Gbps
In addition, you can measure how long the communications lasted, and the frequency of
the same connection attempts.
Tip Often, tuning is necessary, because certain traffic behavior could cause false positives.
For instance, your organization may be legitimately sharing large amounts of data or
streaming training to business partners and customers. In addition, analytics software that
examines baseline behavior may be able to detect typical file transfers and incorporate
them into existing baselines.
information about all network activity that can be very useful for incident response and
network forensics. This information can help you discover indicators of compromise (IOC).
A six-step methodology on security incident handling has been adopted by many organi-
zations, including service providers, enterprises, and government organizations, as follows:
Step 1. Preparation
Step 2. Identification
Step 3. Containment
Step 4. Eradication
Step 5. Recovery
NetFlow plays a crucial role in the preparation phase and identification phases. Infor
mation collected in NetFlow records can be used to identify, categorize, and scope sus-
pected incidents as part of the identification. NetFlow data also provides great benefits
for attack traceback and attribution. In addition, NetFlow provides visibility of what is
getting into your network and what information is being exfiltrated out of your network.
Internet
botn NetFlow-Enabled
Botnet NetFlow- Router
Enabled
Router
Servers
Figure 1-4 shows an example of how a botnet is performing a DDoS attack against the
corporate network, while at the same time communicating with an internal host in the
call center. NetFlow in this case can be used as an anomaly-detection tool for the DDoS
attack and also as a forensics tool to potentially find others IOCs of more sophisticated
attacks that may be carrying out incognito.
Figure 1-5 shows how a “stepping-stone” attack is carried out in the corporate network.
A compromised host in the engineering department is extraditing large amounts of sensi-
tive data to an attacker in the Internet from a server in the data center.
Internet
Attacker
NetFlow-Enabled NetFlow-Enabled
Router Router
Servers
Note More detailed real-life examples of IOCs are covered in Chapter 8, “Case Studies.”
You can also use NetFlow in combination with DNS records to help you detect suspi-
cious and malicious traffic, such as the following:
n Suspicious requests to .gov, .mil, and .edu sites when you do not even do business
with any of those entities
12 Chapter 1: Introduction to NetFlow and IPFIX
n Large amount of traffic leaving the organization late at night to suspicious sites
n Traffic to embargoed countries that should not have any business partners or
transactions
Syslog and packet captures are also often used in network forensics; however, an area
where these traditional network forensics tools fall short is in coverage. For instance, it
is very difficult to deploy hundreds of sniffers (packet-capture devices) in the network
of large organizations. In addition, the cost will be extremely high. When a security inci-
dent or breach is detected, the incident responders need answers fast! They do not have
time to go over terabytes of packet captures, and they can definitely not analyze every
computer on the network to find the root cause, miscreant, and source of the breach.
You can use NetFlow to obtain a high-level view of what is happening in the network,
and then the incident responder can perform a deep-dive investigation with packet cap-
tures and other tools later in the investigation. Sniffers can be then deployed as needed
in key locations where suspicious activity is suspected. The beauty of NetFlow is that
you can deploy it anywhere you have a supported router, switch, or Cisco ASA; alterna-
tively, you can use Cisco NetFlow Generation Appliance (NGA).
NetFlow can fill in some of the gaps and challenges regarding the collection of packet
captures everywhere in the network. It is easier to store large amounts of NetFlow data
because it is only a transactional record. Therefore, administrators can keep a longer
history of events that occurred on their networks. Historical records can prove very valu-
able when investigating a breach. Network transactions can show you where an initial
infection came from, what command-and-control channel was initiated by the malware,
what other computers on the internal network were accessed by that infected host, and
whether other hosts in the network reached out to the same attacker or command-and-
control system, as demonstrated at a high-level in Figure 1-3 and Figure 1-4.
The logging facility on Cisco IOS routers, switches, Cisco ASA, and other infrastruc-
ture devices allows you to save syslog messages locally or to a remote host. By default,
routers send logging messages to a logging process. The logging process controls the
delivery of logging messages to various destinations, such as the logging buffer, termi-
nal lines, a syslog server, or a monitoring event correlation system such as Cisco Prime
Infrastructure, Splunk, and others. You can set the severity level of the messages to
NetFlow for Network Security 13
control the type of messages displayed, in addition to a time stamp to successfully track
the reported information. Every security professional and incident responder knows
how important it is to have good logs. There is no better way to find out what was hap-
pening in a router, switch, and firewall at the time that an attack occurred. However, like
all things, syslog has limitations. You have to enable the collection of logs from each
endpoint; so in many environments, syslog coverage is incomplete, and after a computer
has been compromised, it is not possible to trust the logs coming from that device any-
more. Syslog is extremely important, but it cannot tell you everything. Many network
telemetry sources can also be correlated with NetFlow while responding to security inci-
dents and performing network forensics, including the following:
n VPN logs
n Spam filters from e-mail security appliances such as the Cisco Email Security
Appliance (ESA)
Table 1-3 lists different event types, their source, and respective events that can be
combined with NetFlow while responding to security incidents and performing network
forensics.
Tip It is extremely important that your syslog and other messages are time-stamped
with the correct date and time. This is why the use of Network Time Protocol (NTP) is
strongly recommended.
n Practice incident response policies and procedures in mock events and collect things
like NetFlow on a regular basis to analyze what is happening in the network.
n Understand evidence handling and chain of custody. (Even NetFlow events can be
used as evidence.)
n Have a framework for communications, both within the team and external to the team.
An example of capacity planning may be a planned merger with another company that
will add hundreds or thousands of new users to internal corporate resources. Another
example is a new application that may have numerous users where the network adminis-
trator might need to provision additional bandwidth or capacity to different areas of the
network.
Note The different NetFlow versions, as well as each of the components, packet types,
and other detailed information, are covered in Chapter 2.
IPFIX defines different elements that are grouped into 12 groups according to their
applicability:
1. Identifiers
4. IP header fields
16 Chapter 1: Introduction to NetFlow and IPFIX
7. Derived-packet properties
12. Padding
Traditional Cisco NetFlow records are usually exported via UDP messages. The IP
address of the NetFlow collector and the destination UDP port must be configured
on the sending device. The NetFlow standard (RFC 3954) does not specify a specific
NetFlow listening port. The standard or most common UDP port used by NetFlow is
UDP port 2055, but other ports like 9555 or 9995, 9025, and 9026 can also be used.
UDP port 4739 is the default port used by IPFIX.
IPFIX Architecture
IPFIX uses the following architecture terminology:
n EP: Sends flow records via IPFIX from one or more MPs to one or more collecting
processes (CPs).
MP EP CP Database
MP
Exporter Device Collector
IPFIX Mediators
IPFIX introduces the concept of mediators. Mediators collect, transform, and re-export
IPFIX streams to one or more collectors. Their main purpose is to allow federation of
IPFIX messages. Mediators include an intermediate process (ImP) that allows
n IP translation.
MP
ImP
MP EP CP CP Database
EP
MP
Exporter Device Mediator Collector
IPFIX Templates
An IPFIX template describes the structure of flow data records within a data set.
Templates are identified by a template ID, which corresponds to set ID in the set header
of the data set. Templates are composed of (information element [IE] and length) pairs.
IEs provide field type information for each template. Figure 1-8 illustrates these concepts.
18 Chapter 1: Introduction to NetFlow and IPFIX
Template Set
Set Header
Template
TemplateID IE Count
A standard information models cover nearly all common flow collection use cases, such
as the following:
n Packet treatment such as IP next-hop IPv4 addresses, BGP destination ASN, and
others
n Sub-IP header fields such as source MAC address and wireless local area network
(WLAN) service set identifier (SSID)
n Various counters (packet delta counts, total connection counts, top talkers, and
so on)
n Flow metadata information such as ingress and egress interfaces, flow direction,
virtual routing and forwarding (VRF) information
Note There are numerous others defined at the Internet Assigned Numbers Authority
(IANA) website: http://www.iana.org/assignments/ipfix/ipfix.xhtml.
Figure 1-9 includes an example of a template that includes different information element
lengths and the association with the respective data set of flow records.
As illustrated in Figure 1-9, the template ID matches the set header of the related dataset
(260) in this example. Then the data set includes a series of flow records. An example of
the flow record is shown in the block diagram on the right.
IP Flow Information Export 19
Template
Template ID (260) IEs (9)
sourceIPv4Address (10.10.10.8)
destinationIPvAddress(10.120.1.26)
Data Set
…
Set Header (260)
packetDeltaCount(17)
Flow Record
octetDeltaCount(3321)
Flow Record
…
Flow Record
Option Templates
Option templates are a different type of IPFIX templates used to define records referred
to as options that are associated with a specified scope. A scope may define an entity in
the IPFIX architecture, including the exporting process, other templates, or a property
of a collection of flows. Flow records describe flows, and option records define things
other than flows, such as the following:
n Packet streams
Options Template
Template ID (265) IEs (2) Scope (1)
Options Record
Template ID (261)
Many refer to SCTP as a simpler state machine than features provided by TCP with an “a
la carte” selection of features. PR-SCTP provides a reliable transport with a mechanism
to skip packet retransmissions. It allows for multiple applications with different reliabil-
ity requirements to run on the same flow association. In other words, it combines the
best effort reliability of UDP while still providing TCP-like congestion control.
SCTP ensures that IPFIX templates are sent reliably by improving end-to-end delay.
Note RFC 6526 introduces additional features such as per-template drop counting with
partial reliability and fast template reuse.
Supported Platforms
NetFlow is supported in many different platforms, including the following:
New platforms and additional support are being added on a regular basis by Cisco. The
best way to obtain a full list of supported platforms is by visiting the Cisco Feature
Navigator at http://tools.cisco.com/ITDIT/CFN/jsp/index.jsp.
Cisco Feature Navigator enables you to quickly find the right Cisco IOS, IOS XE, and
IOS XR software release and platform for any feature that you want to enable in your
network, including NetFlow.
The Cisco CTD Solution uses NetFlow telemetry and contextual information from the
Cisco network infrastructure. This solution allows a network administrator or security
professional to analyze this information in a timely, efficient, and cost-effective manner
for advanced cyber threats, such as the following:
n Network reconnaissance
n Malware proliferation across the network for the purpose of stealing sensitive data
or creating back doors to the network
n Communications between the attacker (or command and control servers) and the
compromised internal hosts
n Data exfiltration
Cisco has partnered with Lancope to deliver this solution. The Lancope StealthWatch
System, available from Cisco, aggregates and normalizes considerable amounts of
NetFlow data to apply security analytics to detect malicious and suspicious activity. The
StealthWatch Management Console provides a rich graphical unit interface (GUI) with
many visualizations and telemetry information.
22 Chapter 1: Introduction to NetFlow and IPFIX
The following are the primary components of the Lancope StealthWatch System:
n Flow licenses, which are required to aggregate flows at the StealthWatch Management
Console. (Flow licenses define the volume of flows that may be collected.)
n FlowSensor: A physical or virtual appliance that can generate NetFlow data when
legacy Cisco network infrastructure components are not capable of producing line-
rate, unsampled NetFlow data. Alternatively, you can use the Cisco NGA.
Chapter 6 provides detailed information about the Cisco CTD Solution, along with
sample configurations and best practices
n Application recognition
Application Recognition
Cisco AVC uses existing Cisco Network Based Application Recognition Version 2
(NBAR2) to provide deep packet inspection (DPI) technology to identify a wide variety
of applications within the network traffic flow, using Layer 3 to Layer 7 data.
NBAR works with QoS features to help ensure that the network bandwidth is best used
to fulfill its main primary objectives. The benefits of combining these features include
the ability to guarantee bandwidth to critical applications, limit bandwidth to other appli-
cations, drop selective packets to avoid congestion, and mark packets appropriately so
that the network and the service provider’s network can provide QoS from end to end.
Cisco Application Visibility and Control and NetFlow 23
n TCP performance metrics such as bandwidth usage, response time, and latency
These metrics are collected and exported in NetFlow v9 or IPFIX format to a manage-
ment and reporting system.
Note In Cisco IOS routers, metrics records are sent out directly from the data plane
when possible, to maximize system performance. However, if more complex processing
is required on the Cisco AVC-enabled device, such as if the user requests that a router
keep a history of exported records, the records may be exported from the route
processor at a lower speed.
Note NetFlow commercial and open source software management and reporting
systems are covered in detail in Chapter 4, “NetFlow Commercial and Open Source
Monitoring and Analysis Software Packages.”
Control
As previously mentioned, administrators can use QoS capabilities to control application
prioritization. Protocol discovery features in Cisco AVC shows you the mix of applica-
tions currently running on the network. This helps you define QoS classes and polices,
such as how much bandwidth to provide to mission-critical applications and how to
determine which protocols should be policed. Per-protocol bidirectional statistics are
available such as packet and byte counts, as well as bit rates.
After administrators classify the network traffic, they can apply the following QoS
features:
n Marking for differentiated service downstream or from the service provider using
type of service (ToS) bits or DSCPs in the IP header
n Drop policy to avoid congestion using weighted random early detection (WRED)
Deployment Scenarios
You can enable NetFlow on network devices at all layers of the network to record
and analyze all network traffic and identify threats such as malware that could be
spreading laterally through the internal network; in other words, malware that spreads
between adjacent hosts in the network. The following sections describe different types
of NetFlow deployment scenarios within an enterprise network. These deployment
scenarios include the following:
n Wireless LANs
n Internet edge
n Data center
Tip As a best practice, NetFlow should be enabled as close to the access layer as
possible (user access layer, data center access layer, in VPN termination points, and so
on). Another best practice is that all NetFlow records belonging to a flow should be sent
to the same collector.
If the access switches do not support NetFlow, you can deploy a Cisco NGA or Lancope
StealthWatch FlowSensor to generate the NetFlow data. Cisco NGA or the Lancope
StealthWatch FlowSensor must be placed in a Layer 1 or Layer 2 adjacent manner to the
monitoring area of the network.
Note To gain network visibility, Test Access Ports (TAPs) or Switched Port Analyzer
(SPAN) ports must be configured when the Cisco NGA or the Lancope StealthWatch
FlowSensor are deployed.
Deployment Scenarios 25
Internet
Internet Edge
NetFlow-Enabled
Switches
!
Core
Rest of
Corporate
Network
n Cisco AVC works on traffic from Cisco wireless access points (APs) configured in
local mode or enhanced local mode. APs configured in local mode provide wireless
service to clients in addition to limited time-sliced attacker scanning. There is an
enhanced local mode feature (just called enhanced local mode) that, like local mode,
provides wireless service to clients, but when scanning off-channel, the radio dwells
on the channel for an extended period of time, allowing enhanced attack detection.
26 Chapter 1: Introduction to NetFlow and IPFIX
n Cisco AVC also works with FlexConnect central switching and OfficeExtend
Access Point (OEAP) traffic.
n Cisco AVC is based on port, destination, and heuristics, which allows reliable packet
classification with deep visibility.
n Cisco AVC looks into the initial setup of the client flow (first 10 to 20 packets), so
loading on the controller system is minimal.
n Cisco AVC and NetFlow support is available for all Cisco controllers supporting
Cisco WLC Software Version 7.4 or later.
Rest of
CAPWAP Tunnel
Corporate
Wireless Clients
Network
AP WLC
(NetFlow-Enabled)
Cisco WLC and APs establish a Control And Provisioning of Wireless Access Points
(CAPWAP) tunnel between them for communication.
Note CAPWAP is an IETF standard that is based on its predecessor, the Lightweight
Access Point Protocol (LWAPP). CAPWAP provides an upgrade path from Cisco
products that use LWAPP to next-generation Cisco wireless products to interoperate
with third-party APs and to manage radio frequency identification (RFID) readers and
similar devices.
multigigabit performance to meet the requirements for Internet gateway functions for
medium and large organizations. The architecture of the Cisco ASRs include the Cisco
QuantumFlow Processor that provides a lot of high-performance features such as appli-
cation layer gateways (ALGs), all Layer 4 to Layer 7 zone-based firewall session process-
ing, high-speed NAT and firewall translation logging, as well as NetFlow Event Logging
(NEL). NEL uses NetFlow v9 templates to log binary syslog to NEL collectors, allowing
not only the use of NAT at multigigabit rates but also the ability to record NAT and fire-
wall session creation and teardown records at very high speeds.
Note You can use Cisco Feature Navigator to get details of all NAT- and firewall-
related features for the Cisco ASR 1000 series routers at http://tools.cisco.com/ITDIT/
CFN/jsp/index.jsp.
Figure 1-13 shows how two ASR Cisco ASR 1000 series routers connected to two differ-
ent Internet service providers (ISPs) and enabled for NetFlow. The ISP edge is a critical
part of the Internet edge because it provides the interface to the public Internet infra-
structure.
ISP 1 ISP 2
Internet Edge
Rest of
Corporate
Network
The Internet edge can be built out of many platforms and components that may fail or
that may be subject to attack. Designing a redundant architecture helps eliminate single
points of failure, thereby improving the availability and resiliency of the network.
Tip The Internet edge should be designed with several layers of redundancy including
redundant interfaces and standby devices. Redundant interfaces at various points of the
architecture provide alternative paths. Dynamic routing protocols should be used for
path selection. The design allows for the use of multiple ISP connections, each served by
different interfaces.
Enterprise
Network
Offsite DC
Public Internet
Cloud
Mobile
North - South Traffic
DATA
CENTER
API FABRIC Storage
Orchestration/
Monitoring
Server/Compute Services
The data center has many different high-throughput and low-latency requirements, in
addition to increasing high-availability requirements. In addition, automated provisioning
and control with orchestration, monitoring, and management tools are crucial.
The data center architecture consists of three primary modular layers with hierarchical
interdependencies:
n Data center foundation: Primary building block of the data center on which all
other services rely. Despite of the size of the data center, the foundation must be
resilient, scalable, and flexible to support data center services that add value, per-
formance, and reliability. The data center foundation provides the computing neces-
sary to support the applications that process information and the seamless transport
between servers, storage, and the end users who access the applications.
n User services: Include e-mail, order processing, and file sharing or any other appli-
cations in the data center that rely on the data center foundation and services like
database applications, modeling, and transaction processing.
Figure 1-15 illustrates some of the components of the data center services architecture.
Examples of the data center service insertion components include the following:
n Firewalls
Note ACI in the data center is a holistic architecture with centralized automation and
policy-driven application profiles. Its main goal is to provide software flexibility with the
scalability of hardware performance and simplified automation by an application-driven
policy model with real-time application health monitoring. ACI is covered in more detail
in Chapter 8.
30 Chapter 1: Introduction to NetFlow and IPFIX
Rest of
Corporate
Network
CORE
Physical DC
Service Appliances
(Firewalls, Load
Balances, etc.)
Virtual DC
Services in
Software
VM VM VM VM VM VM
NetFlow collection in large data centers can be very challenging because of the large
amount of data being generated at very high rates. In this case, the Cisco NGA provides
a high-performance solution for flow visibility in multigigabit data centers. The Cisco
NGA has four 10G monitoring interfaces and up to four independent flow caches and
flow monitors. In other words, the Cisco NGA can receive up to 40 gigabits of data and
support various combinations of data ports, record templates, and export parameters.
Figure 1-16 shows how two Cisco NGAs are deployed in the data center services
architecture.
Deployment Scenarios 31
Rest of
Corporate
Network
CORE
Cisco NGAs
Virtual DC
Services in
Software
VM VM VM VM VM VM
The Cisco NGA can be placed to receive data from the physical access, aggregation,
and core layers is to maintain complete visibility of all traffic within the data center, in
addition to traffic that is leaving the data center (north-to-south and east-to-west traffic).
Traffic within the virtual environment (VM-to-VM traffic) can be monitored using the
Nexus 1000V, and traffic entering and leaving the data center can be monitored using
edge devices such as the Cisco ASA and Nexus 7000. Strategically placing the NGA in
the aggregation and core layers ensures effective monitoring of traffic within the data
center, and provides additional statistics for traffic leaving the data center.
If the deployment of the Cisco NGA is not possible, you can enable NetFlow in the
Cisco ASA or enabled in any other strategic areas of the data center such as data center
distribution switches and access switches.
32 Chapter 1: Introduction to NetFlow and IPFIX
The Cisco Nexus 7000 series switches support NetFlow in hardware with the F2,
Enhanced F2, and F3 series modules. Without these modules, NetFlow is supported
in software. If NetFlow generation is performed in software, it consumes more CPU
resources.
Tip The Cisco Nexus 7000 supports SPAN ports that can be used to send the raw traf-
fic to a Cisco NGA for NetFlow generation in hardware. The SPAN method using NGA is
the best recommendation for NetFlow in a data center environment because it minimizes
design considerations around NetFlow cache size. This maintains the performance of the
Nexus 7000 without losing NetFlow information. When SPAN is configured locally, the
SPAN source is one or both of the following:
Note SPAN of primary and or secondary private VLANs (PVLANs) is also supported.
The Cisco Nexus 1000V VSM supports NetFlow. However, it performs NetFlow gen-
eration in software. It cannot be configured as an aggregation device as the Nexus 7000
does. In busy data centers, there could be a performance impact in the Nexus 1000V
when NetFlow is configured.
Deployment Scenarios 33
ASAv ASAv
1000V 1000V
CSR CSR
1000V 1000V
Tenant A Tenant B
UCS
Top of
Rack
(ToR)
Cloud Switch
Internet MPLS
Branch HQ/Data
Office Center
Figure 1-18 shows how two remote-access VPN clients connect to a Cisco ASA in the
corporate network.
209.165.201.10
unnel
Rest of Corporate P NT SSL VPN Client
Network LV
SS (AnyConnect)
Internet
Router1 ASA
IPs
ec
(IK
Ev2
)T 209.165.201.20
unn
el
IPsec Client
(AnyConnect)
Cisco ISE
DNS
The remote-access clients use the Cisco AnyConnect Secure Mobility Client. One is cre-
ating a Secure Sockets Layer (SSL) VPN tunnel, and the other is creating an IPsec tunnel.
Note Detailed configurations of the Cisco ASA and the Cisco AnyConnect Secure
Mobility Solution can be learned in the Cisco Press book Cisco ASA: All-in-One Next-
Generation Firewall, IPS, and VPN Services, 3rd Edition.
NetFlow Secure Event Logging (NSEL) can be enabled at the Cisco ASA to monitor traf-
fic from any type of remote-access client VPN termination.
Business Partner
(Las Vegas)
ASA
c
se
IP
Corporate
Headquarters
(New York) Internet
R1
IP
se
c
Branch Office
(Raleigh, NC)
R2
In Figure 1-19, two site-to-site VPNs are terminated in the router (R1) at the corporate
headquarters. One of the tunnels connects to a Cisco ASA at a business partner, and the
second tunnel connects the corporate headquarters to a remote branch office in Raleigh,
North Carolina. In the example, NetFlow can be enabled in R1 to monitor traffic coming
from both of the remote locations. In addition, the business partner can enable NSEL in
the Cisco ASA to also maintain visibility of the VPN traffic. To make things more com-
plicated, an administrator could also enable NetFlow in the router at the remote branch
office in Raleigh (R2).
Many different factors affect the volume of NetFlow records generated by network
infrastructure devices. Forecasting an exact number can be difficult. As a general rule,
a NetFlow-enabled device can generate between 1000 and 5000 fps per 1 gigabit per
second (Gbps) of traffic passing through such device. The number of fps fundamentally
depends on the following:
n The lifetime of each of the flows. Some flows can be short-lived and others may be
long-lived.
The network overhead introduced by NetFlow is also influenced by the number of fps
and the NetFlow record size.
Tip Cisco recommends NetFlow v9, which results in an average of 34 NetFlow records
per 1500-byte packet. Cisco also recommends an active timer of 60 seconds and an
inactive timer of 15 seconds.
Careful planning is required when enabling NetFlow in high-impact areas of your net-
work. You can start by enabling NetFlow in certain areas of your network and become
familiar with the impact it may have in the rest of your deployment. A few tools are
available that you can use to forecast the impact of enabling NetFlow in your network.
Summary 37
Note Using random-sampled NetFlow provides NetFlow data for a subset of traffic
in a Cisco router by processing only one randomly selected packet out of a series of
sequential packets. The number of packets or “randomness” is a user-configurable
parameter. This type of statistical traffic sampling substantially reduces the overheard
in CPU and other resources while providing NetFlow data. However, the main use of
random-sampled NetFlow is for traffic engineering, capacity planning, and applications
where full NetFlow is not needed for an accurate view of network traffic.
Summary
NetFlow and IPFIX provide comprehensive visibility into network traffic across an orga-
nization. This visibility has many benefits for network security, IP accounting, billing,
traffic engineering, and network capacity planning. NetFlow technology is supported
across Cisco routers, switches, Cisco ASA, Cisco WLC, virtual routers, and the Cisco
NGA. This chapter provided an overview of NetFlow and IPFIX. It provided informa-
tion about the supported platforms, in addition to several tips when enabling NetFlow
telemetry implemented at all layers of the network. This chapter provided an overview
of how NetFlow enables you to use the network as a sensor, as well as how other
advanced security technologies can enable you to use the network as an enforcer and as
an attack-mitigation accelerator. Several deployment scenarios were covered at the end
of the chapter, providing a conceptual overview of where NetFlow can be enabled in
your organization to maintain visibility of the access layer, wireless network, the Internet
edge, the data center, and site-to-site and remote-access VPN termination points. Several
best practices and general recommendations were covered that can help you when pre-
paring and designing where to enable NetFlow in your organization.
This page intentionally left blank
Chapter 2
Table 2-1 lists of all versions of NetFlow and a brief description of the features
supported.
NetFlow Version 9
The most popular version of NetFlow is Version 9. The NetFlow v9 format is template
based. Templates provide a flexible design to the record format. This feature allows for
future enhancements to NetFlow services without requiring fundamental changes to the
underlying flow record format.
44 Chapter 2: Cisco NetFlow Versions and Features
n Provides a vendor-neutral support for companies that create applications that pro-
vide collector or analysis capabilities for NetFlow are not required to reinvent their
product each time a new NetFlow feature is added.
n New features can be added to NetFlow more quickly, without breaking current
implementations and with backward compatibility.
The NetFlow Version 9 record format consists of a packet header followed by at least
one or more template or data FlowSets. A template FlowSet provides a description of
the fields that will be present in future data FlowSets. These data FlowSets may occur
later within the same export packet or in subsequent export packets. Figure 2-1 shows a
basic illustration of the NetFlow v9 export packet.
Figure 2-2 shows a more detailed illustration of the NetFlow v9 export packet and the
relationship between each field and attributes.
Template 1 Template 2
Template Template
Record Record Data Data Data
Template ID Template ID Record Record Record
#1 #2
(Field (Field (Field
(Specific Field (Specific Field Values) Values) Values)
Types and Types and
Lengths) Lengths)
The format of the NetFlow v9 packet header is very similar to its predecessors, and it is
illustrated in Figure 2-3.
NetFlow Version 9 45
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
Version Count
System Uptime
UNIX Seconds
Package Sequence
Source ID
As previously mentioned, templates are one of the main benefits of NetFlow v9 because
they provide flexibility to allow a NetFlow collector or display application to process
NetFlow data without necessarily knowing the format of the data in advance.
46 Chapter 2: Cisco NetFlow Versions and Features
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Flowset_Id=0
Length
Template_Id
Field_Count
Field_1_Type
Field_1_Length
Field_2_Type
Field_2_Length
Field_3_Type
Field_3_Length
…
Field_N_Type
Field_N_Length
Template_Id
Field_Count
Field_1_Type
Field_1_Length
…
Field_N_Type
Field_N_Length
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Flowset Id=Template ID
Length
Record 1 - Field 1 Value
Record 1 - Field 2 Value
Record 1 - Field 3 Value
Record 1 - Field 4 Value
•
•
•
Record 1 - Field N Value
Record 2 - Field 1 Value
Record 2 - Field 2 Value
Record 2 - Field 3 Value
•
•
•
Record 2 - Field N Value
•
•
•
Padding
As you learned in Chapter 1, IPFIX is modeled after NetFlow v9. This is why many of
these NetFlow v9 concepts and fields are very similar to IPFIX. Just like IPFIX, NetFlow
v9 has the concept of options templates used to supply metadata about the NetFlow
process itself. Figure 2-6 illustrates the format of the options template.
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Flowset Id=1
Length
Template_Id
Option_Scope_Length
Option_Length
Scope_Field_1_Type
Scope_Field_1_Length
…
Scope_Field_N_Length
Option_Field_1_Type
Option_Field_1_Length
…
Option_Field_N_Length
Padding
IPFIX introduces several extensions, the most popular of which is the Information
Element identifiers. These identifiers are compatible with the field types used by
NetFlow v9 that you learned about in the previous sections of this chapter.
There are several similar concepts between NetFlow v9 and IPFIX. The first identifier in
NetFlow v9 is called IN_BYTES and in IPFIX is called octetDeltaCount.
As you learned earlier in this chapter, NetFlow v9 has 127 field types. IPFIX defines
238, many of which are the same that are defined in NetFlow v9. IPFIX allows a vendor
ID to be specified, whereby the vendor can stick proprietary information into NetFlow.
The Cisco Flexible NetFlow IPFIX Export Format feature allows a NetFlow-enabled
device to export packets using the IPFIX export protocol.
Note This feature was introduced in Cisco IOS Software Version 15.2(4)M and Cisco
IOS XE Release 3.7S. Cisco Flexible NetFlow is covered in Chapter 3, “Cisco Flexible
NetFlow.”
Summary
This chapter covered all the historical versions of NetFlow, but concentrated on provid-
ing in-depth technical information about NetFlow v9, its packet format, templates, and
numerous fields. It also provided a high-level comparison with IPFIX.
This page intentionally left blank
Chapter 3
n Teredo
n 6to4
n 6rd
Note Flexible NetFlow classification inside Teredo, ISATAP, 6to4, and 6rd was introduced
in Cisco IOS Software Version 15.2(2)T. Export over IPv6 was introduced in Cisco IOS
Software Version 15.2(2)T, Cisco IOS XE 3.7.0S, and Cisco Nexus Software Version 4.2.1.
60 Chapter 3: Cisco Flexible NetFlow
Interface
Record 3
n Records
n Flow monitors
n Flow exporters
n Flow samplers
In Flexible NetFlow, the administrator can specify what to track, resulting in fewer
flows. This helps to scale in busy networks and use fewer resources that are already
taxed by other features and services.
Introduction to Cisco’s Flexible NetFlow 61
Table 3-1 lists the key fields related to the actual flow, device interface, and Layer 2
services.
Table 3-1 Flexible NetFlow Key Fields Related to Flow, Interface, and Layer 2
Flow Interface Layer 2
Fields Sampler ID Input Source VLAN
Direction Output Destination VLAN
Class ID Dot1q Priority
Source MAC Address
Destination MAC
Address
The predefined records guarantee backward compatibility with legacy NetFlow col-
lectors. Predefined records have a unique blend of key and non-key fields that allows
network administrators and security professionals to monitor different types of traffic in
their environment without any customization.
Note Flexible NetFlow predefined records that are based on the aggregation cache
schemes in legacy NetFlow do not perform aggregation. Alternatively, the predefined
records track each flow separately.
User-Defined Records
As the name indicates, Flexible NetFlow gives network administrators and security pro-
fessionals the flexibility to create their own records (user-defined records) by specifying
key and non-key fields to customize the data collection. The values in non-key fields
are added to flows to provide additional information about the traffic in the flows.
A change in the value of a non-key field does not create a new flow. In most cases,
the values for non-key fields are taken from only the first packet in the flow. Flexible
NetFlow enables you to capture counter values such as the number of bytes and packets
in a flow as non-key fields.
Flexible NetFlow adds a new NetFlow v9 export format field type for the header and
packet section types. A device configured for Flexible NetFlow communicates with the
collector the configured section sizes in the corresponding NetFlow v9 export template
fields.
Flow Monitors
In Flexible NetFlow, flow monitors are applied to the network device interfaces to
perform network traffic monitoring. Flow data is collected from the network traffic and
added to the flow monitor cache during the monitoring process based on the key and
non-key fields in the flow record.
Flow Exporters
The entities that export the data in the flow monitor cache to a remote system are called
flow exporters. Flow exporters are configured as separate entities. Flow exporters are
assigned to flow monitors. An administrator can create several flow exporters and assign
them to one or more flow monitors. A flow exporter includes the destination address
66 Chapter 3: Cisco Flexible NetFlow
of the reporting server, the type of transport (User Datagram Protocol [UDP] or Stream
Control Transmission Protocol [SCTP]), and the export format corresponding of the
NetFlow version or IPFIX.
Note You can configure up to eight flow exporters per flow monitor.
Flow Samplers
Flow samplers are created as separate components in a router’s configuration. Flow sam-
plers are used to reduce the load on the device that is running Flexible NetFlow by limit-
ing the number of packets that are selected for analysis.
Flow sampling exchanges monitoring accuracy for router performance. When you apply
a sampler to a flow monitor, the overhead load on the router of running the flow moni-
tor is reduced because the number of packets that the flow monitor must analyze is
reduced. The reduction in the number of packets that are analyzed by the flow monitor
causes a corresponding reduction in the accuracy of the information stored in the flow
monitor’s cache.
1 2 3 4
Configure a Apply the
Configure a Configure a Flow Exporter Flow Monitor
Flow Record Flow Monitor for the Flow to an
Monitor Interface
The configuration steps, which are described in detailed in the corresponding sections,
are as follows:
Internet
209.165.200.224/29
.225
NY-ASR1004
.233
Corporate 209.165.200.232/29
Headquarters .234
(New York)
10.10.101.123
A Cisco ASR 1004 at the New York headquarters is configured for Flexible
NetFlow. The outside network is 209.165.200.224/29, and the inside network is
209.165.200.232/29.
Note There are hundreds of possible ways to configure customized flow records. The
following steps can be followed to create one of the possible variations. You can create a
customized flow record depending on your organization’s requirements.
Step 1. Log in to your router and enter into enable mode with the enable command:
NY-ASR1004>enable
Step 2. Enter into configuration mode with the configure terminal command:
NY-ASR1004#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Step 3. Create a flow record with the flow record command. In this example, the
record name is NY-ASR-FLOW-RECORD-1. After entering the flow record
68 Chapter 3: Cisco Flexible NetFlow
command, the router enters flow record configuration mode. You can also
use the flow record command to edit an existing flow record:
NY-ASR1004(config)# flow record NY-ASR-FLOW-RECORD-1
Step 5. Configure a key field for the flow record using the match command. In this
example, the IPv4 destination address is configured as a key field for the record:
NY-ASR1004(config-flow-record)# match ipv4 destination address
The output of the match ? command shows all the primary options for the
key field categories that you learned earlier in this chapter.
NY-ASR1004(config-flow-record)# match ?
application Application fields
flow Flow identifying fields
interface Interface fields
ipv4 IPv4 fields
ipv6 IPv6 fields
routing Routing attributes
transport Transport layer fields
Step 6. Configure a non-key field with the collect command. In this example, the
input interface is configured as a non-key field for the record:
NY-ASR1004(config-flow-record)#collect interface input
The output of the collect ? command shows all the options for the non-key
field categories that you learned earlier in this chapter:
NY-ASR1004(config-flow-record)# collect ?
application Application fields
counter Counter fields
flow Flow identifying fields
interface Interface fields
ipv4 IPv4 fields
ipv6 IPv6 fields
routing Routing attributes
timestamp Timestamp fields
transport Transport layer fields
Step 7. Exit configuration mode with the end command and return to privileged
EXEC mode:
NY-ASR1004(config-flow-record)# end
Note You can configure Flexible NetFlow to support NBAR with the match application
name command under Flexible NetFlow flow record configuration mode.
Flexible NetFlow Configuration 69
You can use the show flow record to show the status and fields for the flow record. If
multiple flow records are configured in the router, you can use the show flow record
name command to show the output of a specific flow record, as shown in Example 3-1.
Use the show running-config flow record command to show the flow record configura-
tion in the running configuration, as shown in Example 3-2.
Step 1. Log in to your router and enter into enable mode with the enable command:
NY-ASR1004>enable
Step 2. Enter into configuration mode with the configure terminal command:
NY-ASR1004# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Step 3. Create a flow monitor with the flow monitor command. In this example, the
flow monitor is called NY-ASR-FLOW-MON-1:
NY-ASR1004(config)# flow monitor NY-ASR-FLOW-MON-1
70 Chapter 3: Cisco Flexible NetFlow
In the following example, the record ? command is used to see all the flow
monitor record options:
NY-ASR1004(config-flow-monitor)# record ?
NY-ASR-FLOW-RECORD-1 Used for basic traffic analysis
netflow Traditional NetFlow collection schemes
netflow-original Traditional IPv4 input NetFlow with origin ASs
Step 6. Exit configuration mode with the end command and return to privileged
EXEC mode:
NY-ASR1004(config-flow-record)# end
You can use the show flow monitor to show the status and configured parameters for
the flow monitor, as shown in Example 3-3.
Use the show running-config flow monitor command to display the flow monitor con-
figuration in the running configuration, as shown in Example 3-4.
Note Flow exporters use UDP as the transport protocol and use the NetFlow v9 export
format. Each flow exporter supports only one destination. If you want to export the data
to multiple destinations, you must configure multiple flow exporters and assign them to
the flow monitor.
Step 1. Log in to the router and enter into enable and configuration mode, as you
learned in previous steps.
Step 2. Create a flow exporter with the flow exporter command. In this example,
the exporter name is NY-EXPORTER-1:
NY-ASR1004(config)# flow exporter NY-EXPORTER-1
Step 4. Configure the export protocol using the export-protocol command. In this
example, NetFlow v9 is used. You can also configure legacy NetFlow v5 with
the netflow-v5 keyword or IPFIX with the ipfix keyword. IPFIX support
was added in Cisco IOS Software Release 15.2(4)M and Cisco IOS XE
Release 3.7S:
NY-ASR1004(config-flow-exporter)# export-protocol netflow-v9
Step 5. Enter the IP address of the destination host with the destination command.
In this example, the destination host is 10.10.10.123:
NY-ASR1004(config-flow-exporter)# destination 10.10.10.123
Step 6. You can configure the UDP port used by the flow exporter with the trans-
port udp command. The default is UDP port 9995.
Step 7. Exit the Flexible NetFlow flow monitor configuration mode with the exit
command and specify the name of the exporter in the flow monitor:
NY-ASR1004(config)# flow monitor NY-ASR-FLOW-MON-1
NY-ASR1004(config-flow-monitor)# exporter NY-EXPORTER-1
You can use the show flow exporter command to view the configured options for the
Flexible NetFlow exporter, as demonstrated in Example 3-5.
72 Chapter 3: Cisco Flexible NetFlow
You can use the show running-config flow exporter command to view the flow export-
er configuration in the command-line interface (CLI), as demonstrated in Example 3-6.
You can use the show flow monitor name NY-ASR-FLOW-MON-1 cache format
record command to display the status and flow data in the NetFlow cache for the flow
monitor, as demonstrated in Example 3-7.
Example 3-7 Output of the show flow monitor Name NY-ASR-FLOW-MON-1 Cache
Format Record Command
Summary
Flexible NetFlow is the Cisco next generation of NetFlow. It allows network admin-
istrators and security professionals to create their own customized records for more
granular network analysis. This chapter provided an in-depth description Cisco’s Flexible
NetFlow, its components, and fields. It then showed you how to create Flexible
NetFlow flow records, configure a flow monitor, configure a flow exporter for the flow
monitor, and apply the flow monitor to an interface.
Chapter 4
Two of the most popular commercial products are Lancope’s StealthWatch solution and
Plixer Scrutinizer, as described in greater detail in the sections that follow.
and control system that you can use for access control and security compliance for
wired, wireless, and virtual private network (VPN) connections.
Note The Cisco CTD Solution is covered in detail in Chapter 6, “Cisco Cyber Threat
Defense and NetFlow.”
One other major benefit of Lancope’s StealthWatch is its graphical interface, which
includes great visualizations of network traffic, customized summary reports, and inte-
grated security and network intelligence for drill-down analysis.
In Figure 4-1, a summary report of inbound and outbound traffic for a predefined host
group in the inside network (Engineering) is displayed.
Figure 4-2 shows a report of the top applications observed in the network for the client
and server host group called Inside Hosts. In this report, you can see that the top appli-
cation observed was Skype. You can drill down each application and host to get more
detailed information about what is happening in the network.
78 Chapter 4: NetFlow Commercial and Open Source Monitoring and Analysis Software Packages
Lancope has a security research initiative that tracks emerging threat information from
around the world called the StealthWatch Labs Intelligence Center (SLIC). Figure 4-3
illustrates the major components of Lancope’s StealthWatch solution.
Cisco ISE
StealthWatch
IDentity
StealthWatch StealthWatch
FlowCollector FlowReplicator
Netflow-Enabled
Devices
SYSLOG, SNMP
The following are the primary components of the Lancope StealthWatch solution shown
in Figure 4-1:
n FlowSensor: A physical or virtual appliance that can generate NetFlow data when
legacy Cisco network infrastructure components are not capable of producing
line-rate, unsampled NetFlow data. Alternatively, the Cisco NetFlow Generator
Appliance (NGA) can be used.
Note Lancope StealthWatch also support usernames within NetFlow records from
Cisco ASA appliances.
Plixer’s Scrutinizer
Plixer’s Scrutinizer is another commercial NetFlow monitoring and analysis software
package that has gone through interoperability tests by Cisco. Scrutinizer is used for
incident response and network monitoring. Just like several components of Lancope’s
StealthWatch solution, Scrutinizer is available as a physical or virtual appliance.
Plixer also sells two other products that provide additional network visibility: FlowPro
and Flow Replicator.
80 Chapter 4: NetFlow Commercial and Open Source Monitoring and Analysis Software Packages
FlowPro is an appliance that can be deployed in a specific area of the corporate network
to perform deep packet inspection (DPI) combining NetFlow/IPFIX data. Plixer’s Flow
Replicator allows several sources of network device and server log data to be replicated
to different destinations. Flow Replicator can also be configured as a syslog to IPFIX
gateway. It converts syslog messages and forwards them on inside IPFIX datagrams.
Table 4-2 lists the most popular open source NetFlow monitoring and analysis software
packages.
Table 4-2 Examples of Open Source NetFlow Monitoring and Analysis Software
Open Source Software Description Website
cflowd Traffic flow analysis tool http://www.caida.org/tools/
rovided by the Center for
p measurement/cflowd
Applied Internet Data Analysis.
flowtools Tool set for collecting and work- http://www.splintered.net/
ing with NetFlow data created by sw/flow-tools
Mark Fullmer.
flowviewer FlowViewer is a web-based http://sourceforge.net/proj-
interface to flow tools and SiLK. ects/flowviewer
flowd Small-packaged NetFlow http://www.mindrot.org/
c ollector. projects/flowd
IPFlow NetFlow collector developed http://www.ipflow.utc.fr
by Christophe Fillot of the
University of Technology of
Compiegne, France.
NFdump NetFlow analysis toolkit under http://nfdump.sourceforge.
the BSD license. net
NfSen Web interface for NFdump. http://sourceforge.net/proj-
ects/nfsen
Stager Provides visualizations for https://trac.uninett.no/stager
NFdump.
Open Source NetFlow Monitoring and Analysis Software Packages 81
Two of the most popular open source NetFlow collection and analysis toolkits are
NFdump (sometimes used with NfSen or Stager) and SiLK, as described in greater detail
in the sections that follow.
NFdump
NFdump is a set of Linux-based tools that support NetFlow Versions 5, 7, and 9. You
can download NFdump from http://nfdump.sourceforge.net and install it from source.
Alternatively, you can easily install NFdump in multiple Linux distributions such as
Ubuntu using sudo apt-get install nfdump, as shown in Example 4-1.
Net
Flow nfcapd
(Binary)
nfcapd nfdump
Flow text
Net
Filters
Routers, firewalls, and any other NetFlow-enabled infrastructure devices can send
NetFlow records to NFdump, as shown in Figure 4-4. The command to capture the
NetFlow data is nfcapd. All processed NetFlow records are stored in one or more
binary files. These binary files are read by nfdump and can be displayed in plain text to
standard output (stdout) or written to another file. Example 4-2 demonstrates how the
nfcapd command is used to capture and store NetFlow data in a directory called net-
flow. The server is configured to listen to port 9996 for NetFlow communication.
Flows are read either from a single file or from a sequence of files. In Example 4-2, a
series of files were created by the nfcapd daemon. Example 4-3 shows the command
options of the nfcapd daemon command.
Example 4-4 demonstrates how to use the nfdump command to process and analyze all
files that were created by nfcapd in the netflow directory.
Example 4-4 Processing and Displaying the nfcapd Files with nfdump
Summary: total flows: 8115, total bytes: 0, total packets: 0, avg bps: 0, avg
pps: 0, avg bpp: 0
Time window: 2015-06-13 22:35:10 - 2015-06-13 22:35:13
Total flows processed: 8115, Blocks skipped: 0, Bytes read: 457128
Sys: 0.009s flows/second: 829924.3 Wall: 0.008s flows/second: 967222.9
86 Chapter 4: NetFlow Commercial and Open Source Monitoring and Analysis Software Packages
In Example 4-4, you can see the top talkers (top hosts that are sending the most traffic in the
network). You can refer to the nfdump man pages for details about usage of the nfdump
command (using the man nfdump command). Example 4-5 shows an excerpt of the output
of the nfdump man pages showing several examples of the nfdump command usage.
EXAMPLES
nfdump -r /and/dir/nfcapd.201107110845 -c 100 'proto tcp and ( src ip
172.16.17.18 or dst ip 172.16.17.19 )' Dumps the first 100 netflow records which
match the given filter:
nfdump -r /and/dir/nfcapd.201107110845 'inet6 and proto tcp and ( src port >
1024 and dst port 80 ) Dumps all port 80 IPv6 connections to any web server.
NOTES
Generating the statistics for data files of a few hundred MB is no problem.
However be careful if you want to create statistics of several GB of data. This
may consume a lot of memory and can take a while. Flow anonymization has moved
into nfanon.
SEE ALSO
nfcapd(1), nfanon(1), nfprofile(1), nfreplay(1)
NfSen
NfSen is the graphical web-based front end for NFdump. You can download and obtain
more information about NFSen at http://nfsen.sourceforge.net.
SiLK
The SiLK analysis suite is a very popular open source command-line Swiss army knife
developed by CERT. Administrators and security professionals combine these tools
Open Source NetFlow Monitoring and Analysis Software Packages 87
in various ways to perform detailed NetFlow analysis. SiLK includes numerous tools
and plug-ins.
The SiLK Packing System includes several applications (daemons) that collect NetFlow
data and translate them into a more space efficient format. SiLK stores these records
into service-specific binary flat files for use by the analysis suite. Files are organized in a
time-based directory hierarchy. The following are the SiLK daemons:
n flowcap: Listens to flow generators and stores the data in temporary files.
n rwflowpack: Processes flow data either directly from a flow generator or from files
generated by flowcap. Then it converts the data to the SiLK flow record format.
n rwsender: Watches an incoming directory for files, moves the files into a processing
directory, and transfers the files to one or more rwreceiver processes.
n rwreceiver: Receives and processes files transferred from one or more rwsender
processes and stores them in a destination directory.
n rwpollexec: Monitors a directory for incoming files and runs a user-specified com-
mand on each file.
n rwpackchecker: Reads SiLK flow records and checks for unusual patterns that may
indicate data file corruption.
n rwfilter: The most important analysis tool in SiLK. It is an application for querying
NetFlow records stored in SiLK’s database.
n rwcount: Used to count and summarize NetFlow records across time (referred to as
time bins). Its output includes counts of bytes, packets, and flow records for each
time bin.
n rwuniq: User-specified key unique record attributes. It can print columns for the
total byte, packet, and/or flow counts for each bin. rwuniq can also count the
number of individual values for a field.
n rwstats: Summarizes NetFlow records just like rwuniq, but sorts the results by a
value field to generate a Top-N or Bottom-N list and prints the results.
n rwtotal: Summarizes NetFlow records by a specified key and print the sum of the
byte, packet, and flow counts for flows matching such key. rwtotal is faster than
rwuniq because it uses a fixed amount of memory; however, it has a limited set of
keys.
n rwgroup: Groups NetFlow records by a user-specified key that include record attri-
butes, labels the records with a group ID that is stored in the Next-Hop IP field, and
writes the resulting binary flows to a file or to standard output.
n rwmatch: Matches records as queries and responses, marks mated records with an
identifier that is stored in the Next-Hop IP field, and writes the binary flow records
to the output.
n rwset: Generates binary IPset files containing the source IP addresses or destination
IP addresses in NetFlow records.
n rwsetcat: Prints the contents of a binary IPset file as text along with additional
information from the NetFlow record.
n rwbag: Reads NetFlow records and builds binary bags containing key-count pairs.
n rwbagtool: Adds or subtracts attributes within binary bag files and produces a new
binary bag file.
n rwpmapbuild: Generates a binary prefix map file for use with the Address Type
(addrtype) and Prefix Map (pmapfilter) utilities.
n rwipaimport: Used to import a SiLK IPset, bag, or prefix map files into the IP
Address Association (IPA) data store.
n rwipaexport: Used to export a set of IP addresses from the IPA data store to a SiLK
IPset, bag, or prefix map.
n int-ext-fields: Prints fields containing internal and external IPs and ports (int-ip,
ext-ip, int-port, and ext-port).
90 Chapter 4: NetFlow Commercial and Open Source Monitoring and Analysis Software Packages
n ipafilter: Known as the IP Association (IPA) plug-in. It works with rwfilter to parti-
tion flows based on data in an IPA data store. rwfilter will automatically load this
plug-in if it is available. This plug-in requires that SiLK be compiled with IPA sup-
port.
n rwpcut: Reads a packet-capture file and prints its contents in a textual form similar
to that produced by rwcut.
n rwpdedupe: Detects and removes duplicate records from multiple packet capture
input files.
n rwpmatch: Filters a packet-capture file by writing only packets whose five-tuple and
time stamp match corresponding records in a SiLK flow file.
n rwpdu2silk: Creates a stream of SiLK flow records from a file containing NetFlow
v5 PDU records.
n rwcat: Reads SiLK flow records from the files named on the command line. Similar
to the Linux cat command.
n rwcompare: Compares two SiLK flow files to determine whether they contain the
same flow records.
Open Source NetFlow Monitoring and Analysis Software Packages 91
n rwdedupe: Removes any duplicate flow records. rwdedupe will reorder the records
as part of its processing.
n rwnetmask: “Zeroizes” the least significant bits of the source, destination, or next-
hop IP addresses, and writes the resulting records to a file or standard output.
n rwswapbytes: Changes the byte order of the records in a given input SiLK flow file.
n rwfileinfo: Prints file information, including file type, version, and other attributes.
n rwsiteinfo: Prints information about the sensors, classes, and types specified in the
silk.conf file.
n rwfglob: Prints the list of files that rwfilter would normally process for a given set
of file selection switches.
n num2dot: Processes delimited text from the standard input, converts integer values
in the specified columns to dotted-decimal IP address, and prints the result to stan-
dard output.
n rwresolve: Processes delimited text from the standard input, attempts to resolve the
IP addresses in the specified columns to hostnames, and prints the result to the stan-
dard output.
n rwgeoip2ccmap: Generates the country code mapping file required by the ccfil-
ter utility from the MaxMind GeoIP database. For more information about the
MaxMind GeoIP database, go to https://www.maxmind.com/en/geolocation_land-
ing.
n rwidsquery: Invokes rwfilter to find flow records matching Cisco Sourcefire Snort
signatures.
n silk_config: Prints information about how SiLK was compiled. This information can
be used for troubleshooting purposes.
Note Chapter 8, “Case Studies” provides several examples of how SiLK is used in a
small and medium-sized enterprise.
92 Chapter 4: NetFlow Commercial and Open Source Monitoring and Analysis Software Packages
Distributed Search
Elasticsearch and Analytics
ELK
The following sections provide details about the components illustrated in Figure 4-5.
Elasticsearch
Elasticsearch is the name of a distributed search and analytics engine, but it is also the
name of the company founded by the folks behind Elasticsearch and Apache Lucene.
Elasticsearch is built on top of Apache Lucene, which is a high-performance search and
information retrieval library that is written in Java. Elasticsearch is a schema-free, full
text search engine with multilanguage support. It provides support for geolocation, sug-
gestive search, autocompletion, and search snippets.
Logstash
Logstash offers centralized log aggregation of many types, such as network infrastruc-
ture device logs, server logs, and also Netflow. Logstash is written in JRuby and runs in
a Java Virtual Machine (JVM). It has a very simple message-based architecture. Logstash
has a single agent that is configured to perform different functions in combination with
the other ELK components. Figure 4-6 illustrates Logstash’s architecture.
Open Source NetFlow Monitoring and Analysis Software Packages 93
Shipper
Shipper
Search
Broker Indexer and
Storage
Shipper Web Interface
(Kibana)
Shipper
In Figure 4-6, you can see the four major components in the Logstash ecosystem. The
following are the details of each component:
n The shipper: Sends events to Logstash. Typically, remote agents will only run this
component.
n The search and storage: Allows you to search and store events.
Logstash is very scalable because servers running Logstash can run one or more of these
aforementioned components independently.
Kibana
Kibana is an analytics and visualization platform architected for Elasticsearch. It provides
real-time summary and charting of streaming data, with the ability to share and embed
dashboards.
94 Chapter 4: NetFlow Commercial and Open Source Monitoring and Analysis Software Packages
n Shield: Provides security features to ELK such as role-based access control, authen-
tication, IP filtering, encryption of ELK data, and audit logging. Shield is not free,
and it requires a license. You can obtain more information about Shield at http://
www.elasticsearch.org/overview/shield.
Elasticsearch also provides integration with big data platforms such as Hadoop.
The following sections provide several tips and guidance on how to deploy ELK for
NetFlow analysis.
NetFlow-Enabled
Corporate Router
Network (R1)
Internet
10.1.1.0/24
R2
Management
Network
ELK Server
172.18.104.179
Installing ELK
Java is required for Elasticsearch and Logstash to work. You can install OpenJDK or
Oracle Java. In the following example, Oracle Java is installed. You can use the sudo
add-apt-repository -y ppa:webupd8team/java command to add the Oracle Java
Personal Package Archive (PPA) to the Ubuntu Server, as shown in Example 4-6.
After you add the PPA, update the apt package database with the sudo apt-get update
command, as shown in Example 4-7.
Install the latest stable version of Oracle Java with the sudo apt-get -y install oracle-
javaXX-installer command (XX is the version of Java). Oracle Java 8 is installed as fol-
lows:
omar@elk-srv1:~$ sudo apt-get -y install oracle-java8-installer
Installing Elasticsearch
The following are the steps necessary in order to install Elasticsearch in Ubuntu Server:
Step 1. Add the Elasticsearch public GPG key into apt with the following command:
wget -O - http://packages.elasticsearch.org/GPG-KEY-elasticsearch |
sudo apt-key add -
Step 2. Create the Elasticsearch source list with the following command:
echo 'deb http://packages.elasticsearch.org/elasticsearch/1.4/debian
stable main' |
sudo tee /etc/apt/sources.list.d/elasticsearch.list
Step 3. Use the sudo apt-get update command to update your apt package database.
Step 4. Install Elasticsearch with the sudo apt-get -y install elasticsearch=1.4.4 com-
mand. In this example, Elasticsearch Version 1.4.4 is installed. For the latest
version of Elasticsearch, visit https://www.elastic.co.
# For information on supported formats and syntax for the config file, see
# <http://elasticsearch.org/guide/en/elasticsearch/reference/current/setup-configu-
ration.html>
# Every node can be configured to allow or deny being eligible as the master,
# and to allow or deny to store the data.
#
# Allow this node to be eligible as a master node (enabled by default):
#
#node.master: true
#
# Allow this node to store data (enabled by default):
#
#node.data: true
# 2. You want this node to only serve as a master: to not store any data and
# to have free resources. This will be the "coordinator" of your cluster.
#
#node.master: true
#node.data: false
#
# 3. You want this node to be neither master nor data node, but
# to act as a "search load balancer" (fetching data from nodes,
# aggregating results, etc.)
#
#node.master: false
#node.data: false
# A node can have generic attributes associated with it, which can later be used
# for customized shard allocation filtering, or allocation awareness. An attribute
# is a simple key value pair, similar to node.key: value, here is an example:
#
#node.rack: rack314
# By default, multiple nodes are allowed to start from the same installation loca-
tion
# to disable it, set the following:
#node.max_local_storage_nodes: 1
# Note, that for development on a local machine, with small indices, it usually
# makes sense to "disable" the distributed features:
#
#index.number_of_shards: 1
#index.number_of_replicas: 0
# These settings directly affect the performance of index and search operations
# in your cluster. Assuming you have enough machines to hold shards and
# replicas, the rule of thumb is:
#
# 1. Having more *shards* enhances the _indexing_ performance and allows to
# _distribute_ a big index across machines.
# 2. Having more *replicas* enhances the _search_ performance and improves the
# cluster _availability_.
#
# The "number_of_shards" is a one-time setting for an index.
#
# The "number_of_replicas" can be increased or decreased anytime,
# by using the Index Update Settings API.
#
# Elasticsearch takes care about load balancing, relocating, gathering the
# results from nodes, etc. Experiment with different settings to fine-tune
# your setup.
# Path to directory where to store index data allocated for this node.
#
100 Chapter 4: NetFlow Commercial and Open Source Monitoring and Analysis Software Packages
#path.data: /path/to/data
#
# Can optionally include more than one location, causing data to be striped across
# the locations (a la RAID 0) on a file level, favoring locations with most free
# space on creation. For example:
#
#path.data: /path/to/data1,/path/to/data2
# If a plugin listed here is not installed for current node, the node will not
start.
#
#plugin.mandatory: mapper-attachments,lang-groovy
# Elasticsearch performs poorly when JVM starts swapping: you should ensure that
# it _never_ swaps.
#
# Set this property to true to lock the memory:
#
#bootstrap.mlockall: true
# Make sure that the ES_MIN_MEM and ES_MAX_MEM environment variables are set
# to the same value, and that the machine has enough memory to allocate
# for Elasticsearch, leaving enough memory for the operating system itself.
t
#
# You should also make sure that the Elasticsearch process is allowed to lock
# the memory, eg. by using `ulimit -l unlimited`.
Open Source NetFlow Monitoring and Analysis Software Packages 101
# Set the address other nodes will use to communicate with this node. If not
# set, it is automatically derived. It must point to an actual IP address.
#
#network.publish_host: 192.168.0.1
# Set a custom port for the node to node communication (9300 by default):
#
#transport.tcp.port: 9300
# The gateway allows for persisting the cluster state between full cluster
102 Chapter 4: NetFlow Commercial and Open Source Monitoring and Analysis Software Packages
# restarts. Every change to the state (such as adding an index) will be stored
# in the gateway, and when the cluster starts up for the first time,
# it will read its state from the gateway.
# There are several types of gateway implementations. For more information, see
# <http://elasticsearch.org/guide/en/elasticsearch/reference/current/modules-gate-
way.html>.
# Settings below control how and when to start the initial recovery process on
# a full cluster restart (to reuse as much local data as possible when using shared
# gateway).
# Set the timeout to initiate the recovery process, once the N nodes
# from previous setting are up (accepts time value):
#
#gateway.recover_after_time: 5m
# Set how many nodes are expected in this cluster. Once these N nodes
# are up (and recover_after_nodes is met), begin recovery process immediately
# (without waiting for recover_after_time to expire):
#
#gateway.expected_nodes: 2
#
#cluster.routing.allocation.node_concurrent_recoveries: 2
# Set the time to wait for ping responses from other nodes when discovering.
# Set this option to a higher value on a slow or congested network
# to minimize discovery failures:
#
#discovery.zen.ping.timeout: 3s
# EC2 discovery allows to use AWS EC2 API in order to perform discovery.
#
# You have to install the cloud-aws plugin for enabling the EC2 discovery.
#
# For more information, see
# <http://elasticsearch.org/guide/en/elasticsearch/reference/current/modules-discov-
ery-ec2.html>
#
# See <http://elasticsearch.org/tutorials/elasticsearch-on-ec2/>
# for a step-by-step tutorial.
# GCE discovery allows to use Google Compute Engine API in order to perform discov-
ery.
#
# You have to install the cloud-gce plugin for enabling the GCE discovery.
#
# For more information, see <https://github.com/elasticsearch/elasticsearch-cloud-
gce>.
#index.search.slowlog.threshold.query.warn: 10s
#index.search.slowlog.threshold.query.info: 5s
#index.search.slowlog.threshold.query.debug: 2s
#index.search.slowlog.threshold.query.trace: 500ms
#index.search.slowlog.threshold.fetch.warn: 1s
#index.search.slowlog.threshold.fetch.info: 800ms
#index.search.slowlog.threshold.fetch.debug: 500ms
#index.search.slowlog.threshold.fetch.trace: 200ms
#index.indexing.slowlog.threshold.index.warn: 10s
#index.indexing.slowlog.threshold.index.info: 5s
#index.indexing.slowlog.threshold.index.debug: 2s
#index.indexing.slowlog.threshold.index.trace: 500ms
Open Source NetFlow Monitoring and Analysis Software Packages 105
#monitor.jvm.gc.young.warn: 1000ms
#monitor.jvm.gc.young.info: 700ms
#monitor.jvm.gc.young.debug: 400ms
#monitor.jvm.gc.old.warn: 10s
#monitor.jvm.gc.old.info: 5s
#monitor.jvm.gc.old.debug: 2s
Step 6. Restart the Elasticsearch service with the sudo service elasticsearch restart
command. You can also use the sudo update-rc.d elasticsearch defaults 95
10 command to start Elasticsearch automatically upon boot.
Install Kibana
The following are the steps necessary to install Kibana in Ubuntu Server:
Step 2. The Kibana configuration file is config/kibana.yml. Edit the file, as shown in
the following example:
omar@elk-srv1:~$ vi ~/kibana-4*/config/kibana.yml
Step 3. Find the line that specifies host. By default, 0.0.0.0 is configured. Replace it
with localhost. This way Kibana will be accessible only to the local host. In
this example, Nginx will be installed, and it will reverse proxy to allow exter-
nal access.
Step 4. Copy the Kibana files to a more suitable directory. The /opt directory is used
in the following example:
omar@elk-srv1:~$ sudo mkdir -p /opt/kibana
omar@elk-srv1:~$ sudo cp -R ~/kibana-4*/* /opt/kibana/
106 Chapter 4: NetFlow Commercial and Open Source Monitoring and Analysis Software Packages
Step 5. To run Kibana as a service, download a init script with the following command:
cd /etc/init.d && sudo wget
https://gist.githubusercontent.com/thisismitch/8b15ac909aed214ad04a/
raw/bce61d85643c2dc
dfbc2728c55a41dab444dca20/kibana4
Step 6. Enable and start the Kibana service with the following commands:
Installing Nginx
In this example, Nginx is used as a reverse proxy to allow external access to Kibana.
Complete the following steps to install Nginx:
Step 1. Use the sudo apt-get install nginx apache2-utils command to install Ngnix.
Step 2. You can use htpasswd to create an admin user. In this example, secadmin is
the admin user:
sudo htpasswd -c /etc/nginx/htpasswd.users secadmin
server_name elk-srv1.example.com;
location / {
proxy_pass http://localhost:5601;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
Step 4. Restart Nginx with the sudo service nginx restart command.
Open Source NetFlow Monitoring and Analysis Software Packages 107
You should now be able to access Kibana in your browser via the fully qualified domain
name (FQDN) or its IP address.
Install Logstash
Complete the following steps to install Logstash in the Ubuntu Server:
Step 2. Install Logstash with the sudo apt-get install logstash command, as shown here:
omar@elk-srv1:~$ sudo apt-get install logstash
Step 3. The Logstash configuration files are under /etc/logstash/conf.d. The configu-
ration files are in JSON format. The configuration consists of three sections:
inputs, filters, and outputs:
input {
udp {
port => 9996
codec => netflow {
definitions => "/opt/logstash/codecs/netflow/netflow.yaml"
versions => 9
}
}
}
output {
stdout { codec => rubydebug }
if ( [host] =~ "172.18.104.1" ) {
elasticsearch {
index => "logstash_netflow-%{+YYYY.MM.dd}"
host => "localhost"
}
} else {
elasticsearch {
index => "logstash-%{+YYYY.MM.dd}"
host => "localhost"
}
}
}
108 Chapter 4: NetFlow Commercial and Open Source Monitoring and Analysis Software Packages
The following template is used for the server to be able to parse the fields from
NetFlow:
curl -XPUT localhost:9200/_template/logstash_netflow9 -d '{
"template" : "logstash_netflow9-*",
"settings": {
"index.refresh_interval": "5s"
},
"mappings" : {
"_default_" : {
"_all" : {"enabled" : false},
"properties" : {
"@version": { "index": "analyzed", "type": "integer" },
"@timestamp": { "index": "analyzed", "type": "date" },
"netflow": {
"dynamic": true,
"type": "object",
"properties": {
"version": { "index": "analyzed", "type": "integer" },
"flow_seq_num": { "index": "not_analyzed", "type": "long" },
"engine_type": { "index": "not_analyzed", "type":
"integer" },
"engine_id": { "index": "not_analyzed", "type":
"integer" },
"sampling_algorithm": { "index": "not_analyzed", "type":
"integer" },
"sampling_interval": { "index": "not_analyzed", "type":
"integer" },
"flow_records": { "index": "not_analyzed", "type":
"integer" },
"ipv4_src_addr": { "index": "analyzed", "type": "ip" },
"ipv4_dst_addr": { "index": "analyzed", "type": "ip" },
"ipv4_next_hop": { "index": "analyzed", "type": "ip" },
"input_snmp": { "index": "not_analyzed", "type": "long" },
"output_snmp": { "index": "not_analyzed", "type": "long" },
"in_pkts": { "index": "analyzed", "type": "long" },
"in_bytes": { "index": "analyzed", "type": "long" },
"first_switched": { "index": "not_analyzed", "type": "date" },
Summary 109
The preceding template is used for Elasticsearch to be able to process all indices that
start with logstash_netflow9.
Tip Do not forget to review examples and provide your own at https://github.com/
santosomar/netflow.
Summary
There are numerous commercial and open source NetFlow monitoring and analysis solu-
tions in the market. This chapter provided an overview of these solutions. It provided
details on two very popular commercial NetFlow monitoring and analysis solutions:
Lancope’s StealthWatch and Plixer’s Scrutinizer. Many small and medium-sized organiza-
tions use open source alternatives for NetFlow monitoring and analysis. This chapter list-
ed several of the most popular open source tools and provided details on several popular
toolkits: NFdump, SiLK, Elasticsearch, Logstash, and Kibana. Chapter 6 and Chapter 8
provide several examples of how these commercial and open source tools are used by
small, medium, and large organizations.
This page intentionally left blank
Chapter 5
n NetFlow and other telemetry sources for big data analytics for cyber security
Advanced analytics can be run against very large diverse data sets to find indicators
of compromise (IOCs). These data sets can include different types of structured and
unstructured data processed in a “streaming” fashion or in batches. NetFlow plays an
important role for big data analytics for cyber security, and you will learn why as you
read through in this chapter.
marketing hype and get down to the basics of the subject. A formal definition for big
data can be obtained in the Merriam-Webster dictionary: http://www.merriam-webster.
com/dictionary/big%20data.
An accumulation of data that is too large and complex for processing by traditional
database management tools.
Big data usually includes data sets with sizes beyond the ability of commonly used
software tools to capture, curate, manage, and process the data within a tolerable
elapsed time.
The size of data that can be classified as big data is a moving target. It can range from a
few terabytes to yottabytes of data in a single data set. For instance:
Tip Cisco has created the Cisco Visual Networking Index (VNI). Cisco VNI is an
ongoing initiative to forecast and analyze the growth and use of the Internet, in addition
to the data being transferred. You can find details of the Cisco VNI global IP traffic
forecast and the methodology behind it at http://www.cisco.com/go/vni.
n E-mail messages
n Presentations
n Blog posts
n Executable files
In the world of cyber security, a lot of the network can be also categorized as unstructured:
n Syslog
n NetFlow
n Packet captures
n Executables
n Malware
n Exploits
Industry experts estimate that the majority of the data in any organization is unstruc-
tured, and the amount of unstructured data is growing significantly. There are numerous,
disparate data sources. NetFlow is one of the largest single sources, and it can grow to
tens of terabytes of data per day in large organizations, and it is expected to grow over
the years to petabytes. The differentiation in the usefulness of any big data solution is
the merging of numerous data sources and sizes that are all in the same infrastructure
and providing the ability to query across all of these different data sets using the same
language and tools.
There is an industry concept called Not-Only SQL (NoSQL), which is the name given to
several databases that do not require SQL to process data. However, some of these data-
bases support both SQL and non-SQL forms of data processing.
Big data analytics can be done in combination of advanced analytics disciplines such as
predictive analytics and data mining.
There are three high-level key items for big data analytics:
There are a few high-level approaches for accelerating the analysis of giant data sets. The
following are the most common:
n Grid computing: A centralized grid infrastructure for dynamic analysis with high
availability and parallel processing.
n Support for Hadoop: Stores and processes large volumes of data on commodity
hardware. Hadoop will be covered in a few pages in the section “Hadoop.”
Examples of technologies used in big data analytics are covered in detail later in this
chapter.
As previously mentioned, NetFlow data can grow to tens of terabytes of data per day
in large organizations, and it is expected to grow over the years to petabytes. However,
many other telemetry sources can be used in conjunction with NetFlow to identify, clas-
sify, and mitigate potential threats in your network. Figure 5-1 shows examples of these
telemetry sources and how they “feed” into a collection engine.
As illustrated in Figure 5-1, NetFlow data, syslog, SNMP logs, server and host logs, packet
captures, and files (such as executables, malware, exploits) can be parsed, formatted, and
combined with threat intelligence information and other “enrichment data” (network meta-
data) to perform analytics. This process is not an easy one; this is why Cisco has created
an open source framework for big data analytics called Open Security Operations Center
(OpenSOC). The following section provides an in-depth look at the OpenSOC framework.
OpenSOC 115
Threat Intelligence
Feeds
SYSLOG SNMP
Server and
Parse + Format
NetFlow
Host Logs
Enrichment
Analytics
Packet
Executables
Captures
Malware Exploits
Enrichment
Data
OpenSOC
OpenSOC was created by Cisco to attack the “big data problem” for their Managed
Threat Defense offering. Cisco has developed a fully managed service delivered by
Cisco Security Solutions to help customers protect against known intrusions, zero-day
attacks, and advanced persistent threats. Cisco has a global network of security opera-
tions centers (SOCs) ensuring constant awareness and on-demand analysis 24 hours a
day, 7 days a week. They needed the ability to capture full packet-level data and extract
protocol metadata to create a unique profile of customer’s network and monitor them
against Cisco threat intelligence. As you can imagine, performing big data analytics for
one organization is a challenge, Cisco has to perform big data analytics for numerous
customers including very large enterprises. The goal with OpenSOC is to have a robust
framework based on proven technologies to combine machine learning algorithms and
predictive analytics to detect today’s security threats.
n The ability to capture raw network packets, store those packets, and perform traffic
reconstruction
116 Chapter 5: Big Data Analytics and NetFlow
n Automated reports
n Hadoop
n Flume
n Kafka
n Storm
n Hive
n Elasticsearch
n HBase
n Third-party analytic tool support (R, Python-based tools, Power Pivot, Tableau, and
so on)
Hadoop
The Apache Hadoop or “Hadoop” is a project supported and maintained by the Apache
Software Foundation. Hadoop is a software library designed for distributed processing
of large data sets across clusters of computers. One of the advantages of Hadoop is its
ability to using simple programming models to perform big data processing. Hadoop can
scale from a single server instance to thousands of servers. Each Hadoop server or node
performs local computation and storage. Cisco uses Hadoop clusters in OpenSOC to pro-
cess large amounts of network data for their customers, as part of the Managed Threat
Defense solution, and it also uses Hadoop for its internal threat intelligence ecosystem.
n Hadoop Common: The underlying utilities that support the other Hadoop modules.
n Hadoop Distributed File System (HDFS): A highly scalable and distributed file
system.
OpenSOC 117
n Hadoop YARN: A framework design for job scheduling and cluster resource man-
agement.
Data Center
Distribution Switches
In Figure 5-2, a total of 16 servers are configured in a Hadoop cluster and connected to
the data center access switches for big data processing.
HDFS
HDFS is a highly scalable and distributed file system that can scale to thousands of
cluster nodes, millions of files, and petabytes of data. HDFS is optimized for batch
processing where data locations are exposed to allow computations to take place where
the data resides. HDFS provides a single namespace for the entire cluster to allow for
data coherency in a write-once, read-many access model. In other words, clients can
only append to existing files in the node. In HDFS, files are separated into blocks,
which are typically 64 MB in size and are replicated in multiple data nodes. Clients
access data directly from data nodes. Figure 5-3 shows a high-level overview of the
HDFS architecture.
118 Chapter 5: Big Data Analytics and NetFlow
Replication
Write Write
Client 2
Blocks
In Figure 5-3, the NameNode (or Namespace Node) maps a filename to a set of blocks
and the blocks to the data nodes where the block resides. There are a total of four data
nodes, each with a set of data blocks. The NameNode performs cluster configuration
management and controls the replication engine for blocks throughout the cluster. The
NameNode metadata includes the following:
The NameNode also maintains a transaction log that records file creations, deletions,
and modifications.
Each DataNode includes a block server that stores data in the local file system, stores
metadata of a block, and provisions data and metadata to the clients. DataNodes also
periodically send a report of all existing blocks to the NameNode and forward data
to other specified DataNodes as needed. DataNodes send a heartbeat message to the
NameNode on a periodic basis (every 3 seconds by default), and the NameNode uses
these heartbeats to detect any DataNode failures. Clients can read or write data to each
data block, as shown in Figure 5-3.
Note You can obtain more detailed information and download Hadoop at
http://hadoop.apache.org.
OpenSOC 119
Flume
OpenSOC uses Flume for collecting, aggregating, and moving large amounts of network
telemetry data (like NetFlow, syslog, SNMP, and so on) from many different sources
to a centralized data store. Flume is also licensed under the Apache license. Figure 5-4
shows how different network telemetry sources are sent to Flume agents for processing.
SYSLOG
Flume
SNMP
Agent A
NetFlow
Agent B
Server and
Host Logs
n Event: A specific unit of data that is transferred by Flume, such as a single NetFlow
record.
n Source: The source of the data. These sources are either actively queried for new
data or they can passively wait for data to be delivered to them. The source of this
data can be NetFlow collectors, server logs from Splunk, or similar entities.
n Agent: A Java virtual machine running Flume that comprises a group of sources,
sinks, and channels.
n Client: Creates and transmits the event to the source operating within the agent.
120 Chapter 5: Big Data Analytics and NetFlow
Agent
Note You can obtain more detailed information and download Flume at
http://flume.apache.org.
Kafka
OpenSOC uses Kafka as its messaging system. Kafka is a distributed messaging system
that is partitioned and replicated. Kafka uses the concept of topics. Topics are feeds of
messages in specific categories. For example, Kafka can take raw packet captures and
telemetry information from Flume (after processing NetFlow, syslog, SNMP, or any
other telemetry data), as shown in Figure 5-6.
Passive Kafka
Tap
Packet
Traffic
Replicator Captures PCAP Topic
DPI Topic
Telemetry
Sources Flume
A Topic
Syslog Agent A
File System
In Figure 5-6, a topic is a category or feed name to which log messages and telemetry
information are exchanged (published). Each topic is an ordered, immutable sequence of
messages that is continually appended to a commit log.
OpenSOC 121
Kafka Cluster
Server 1 Server 2
P0 P1 P2 P3
Consumers are organized in consumer groups, and each message published to a topic is
sent to one consumer instance within each subscribing consumer group.
All consumer instances that belong to the same consumer group are processed in a
traditional queue load balancing. Consumers in different groups process messages in a
publish-subscribe mode, where all the messages are broadcast to all consumers.
In Figure 5-7, the Kafka cluster contains two servers (Server 1 and Server 2), each with two
different partitions. Server 1 contains partition 0 (P0) and partition 1 (P1). Server 2 con-
tains partition 2 (P2) and partition 3 (P3). Two consumer groups are illustrated. Consumer
Group 1 contains consumers A, B, and C. Consumer Group 2 contains consumers: D and E.
Kafka provides parallelism to provide ordering guarantees and load balancing over a pool
of consumer processes. However, there cannot be more consumer instances than partitions.
Note You can obtain more detailed information and download Kafka at
http://kafka.apache.org.
Storm
Storm is an open source, distributed, real-time computation system under the Apache
license. It provides real-time processing and can be used with any programming language.
122 Chapter 5: Big Data Analytics and NetFlow
Hadoop consists of two major components: HDFS and MapReduce. The early imple-
mentations of Hadoop and MapReduce were designed on batch analytics, which does
not provide any real-time processing. In SOCs, you often cannot process data in batches,
and so it can take several hours to complete the analysis.
Note Depending on the amount of data, the number of nodes in the cluster, the
technical specifications of each node, and the complexity of the analytics, MapReduce
can take anywhere from minutes to hours to perform a job. In security, you need to
respond fast!
OpenSOC uses Storm because it provides real-time streaming and because of its amazing
ability to process big data, at scale, in real time. Storm can process data at over a million
tuples processed per second per node. Figure 5-8 shows how Kafka topics feed informa-
tion to Storm to provide real-time processing.
File System
Note You can obtain more detailed information and download Storm at
https://storm.incubator.apache.org.
Hive
Hive is a data warehouse infrastructure that provides data summarization and ad hoc
querying. Hive is also a project under the Apache license. OpenSOC uses Hive because
of its querying capabilities. Hive provides a mechanism to query data using a SQL-like
OpenSOC 123
language that is called HiveQL. In the case of batch processing, Hive allows MapR pro-
grammers use their own custom mappers.
Figure 5-9 shows how Storm feeds into Hive to provide data summarization and
querying.
ORC
DPI Topic DPI Topology
Telemetry
Sources Flume
A Topic A Topology
Syslog Agent A
File System
Note You can obtain more detailed information and download Hive at
https://hive.apache.org.
Storm can also feed into HBase and Elasticsearch. These are covered in the following
sections.
Elasticsearch
Elasticsearch is a scalable and real-time search and analytics engine that is also used by
OpenSOC. Elasticsearch has a very strong set of application programming interfaces
(APIs) and query domain-specific languages (DSLs). It provides full query DSL based on
JSON to define such queries. Figure 5-10 shows how Storm feeds into Elasticsearch to
provide real-time indexing and querying.
124 Chapter 5: Big Data Analytics and NetFlow
ORC
DPI Topic DPI Topology
Telemetry
Sources Flume Elasticsearch
A Topic A Topology
Syslog Agent A
Index
HTTP Agent B B Topic B Topology
File System
Note You can obtain more detailed information and download Elasticsearch at
http://www.elasticsearch.org.
HBase
HBase is scalable and distributed database that supports structured data storage for large
tables. You guessed right: HBase is also under the Apache license! OpenSOC uses HBase
because it provides random and real-time read/write access large data sets.
HBase provides linear and modular scalability with consistent database reads and writes.
Figure 5-11 shows how Storm feeds into HBase to provide real-time indexing and
querying.
Note You can obtain more detailed information and download HBase at
https://hbase.apache.org.
OpenSOC 125
ORC
DPI Topic DPI Topology
Telemetry
Sources Flume Elasticsearch
A Topic A Topology
Syslog Agent A
Index
HTTP Agent B B Topic B Topology
n Power Pivot
n Tableau
Figure 5-12 shows the complete OpenSOC architecture, including analytics tools
and web services for additional search, visualizations, and packet capture (PCAP)
reconstruction.
n Ambari: A web-based tool and dashboard for provisioning, managing, and monitor-
ing Apache Hadoop clusters.
You can find detailed information about BDAS and Berkeley’s AMPLabs at
https://amplab.cs.berkeley.edu
Understanding Big Data Scalability: Big Data Analytics in the Internet of Everything 127
n Storage
n Adequate and real-time search
n Adequate visualizations
Big data has become a hot topic due to the overabundance of data sources inundating
today’s data stores as applications proliferate. These challenges will become even bigger
as the world moves to the Internet of Everything (IoE), a term coined by Cisco. IoE is
based on the foundation of the Internet of Things (IoT) by adding network intelligence
that allows convergence, orchestration, and visibility across previously disparate systems.
IoT is the networked connection of physical objects. IoT is one of many technology
transitions that enable the IoE.
The goal is to make networked connections more relevant by turning information into
actions that create new capabilities. The IoE consists of many technology transitions,
including the IoT. The key concepts are as follows:
Big data analytics for cyber security in an IoE world will require substantial engineering
to address the huge data sets. Scalability will be a huge challenge. In addition, the end-
less variety of IoT applications presents a security operational challenge. We are starting
to experience these challenges nowadays. For instance, in a factory floor, embedded
programmable logic controllers (PLCs) that operate manufacturing systems and robots
can be a huge target for bad actors. Do we know all the potential true indicators of com-
promise so that we can perform deep-dive analysis and perform good incident response?
The need to combine threat intelligence and big data analytics will be paramount in this
ever-changing world.
128 Chapter 5: Big Data Analytics and NetFlow
Summary
Today, networks are becoming exponentially bigger and more complex. To maintain vis-
ibility and control of the network, many organizations are leveraging or planning to com-
bine big data analytics with real-time, predictive analysis to detect attacks and protect
against advanced malware across their networks. This combination can help security pro-
fessionals address the ever-changing nature of threats that threaten their most important
asset, which is data. This chapter provided an overview of the technologies and processes
to use big data analytics for cyber security. NetFlow and other telemetry sources play a
big role in big data analytics for cyber security. This chapter explained how you can use
these telemetry sources to look for indicators of compromise in your network.
Cisco has developed and open source OpenSOC to provide a framework for big data
analytics for cyber security. In this chapter, you learned the technologies and architec-
tures used in OpenSOC and how they play a crucial role for security operations. The IoE
introduces a lot of security challenges. One of the biggest challenges introduced is the
ability to scale to large data sets. It is unavoidable that big data will continue to play a
big role in cyber security.
Chapter 6
n Encryption
n Droppers
n Social engineering
n Zero-day attacks
n Visibility driven: Maintaining complete visibility gathering data from all potential
attack vectors across the network fabric, endpoints (including mobile devices), email
and web gateways, virtual machines in the data center, and the cloud.
n Platform based: Security now requires an integrated system of agile and open plat-
forms that cover the network, endpoints, users, and the cloud. These platforms must
be scalable and centrally managed for device configuration consistency.
Security technologies and processes should not focus on detection, but also should pro-
vide the capability to mitigate the impact after a successful attack. Figure 6-1 illustrates
the attack continuum.
Security professionals must maintain visibility and control across the extended network
during the full attack continuum:
Cisco next-generation security products provide protection throughout the attack con-
tinuum. NetFlow is a vital component of the first version of the Cisco CTD Solution,
and continues to play a vital role in its next generation. It provides visibility capabilities
that are crucial for all three parts of the attack continuum. Devices such as the Cisco ASA
with FirePOWER Services available on the Cisco ASA 5500-X series and ASA 5585-X
Adaptive Security Appliances and Cisco’s Advanced Malware Protection (AMP) provide
a security solution that help discover threats and enforce and harden policies before an
attack takes place. In addition, you can detect, block, and defend against attacks that have
already taken place with next-generation intrusion prevention systems (NGIPS), and email
and web security appliances with AMP. These solutions provide the capabilities to con-
tain and remediate an attack to minimize data loss and additional network degradation.
n Wireless LANs
n Internet edge
n Data center
n Firewalls
The Cisco CTD Solution Version 2.0 uses the following next-generation security
components:
n NetFlow and the Lancope StealthWatch System: For broad network visibility, user
and flow context analysis, and incident response and network forensics
n Cisco FirePOWER and FireSIGHT: For real-time threat management and deep
application inspection
132 Chapter 6: Cisco Cyber Threat Defense and NetFlow
n Advanced Malware Protection (AMP): Endpoint control with AMP for endpoints
and network malware control with AMP for networks
n Content Security Appliances and Services such as the Cisco Web Security
Appliance (WSA) and Cloud Web Security (CWS): For dynamic threat control of
web traffic, in addition to the Cisco Email Security Appliance (ESA) for dynamic
threat control for email traffic
n Cisco Identity Services Engine (ISE): For user and device identity integration with
Lancope StealthWatch and remediation policy actions using pxGrid
The Cisco CTD Solution supports Flexible NetFlow and NetFlow Version 9. Flexible
NetFlow should be used in Cisco IOS Software for the latest technology and features
for NetFlow, and should be considered for new deployments because its features allows-
user configurable NetFlow record formats. In addition, Flexible NetFlow has several
advantages, including tailoring a cache for specific applications not covered by NetFlow
predecessor versions. Flexible NetFlow also provides better scalability, because flow
record customization for particular application reduces number of flows to monitor.
Figure 6-2 shows a high-level topology of a few components of the Cisco CTD Solution.
Internet
Internet Edge
NetFlow-Enabled
Cisco ASAs with FirePOWER Services
Core
NetFlow-Enabled FC
Cisco WLC StealthWatch ISE
FlowCollector
SMC
StealthWatch
Management Console
Cisco
FireSIGHT
Management Network
NetFlow can be enabled at many different network infrastructure devices. In Figure 6-2,
access switches, wireless access points managed by the Cisco Wireless LAN Controller
(WLC), and Cisco ASA 5500-X Series Next-Generation Firewalls are configured for
NetFlow. Lancope’s StealthWatch FlowCollector is collecting NetFlow from those
devices. StealthWatch FlowCollector is a physical or virtual appliance that collects
NetFlow data from infrastructure devices. The StealthWatch Management Console is
deployed to provide centralized management for the StealthWatch FlowCollector appli-
ance and provides real-time data correlation, visualization, and consolidated reporting of
combined NetFlow and identity analysis.
Tip The FireSIGHT Management Center and the Cisco ASA FirePOWER module
require additional licenses. These licenses are installed in the FirePOWER module itself.
No additional licenses are required in the Cisco ASA itself.
The Cisco CTD Solution provides identity awareness with a direct correlation between
users and specific network events. The identity data can be obtained from the StealthWatch
IDentity appliance or through integration with the Cisco Identity Services Engine (ISE).
StealthWatch Management Console can also process user information (usernames) within
NetFlow records from Cisco ASA appliances. The integration with Cisco ISE provides a
rich capability to identify the who, what, where, when, and how of threats that could pen-
etrate the network.
Note The minimum requirement to perform identity capabilities is to deploy the Cisco
ISE and one or more authenticating access devices in a valid Cisco TrustSec Monitoring
Mode deployment.
Table 6-3 Flexible NetFlow Support in ISR, ISR-G2, 7200 Series, 7300 Series, and
Cisco ASR 1000 Series Aggregation Services Routers
Cisco 7200
Series Cisco
Feature Cisco ISR Cisco ISR-G2 7300 Series ASR 1000
New Flexible 12.4(9)T 15.0(1)M 12.4(9)T IOS XE 3.1.1S
NetFlow CLI
Multiple User-Defined 12.4(9)T 15.0(1)M 12.4(9)T IOS XE 3.1.1S
Caches
User-Defined Flow 12.4(9)T 15.0(1)M 12.4(9)T IOS XE 3.1.1S
Record
Normal Cache 12.4(9)T 15.0(1)M 12.4(9)T IOS XE 3.1.1S
Immediate Cache 12.4(9)T 15.0(1)M 12.4(9)T IOS XE 3.8.0S
Permanent Cache 12.4(9)T 15.0(1)M 12.4(9)T IOS XE 3.9.0S
Dynamic TopNTalkers 12.4(22)T 15.0(1)M 12.4(22)T Not available
FNF EEM Monitor 12.4(22)T 15.0(1)M 12.4(22)T Not available
Full Flow Support 12.4(9)T 15.0(1)M 12.4(9)T IOS XE 3.1.1S
Random Sampling 1:M 12.4(9)T 15.0(1)M 12.4(9)T IOS XE 3.1.1S
NetFlow v5 Export 12.4(22)T 15.0(1)M 12.4(22)T IOS XE 3.1.1S
Format
NetFlow v9 Export 12.4(9)T 15.0(1)M 12.4(9)T IOS XE 3.1.1S
Format
IPFIX Export Format Not available 15.3(1)T Not available IOS XE 3.7.0S
Export over UDP 12.4(9)T 15.0(1)M 12.4(9)T IOS XE 3.1.1S
Export over IPv6 Not available 15.2(2)T Not available IOS XE 3.7.0S
Export in a VRF 12.4(9)T 15.0(1)M 12.4(9)T IOS XE 3.2.0S
FNF QOS Output 12.4(20)T 15.0(1)M 12.4(20)T IOS XE 3.1.1S
Features
Ingress Support 12.4(9)T 15.0(1)M 12.4(9)T IOS XE 3.1.1S
Egress Support 12.4(9)T 15.0(1)M 12.4(9)T IOS XE 3.1.1S
Per Interface 12.4(9)T 15.0(1)M 12.4(9)T IOS XE 3.1.1S
Per Subinterface 12.4(9)T 15.0(1)M 12.4(9)T IOS XE 3.1.1S
On VRF Interface 12.4(9)T 15.0(1)M 12.4(9)T IOS XE 3.1.1S
IPv6 Unicast Flows 12.4(20)T 15.0(1)M 12.4(20)T IOS XE 3.3.0S
IPv6 Predefined 12.4(20)T 15.0(1)M 12.4(20)T IOS XE 3.3.0S
Aggregations
The Attack Continuum 137
Table 6-4 lists the first Cisco IOS-XE Software release in which Flexible NetFlow sup-
port was introduced, along with the respective feature, in the following platforms:
Table 6-4 Flexible NetFlow Support in the Cisco ISR 4400 Series and the Cisco CSR
1000V Series
Feature ISR-4400 CSR-1000V
New Flexible NetFlow CLI IOS XE 3.8.0S IOS XE 3.9.0S
Multiple User-Defined Caches IOS XE 3.8.0S IOS XE 3.9.0S
User-Defined Flow Record IOS XE 3.8.0S IOS XE 3.9.0S
Normal Cache IOS XE 3.8.0S IOS XE 3.9.0S
Immediate Cache IOS XE 3.8.0S IOS XE 3.9.0S
Permanent Cache IOS XE 3.9.0S IOS XE 3.9.0S
Dynamic TopNTalkers IOS XE 3.12.0S IOS XE 3.12.0S
FNF EEM Monitor IOS XE 3.13.0S IOS XE 3.13.0S
Full Flow Support IOS XE 3.8.0S IOS XE 3.9.0S
Random Sampling 1:M IOS XE 3.8.0S IOS XE 3.9.0S
Activation
Ingress Support IOS XE 3.8.0S IOS XE 3.9.0S
Egress Support IOS XE 3.8.0S IOS XE 3.9.0S
138 Chapter 6: Cisco Cyber Threat Defense and NetFlow
Table 6-5 lists the first Cisco NX-OS Software release in which Flexible NetFlow
support was introduced, along with the respective feature, in the following platforms:
Table 6-5 Flexible NetFlow Support in the Cisco Nexus 7000 Series Switches and the
Cisco Nexus 1000V
Feature Nexus 7000 Nexus 1000V
New Flexible NetFlow CLI 4.0 4.0(4)SV1
Multiple User Defined Caches 4.0 4.0(4)SV1
The Attack Continuum 139
Figure 6-3 shows an example of the many visualizations and reports that can be obtained
in the StealthWatch Management Console.
Figure 6-3 shows the Summary tab of the Domain Dashboard. A host (10.201.3.83) has
been classified as a high concern host in the inside network. This host belongs to the
Sales and Marketing host group in Atlanta. The Concern Index (CI) is a counter that
accumulates as a host performs suspicious activity. The higher the number, the more
suspicious activity the host has performed. The CI% is an indication of how far this host
has deviated from baseline activity for its host group. In Figure 6-3, you can also see that
several hosts in the 192.168.10.0 network have generated additional network alarms.
Deploying the Lancope StealthWatch System 141
Figure 6-4 shows the StealthWatch Management Console DDoS Traffic Dashboard.
The Cisco ISE provides detailed user and device information to Lancope StealthWatch.
Figure 6-5 shows the StealthWatch Management Console Identity and Device Table.
Figure 6-5 The StealthWatch Management Console Identity and Device Table
142 Chapter 6: Cisco Cyber Threat Defense and NetFlow
In Figure 6-5, you can see detailed information of active hosts in the inside network,
along with the username of the actual user, MAC address identification, the router
interface that observed such flow, and the start and end active time, in addition to other
connection details.
The following are the primary components of the Lancope StealthWatch System:
n FlowSensor: A physical or virtual appliance that can generate NetFlow data when
legacy Cisco network infrastructure components are not capable of producing line-
rate, unsampled NetFlow data. Alternatively, the Cisco NGA can be used.
Note For the most up-to-date information about the support in each StealthWatch
FlowCollector and FlowSensor appliance models and their specifications, go to Lancope’s
website at http://lancope.com.
Like all NetFlow generators, the volume of NetFlow traffic generated by the
StealthWatch FlowSensor varies based on the monitored traffic profile.
Tip NetFlow collection should be done as close to the NetFlow generator as possible to
minimize network bandwidth and overhead impact. In an asymmetric routing situation, all
devices in the asymmetric route should send NetFlow records to the same FlowCollector.
StealthWatch
Management Console SMC
ISE
StealthWatch
FlowCollector FC
Management Network
FC
Switch 1 Switch 2 Router ASA
NetFlow-Enabled Devices
Figure 6-7 shows an example topology where three StealthWatch FlowCollectors are
deployed behind a load balancer. For example, you can deploy the Citrix NetScaler
1000V on demand, anywhere in the data center, using the Cisco Nexus 1100 Series Cloud
Services Platform (CSP) or running as a virtual appliance on VMWare ESXi or KVM. When
running on KVM, you can integrate it with OpenStack using the Cisco Prime Network
Services Controller. This load-balancing solution will help you scale your StealthWatch
FlowCollectors (or any other collectors) more efficiently in your environment.
144 Chapter 6: Cisco Cyber Threat Defense and NetFlow
StealthWatch
Management Console SMC
ISE
StealthWatch
FlowCollectors FC FC FC
Management Network
Load Balancer
NetFlow-Enabled Devices
Figure 6-8 shows an example topology where three StealthWatch FlowCollectors are
deployed in a distributed way, with one StealthWatch FlowCollector at each site (New
York, Raleigh, and Chicago). This deployment has the advantage of limiting the over-
head introduced by NetFlow.
If you have multiple geographically located sites, pay attention to bandwidth limitations
between sites. As a best practice, a single FlowCollector should be used for as much
related traffic as possible. However, the benefits of centralized collection diminish when
the traffic is not similar.
Another best practice is that all NetFlow records belonging to a flow should be sent
to the same StealthWatch FlowCollector. Duplicate NetFlow records can be a prob-
lem when trying to respond to an incident or analyze traffic patterns. StealthWatch
FlowCollectors have a deduplication feature where it guarantees that the flow data is
stored properly, while preserving the details about each flow exporter and eliminating
the reporting of inflated traffic volumes.
Deploying the Lancope StealthWatch System 145
Management Network
StealthWatch ISE
Management Console SMC
StealthWatch StealthWatch
FlowCollector 1 FlowCollector 3
FC FC FC
StealthWatch
FlowCollector 2
ASA
Switch 1 Switch 2 Switch 3 Switch 4
n The number of hosts (both inside and outside the network) for which the collector
can maintain state. As a best practice, the number of inside hosts should not exceed
60 percent of the host count value.
StealthWatch FlowCollectors come in two different form factors: appliances and virtual
edition (VE). Table 6-6 lists the different StealthWatch FlowCollector appliances and
high-level specifications.
Note As mentioned earlier in the chapter, for the most up-to-date information about the
support in each StealthWatch FlowCollector appliance models and their specifications, go
to Lancope’s website at http://lancope.com.
StealthWatch FlowReplicators
The StealthWatch FlowReplicator is an optional component of the Cisco CTD Solution.
The StealthWatch FlowCollector exists as a physical or virtual appliance. The StealthWatch
FlowReplicator supports Cisco NetFlow, IPFIX, and other vendors’ flow data. It combines
multiple capabilities into a single device to streamline the collection and distribution of
network and security data across the corporate network.
Figure 6-9 shows an example topology where the StealthWatch FlowReplicator (FR)
is deployed collecting NetFlow, IPFIX, and syslog data from multiple devices in the
network.
In Figure 6-9, the StealthWatch FR sends all NetFlow data to the StealthWatch
FlowCollector 1 and all IPFIX data to the StealthWatch FlowCollector 2.
The StealthWatch FR can receive data from any connectionless UDP application and syslog
messages and then replicate those to network analysis systems. In addition, StealthWatch
FR can process Simple Network Management Protocol (SNMP) traps from network infra-
structure devices and distribute them to several different SNMP management stations.
factors (just like the StealthWatch FlowCollectors): appliances and virtual edition (VE).
Table 6-8 lists the different StealthWatch Management Console appliances and high-level
specifications.
StealthWatch
Management Console SMC
StealthWatch StealthWatch
FlowCollector 1 FC FC FlowCollector 2
(NetFlow) (IPFIX)
(N
X)
et
FI
Fl
(IP
ow
(SYSLOG)
)
FR
Legacy Network
Analysis Systems
SYSLOG
The Cisco ASA NetFlow implementation is also known as NetFlow Secure Event
Logging (NSEL). The Cisco ASA supports NetFlow Version 9. NSEL provides a stateful
IP flow tracking method that exports only those records that indicate significant events
in a flow.
The following are the significant flow events that are tracked:
n Flow create
n Flow teardown
n Flow denied
n Flow update (provide periodic byte counters over the duration of the flow)
Note The flow-denied events do not support flows that are denied by EtherType access
control lists (ACLs). The flow-update events were introduced in Cisco ASA Software
Versions 8.4(5) and 9.1(2).
The Cisco ASA NSEL events are typically time driven (similar to traditional NetFlow).
However, these events may also be triggered by state changes in the flow.
All NSEL records generated by the Cisco ASA have an Event ID and an Extended Event
ID field, which are used to describe the flow event.
150 Chapter 6: Cisco Cyber Threat Defense and NetFlow
Tracks flow-create, flow-teardown, and flow-denied events, and generates NSEL data records.
Tracks configured NSEL collectors and delivers templates and data records such as collectors.
Filters NSEL events based on the traffic and event type through Modular Policy
Framework (MPF), subsequently sends records to configured collectors.
NSEL templates describe the format of the data records that are exported by the Cisco
ASA. Each NSEL event can have several record formats or templates associated with it.
You can filter NSEL events using the Cisco ASA MPF; the traffic to be filtered or col-
lected is matched based on the order in which classes are configured. It is important to
remember that after a match is found, no other classes are checked.
ASA
NetFlow NetFlow
Collector 1 Collector 2
(10.1.1.11) (10.1.1.12)
In Figure 6-11, a Cisco ASA is configured to send NSEL records to two different
NetFlow collectors. In this configuration, the Cisco ASA sends all flow-create and flow-
update events to Collector 1 and all flow-teardown events to Collector 2.
Internet
ASA Cluster
Any cluster member can fail at any given time without impacting transit traffic or dis-
rupting other cluster units. Each unit always maintains a backup of each stateful con-
nection entry on a different physical ASA. A cluster remains operational when two or
more members fail at the same time, but some connections may have to reestablish. You
configure and monitor the entire cluster from a single member (including NSEL). The
configuration automatically replicates to all other units.
152 Chapter 6: Cisco Cyber Threat Defense and NetFlow
n Master and slave units: Cisco ASA cluster elects one member as the master; all
other members become slaves. Similarly to failover, you typically configure cluster-
ing on one Cisco ASA and add other units later. That first unit becomes the master
and remains in this role until it reloads or fails; you can also manually transition
another unit into the master role with the cluster master unit command.
n Flow owner: A single cluster member must process all packets that belong to a
single connection. This ensures symmetry for proper state tracking. For each con-
nection, one unit in the cluster becomes the flow owner. Each cluster member may
own some flows. Typically, the unit that receives the first packet for a connection
becomes its owner. If the original owner fails while a connection is still active,
another unit assumes the ownership of that flow. Typically, any unit receiving a
packet for an existing connection with no owner becomes its flow owner. A flow
owner always maintains the full stateful connection entry.
n Flow director: The concept of a flow director is central to the high-availability
aspect of clustering. For each connection, the flow director always maintains the
backup stateful information record. A flow owner periodically updates the flow
director on the connection state. Other cluster members determine the identity of
the flow owner by contacting the flow director. This mechanism of persistent back-
up flow ownership allows another unit to recover the connection state and assume
its ownership if the original flow owner fails.
Each cluster member knows which unit is the flow director for every possible transit
connection.
The flow director maintains a stub connection entry with a limited set of stateful infor-
mation. This approach enables a cluster to scale much higher in terms of the maximum
connection count. If the flow owner happens to be the flow director for the same con-
nection, another unit creates a backup stub connection entry to maintain high availability.
n Flow forwarder: Because a cluster relies on external stateless load balancing, it is
possible for different directions of the same connection to land on different units.
And because the flow owner must process all packets that belong to a single connec-
tion, other units must forward such asymmetrically received packets to the correct
owner. A cluster member who receives a non-TCP-SYN packet for an unknown con-
nection queries the respective flow director to determine whether the owner exists.
n System uptime
n UNIX time that is synchronized across the cluster
Deploying NetFlow Secure Event Logging in the Cisco ASA 153
These fields are all local to an individual ASA. NetFlow collectors use the combination
of the source IP address and source port of the packet to separate different exporters.
Note The Cisco ASA supports in-cluster upgrades. Cisco ASAs that are participants in
a cluster may run different software versions at a certain point in time. Subsequently, the
template that each Cisco ASA supports may be different.
Internet
Outside
RTP-ASA
Inside
10.1.1.1
Netflow Netflow
Collector 1 Collector 2
(192.168.1.205) (192.168.1.206)
Figure 6-13 shows the topology of an office in the Research Triangle Park (RTP) in
North Carolina. A Cisco ASA is configured with two NetFlow collectors.
Step 1. Log in to ASDM and navigate to Configuration > Device Management >
Logging > NetFlow, as illustrated in Figure 6-14.
Step 2. Enter the template timeout rate (in minutes). This is the time at which tem-
plate records are sent to all configured collectors. In this example, the default
value is configured (30 minutes).
154 Chapter 6: Cisco Cyber Threat Defense and NetFlow
Step 3. Enter the flow update interval, which is the time interval between flow-update
events. You can configure the flow update interval from 1 to 60 minutes. In
this example, the default value is configured (1 minute).
Step 4. You can configure the Cisco ASA to delay the export of flow-creation
events and process a single flow-teardown event instead of a flow-creation
event and a flow-teardown event. To do so, check the Delay Export of
Flow Creation Events for Short-Lived Flows checkbox. In this example,
the number of seconds for the delay in the Delay By field is configured to
5 seconds.
Step 5. You can configure a maximum of five NetFlow collectors. In this example, a
NetFlow collector with the IP address 192.168.1.205 is already configured in
the inside interface and using UDP port 9901. Let’s add a second collector.
To configure a collector, click Add. The Add NetFlow Collector dialog box
will open, as shown in Figure 6-15.
Step 6. From the drop-down menu, choose the interface to which NetFlow packets
will be sent. The inside interface is selected in this example.
Step 7. Enter the IP address or hostname and the UDP port number in the respec-
tive fields. The IP address of the new collector is 192.168.1.206 and the UDP
port is 9901.
Deploying NetFlow Secure Event Logging in the Cisco ASA 155
Step 9. Click Apply to apply the changes to the Cisco ASA configuration.
! Log in to the ASA and use the enable command to enter in privilege mode
rtp-asa> enable
Password: ****************
!
! Use the configure terminal command to enter in configuration mode
rtp-asa# configure terminal
!
! Adding a collector (192.168.1.205) and specifying UDP port 9901 for NSEL communi-
cation.
rtp-asa(config)# flow-export destination inside 192.168.1.205 9901
156 Chapter 6: Cisco Cyber Threat Defense and NetFlow
!
! Configuring the flow-export delay to 5 seconds.
rtp-asa(config)# flow-export delay flow-create 5
!
! Finishing the configuration and using the write memory command to save the
! configuration in the Cisco ASA.
rtp-asa(config)# end
rtp-asa# write memory
Click OK to close this dialog box and Apply to apply the changes to the Cisco ASA
configuration.
Example 6-2 demonstrates how to disable the redundant syslog messages using the CLI.
Deploying NetFlow Secure Event Logging in the Cisco ASA 157
Step 1. Navigate to Configuration > Firewall > Service Policy Rules, select the
inspection_default policy, and then choose Add > Insert After. ASDM
launches an Add Service Policy Rule Wizard.
Step 2. Click the Global – Applies to All Interfaces radio button, as shown in
Figure 6-17.
Step 4. Under Create a New Traffic Class, specify a traffic class name of NetFlow.
Check the Any Traffic check box as the traffic match criteria, as shown in
Figure 6-18.
Step 6. Under Rule Actions, navigate to the NetFlow tab and click Add. A new
window opens where you can specify the flow event type, as shown in
Figure 6-19.
Step 7. Select All and check the Send check box next to the collector’s IP address.
The collector that was previously configured is displayed.
Step 8. Click OK and then click Finish to complete defining a NetFlow export policy.
158 Chapter 6: Cisco Cyber Threat Defense and NetFlow
Example 6-3 demonstrates how to define the NSEL export policy using the CLI.
Monitoring NSEL
You can use syslog messages to troubleshoot errors or monitor system usage and perfor-
mance. You can use the show flow-export counters command to display flow export
counters, including statistical data and error data, as demonstrated in Example 6-4.
Errors:
block allocation failure 0
invalid interface 0
template send failure 0
no route to collector 0
failed to get lock on block 0
source port allocation failure 0
You can list all syslog messages that are captured by NSEL events with the show logging
flow-export-syslogs command. You can use the show running-config logging command
to display disabled syslog messages.
You can define new flow records or use the pre-defined Cisco Nexus 1000V flow
record. You can use the show flow record netflow-original command to display the pre-
defined flow records, as shown in Example 6-5.
Figure 6-21 lists the high-level steps to configure NetFlow in the Cisco Nexus 1000V.
2 4
1 3
Define a Apply a Flow
Define a Define a
Flow Monitor to
Flow Record Flow Monitor
Exporter an Interface
n Bytes
n Packets
162 Chapter 6: Cisco Cyber Threat Defense and NetFlow
Bytes and packets are collected in 32-bit counters unless the long 64-bit counter is
specified. You can also use the collect timestamp sys-uptime subcommand to collect
the system up time for the first or last packet in the flow. In addition, you can use the
collect transport tcp flags subcommand to collect the TCP transport layer flags for the
packets in the flow.
To show the flow record, you can use the show flow record name command, as demon-
strated in Example 6-7.
In Example 6-8, the flow exporter Exporter1 command defines the flow exporter. The
name of the flow exporter is Exporter1 in this example. The destination subcommand
specifies the IP address of the destination interface for the flow exporter. The destina-
tion in the example is 192.168.1.10.
In Example 6-8, the source interface from which the flow records are sent to the
NetFlow collector is management 0 (mgmt 0). The destination UDP port is set to 9901.
The NetFlow version is set to Version 9. The option exporter-stats timeout 1100
subcommand specifies the exporter statistics to 1100 seconds. The template data
timeout 1100 subcommand is entered to set the template data resend timer to
1100 seconds.
Configuring NetFlow in the Cisco Nexus 1000V 163
You can use the show flow exporter name command to display the flow exporter statis-
tics, as demonstrated in Example 6-9.
In Example 6-10, a flow monitor called MyMonitor is configured. The previously con-
figured flow exporter and flow record are applied to the flow monitor. The cache size is
configured to 10,000 entries. The cache is an optional command, but it is useful to limit
the impact of the monitor cache on memory and performance.
You can use the show flow monitor name command to display the flow monitor statis-
tics, as shown in Example 6-11.
164 Chapter 6: Cisco Cyber Threat Defense and NetFlow
The output keyword specifies that the flow monitor will be applied outbound (for out-
put packets).
You can use the show flow interface command to display the flow monitor configura-
tion under a given interface, as demonstrated in Example 6-13.
You can use the show flow monitor MyMonitor cache command to display the flow
monitor NetFlow cache.
NetFlow CLI commands are not available until you enable the NetFlow feature with the
feature netflow command.
Example 6-14 demonstrates how to define a flow record in the Cisco Nexus 7000.
Example 6-15 demonstrates how to define a flow exporter in the Cisco Nexus 7000.
Example 6-16 demonstrates how to define a flow monitor with a custom record in the
Cisco Nexus 7000.
Example 6-16 Defining a Flow Monitor with a Custom Record in the Cisco Nexus 7000
Example 6-17 demonstrates how to define a flow monitor with an original record in the
Cisco Nexus 7000.
Example 6-17 Defining a Flow Monitor with an Original Record in the Cisco Nexus 7000
Example 6-18 demonstrates how to adjust the NetFlow timers in the Cisco Nexus 7000.
Example 6-18 Adjusting the NetFlow Timers in the Cisco Nexus 7000
Example 6-19 demonstrates configure sampled NetFlow in the Cisco Nexus 7000.
Example 6-20 demonstrates how to apply a NetFlow monitor and sampler to an inter-
face in the Cisco Nexus 7000.
The Cisco NGA supports NetFlow Versions 5 and 9. It also supports IPFIX. The Cisco
NGA has four 10G monitoring interfaces and up to four independent flow caches and
flow monitors. Subsequently, the Cisco NGA can receive up to 40 gigabits of data and
support various combinations of data ports, record templates, and export parameters. This
is important to consider when deploying the Cisco NGA in the data center. As a best prac-
tice, the Cisco NGA monitoring interfaces should be sourced from network chokepoints
to guarantee complete network traffic visibility in the data center.
Step 2. The system prompts you to change the password. The default username is
root, with a default password of root. It is highly recommended that you
Configuring the Cisco NetFlow Generation Appliance 167
Rest of
Corporate
Network
CORE
Cisco NGAs
Virtual DC
Services in
Software
VM VM VM VM VM VM
Step 3. Configure the management port IP address and subnet mask information
using the following CLI command:
ip address 192.168.1.23 255.255.255.0
Step 4. To configure the Cisco NGA’s default gateway address, use the ip gateway
ip_address command, as demonstrated here, where the default gateway is
192.168.1.1:
ip gateway 192.168.1.1
168 Chapter 6: Cisco Cyber Threat Defense and NetFlow
Step 5. (Optional) Enter the following information for your DNS server IP address
using the ip nameserver ip_address command.
Step 6. You can use the show ip command to verify the configuration.
Step 7. The next step is to enable the web interface. The Cisco NGA has the ability
to autopopulate NetFlow components. Use the ip http server enable com-
mand to enable the web interface for standard web access or the ip http
secure server enable for secure web access (recommended).
Step 8. Press Enter to use the default web administrator username (admin).
Step 9. Enter a password for the web administrator. The Cisco NGA supports only
one web user account.
Step 10. You can direct packets to any of the four data ports on the NGA using either
or both of the following methods:
n Using network taps, which are hardware devices that provide a copy of
the packet that flows across a network link
Step 11. The Cisco NGA can export flow records containing the input and output
interface of the device (switch) rather than NGA data port interface index if
your traffic source is a Cisco Nexus 5000 or Cisco Nexus 7000 series switch.
You must configure the IP address and login credentials of your traffic
source as a managed device. As a best practice, configure the IP address of
your traffic source in the Cisco NGA as a managed device.
n Up to ten NetFlow filters to define which flows are to be sent to certain collectors.
This allows you to use your collector’s analysis applications and load balance
NetFlow data across collectors.
n Up to six collectors.
To configure NetFlow in the Cisco NGA through the web interface, follow these steps:
Step 1. You can perform the Quick Setup NetFlow configuration (which is the easi-
est configuration to export NetFlow Version 5 or 9 packets to a collector) by
navigating to Setup > Quick Setup.
Configuring the Cisco NetFlow Generation Appliance 169
Step 4. Define the NetFlow collector IP address in the Collector Address (IPv4)
field.
Step 5. Enter the UDP port for communication. The default port is 2055.
Example 6-21 Creating an IPv4 Flow Record Using the Key and Non-Key Fields
The name of the flow exporter in Example 6-23 is myExporter. NetFlow Version 9 is
used in this example. The Cisco NGA is configured to send NetFlow data templates,
option templates, and option data collectors every minute (1). The exporting policy
is set to multi-destination so that the exporter will send the same NetFlow packet to
all collectors set in the exporter. You can also configure the exporting policy with the
weighted-round-robin option. The previously defined collector (myCollector) is used in
this exporter.
Example 6-24 demonstrates how to define the flow monitor. The flow monitor repre-
sents the device’s NetFlow database and links together the flow record and the flow
exporter with any or all of the four data ports on the NGA.
In Example 6-24, the Cisco NGA’s flow monitor is configured to track the innermost IP
addresses, by using the tunnel inner command. The tunnel inner command is used to
dictate how the flow monitor will handle network packets that are tunneled and have
Additional Cisco CTD Solution Components 171
more than one set of IP addresses. You can also configure the Cisco NGA’s flow
monitor to track the outermost IP addresses. The total cache memory space to allocate
for this monitor instance is set to 100. The cache type is set to standard cache mode.
This allows inactive flows to be removed from the cache and memory to be made avail-
able for a new flow to use. Alternatively, you can configure permanent cache mode,
where flows are never deleted from the cache. The active timeout is set to 60 seconds
(recommended) and the inactive timeout is set to 15 seconds.
Tip You can use the show cache statistics rates monitor_name command to display the
rate of raw traffic being processed and the number of flows being created and forwarded
to the exporter engine. Also, you can use the show collector statistics collector_name
command to display the information about NetFlow packets being sent to the collector.
The Cisco ASA also provides a basic botnet traffic filtering feature. A botnet is a collec-
tion of computers that have been compromised and are willing to follow the instructions
172 Chapter 6: Cisco Cyber Threat Defense and NetFlow
of someone who is attempting to centrally control them (for example, 200,000 machines
all willing [or so commanded] to send a flood of ping requests to the IP address dictated
by the person controlling these devices). Often, users of these computers have no
idea that their computers are participating in this coordinated attack. The ASA works
with an external system at Cisco that provides information about the Botnet Traffic
Filter Database and so can protect against this.
Cisco introduced the Cisco ASA FirePOWER module as part of the integration of the
SourceFire technology.
Note SourceFire was a company that Cisco acquired to expand its security portfolio. The
Cisco ASA FirePOWER module provides NGIPS, application visibility and control (AVC),
URL filtering, and AMP. This module runs as a separate application from the classic Cisco
ASA software. The Cisco ASA FirePOWER module can be a hardware module on the ASA
5585-X only or a software module that runs in a solid-state drive (SSD) in all other models.
The Cisco ASA FirePOWER module can be managed by the FireSIGHT Management
Center. The FireSIGHT Management Center and the Cisco ASA FirePOWER module
require additional licenses. These licenses are installed in the FirePOWER module itself.
No additional licenses are required in the Cisco ASA itself.
Note The Cisco ASA 5500-X Series Next-Generation Firewalls LiveLessons (Workshop):
Deploying and Troubleshooting Techniques (ISBN-13: 978-1-58720-570-5) covers step-
by-step instructions on how to deploy, configure, and troubleshoot the firewall features
of the Cisco ASA 5500-X Series Next-Generation Firewalls, including an introduction of
Cisco ASA with FirePOWER Services.
n Cisco FirePOWER 7000 Series Appliances: These are the base platform for the
Cisco FirePOWER Next-Generation IPS software. They support throughput speeds
from 50 Mbps up through 1.25 Gbps.
Additional Cisco CTD Solution Components 173
n FireSIGHT 3500: Supports a maximum of 150 managed devices and a total of 150
million IPS events.
n FireSIGHT 4000: Supports a maximum of 300 managed devices and a total of 300
million IPS events.
n Computer viruses: Malicious software that infects a host file or system area to per-
form undesirable outcomes such as erasing data, stealing information, or corrupting
the integrity of the system. In numerous cases, these viruses multiply again to form
new generations of themselves.
n Worms: Viruses that replicate themselves over the network, thus infecting numer-
ous vulnerable systems. On most occasions, a worm executes malicious instructions
on a remote system without user interaction.
n Mailers and mass-mailer worms: A type of worm that sends itself in an email mes-
sage. Examples of mass-mailer worms are Loveletter.A@mm and W32/SKA.A@m
(a.k.a. the Happy99 worm), which sends a copy of itself every time the user sends a
new message.
174 Chapter 6: Cisco Cyber Threat Defense and NetFlow
n Trojan horses: Trojan horses are a type of malware that executes instructions deter-
mined by the nature of the Trojan to delete files, steal data, and compromise the
integrity of the underlying operating system. Trojan horses typically use a form of
social engineering to fool victims into installing such software on their computers or
mobile devices. Trojans can also act as back doors.
n Back doors: A piece of malware or configuration change that allows attackers to con-
trol the victim’s system remotely. For example, a back door can open a network port
on the affected system so that the attacker can connect and control such system.
n Downloaders: A piece of malware that downloads and installs other malicious con-
tent from the Internet to perform additional exploitation on an affected system.
n Spammers: Spam is referred to as the act of sending unsolicited messages via email,
instant messaging, newsgroups, or any other kind of computer or mobile device
communications. Spammers are the type of malware whose sole purpose is to send
these unsolicited messages with the primary goal of fooling users into clicking on
malicious links, replying to emails or such messages with sensitive information, or
performing different types of scams. The attacker’s main objective is to make money.
n Key loggers: A piece of malware that captures the user’s keystrokes on a compro-
mised computer or mobile device. It collects sensitive information such as pass-
words, PINs, personal identifiable information (PII), credit card numbers, and more.
n Rootkits: A set of tools that are used by attackers to elevate their privilege to obtain
root-level access to be able to completely take control of the affected system.
Numerous types of commercial and free antivirus software are available, including the
following:
n avast!
n F-Secure Antivirus
n Kaspersky Anti-Virus
n McAfee Antivirus
n Panda Antivirus
n Sophos Antivirus
n Norton AntiVirus
n ClamAV
n Immunet
Note ClamAV is an open source antivirus engine sponsored and maintained by Cisco
and non-Cisco engineers. You can download ClamAV from http://www.clamav.net.
Immunet is a free community-based antivirus software maintained by Cisco Sourcefire.
You can download Immunet from http://www.immunet.com.
There are numerous other antivirus software companies and products. You can find a
comprehensive list and comparison of the different antivirus software available on the
market at http://en.wikipedia.org/wiki/Comparison_of_antivirus_software.
Personal firewalls and host intrusion prevention systems (HIPS) are software applications
that you can install on end-user machines or servers to protect them from external secu-
rity threats and intrusions. The term personal firewall typically applies to basic software
that can control Layer 3 and Layer 4 access to client machines. HIPS provide several
features that offer more robust security than a traditional personal firewall, such as host
intrusion prevention and protection against spyware, viruses, worms, Trojans, and other
types of malware.
Today, more sophisticated software is available on the market that makes basic per-
sonal firewalls and HIPS obsolete. For example, Cisco Advanced Malware Protection
(AMP) for Endpoints provides more granular visibility and control to stop advanced
threats missed by other security layers. Cisco AMP for Endpoints takes advantage
of telemetry from big data, continuous analysis, and advanced analytics provided by
Cisco’s threat intelligence to be able to detect, analyze, and stop advanced malware
across endpoints.
Cisco AMP for Endpoints provides advanced malware protection for many operating
systems, such as the following:
n Windows
n Mac OS X
n Android
176 Chapter 6: Cisco Cyber Threat Defense and NetFlow
Attacks are getting very sophisticated; they can often evade detection of traditional
systems and endpoint protection. Nowadays, attackers have the resources, knowledge,
and persistence to beat point-in-time detection. Cisco AMP for Endpoints provides
mitigation capabilities that go beyond point-in-time detection. It uses threat intelligence
from Cisco to perform retrospective analysis and protection. Cisco AMP for Endpoints
also provides device and file trajectory capabilities to allow the security administrator to
analyze the full spectrum of the attack. Device trajectory and file trajectory support the
following file types in Windows and Mac OS X operating systems:
n MSEXE
n PDF
n MSCAB
n MSOLE2
n ZIP
n ELF
n MACHO
n MACHO_UNIBIN
n SWF
n JAVA
Note The Mac OS X connector does not support SWF files. The Windows connector
does not scan Elf, Java, xar(pkg), MACHO, or MACHO_UNIBIN files at the time of this
writing. The Android AMP connector scans APK files.
Cisco integrated Cisco AMP and ThreatGRID to provide a solution for advanced
malware analysis with deep threat analytics. The Cisco AMP ThreatGRID integrated
Additional Cisco CTD Solution Components 177
solution analyzes millions of files and correlates them against hundreds of millions of
malware samples. This provides a lot of visibility of attack campaigns and how malware
is distributed. This solution provides security administrators with detailed reports of
indicators of compromise and threat scores that help them prioritize mitigations and
recovery from attacks.
Email Security
Users are no longer accessing email from the corporate network or from a single device.
Cisco provides cloud-based, hybrid, and on-premises ESA-based solutions that can help
protect any dynamic environment. This section introduces these solutions and technolo-
gies, explaining how users can use threat intelligence to detect, analyze, and protect
against both known and emerging threats.
There are several types of email-based threats. The following are the most common:
n Phishing: An attacker’s attempt to fool a user that such email communication comes
from a legitimate entity or site, such as banks, social media websites, online payment
processors, or even corporate IT communications. The goal of the phishing email is to
steal user’s sensitive information, such as user credentials, bank accounts, and so on.
n Spear phishing: Phishing attempts that are more targeted. These phishing emails are
directed to specific individual or organizations. For instance, an attacker may perform
a passive reconnaissance on the individual or organization by gathering information
from social media sites (for example, Twitter, LinkedIn, Facebook) and other online
resources. Then the attacker may tailor a more directed and relevant message to the
victim, increasing the probability of such user being fooled to follow a malicious link,
click an attachment containing malware, or simply reply to the email and provide
sensitive information. Another phishing-based attack is called whaling. These attacks
specifically target executives and high-profile users within a given organization.
n Cisco X1070: High-performance ESA for service providers and large enterprises
n Cisco C680: The high-performance ESA for service providers and large
enterprises
178 Chapter 6: Cisco Cyber Threat Defense and NetFlow
The Cisco ESA runs Cisco AsyncOS operating system. The Cisco AsyncOS supports
numerous features that will help mitigate email-based threats.
The following are examples of the features supported by the Cisco ESA:
n Access control: Controlling access for inbound senders according to the sender’s IP
address, IP address range, or domain name.
n Antispam: Multilayer filters based on Cisco SenderBase reputation and Cisco anti
spam integration. The antispam reputation and zero-day threat intelligence is fueled
by Cisco’s security intelligence and research group named Talos.
n Data loss prevention (DLP): The ability to detect any sensitive emails and docu-
ments leaving the corporation. The Cisco ESA integrates RSA email DLP for out-
bound traffic.
n Outbreak filters: Preventive protection against new security outbreaks and email-
based scams using Cisco’s Security Intelligence Operations (SIO) threat intelligence
information.
Note Cisco SenderBase is the world largest email and web traffic monitoring network.
It provides real-time threat intelligence powered by Cisco SIO. The Cisco SenderBase
website is located at http://www.senderbase.org.
The Cisco ESA acts as the email gateway the organization, handling all email connec-
tions, accepting messages, and relaying them to the appropriate systems. The Cisco ESA
can service email connections from the Internet to users inside your network, and from
Additional Cisco CTD Solution Components 179
systems inside your network to the Internet. Email connections use Simple Mail Transfer
Protocol (SMTP). The ESA services all SMTP connections by default, acting as the SMTP
gateway.
The Cisco ESA uses listeners to handle incoming SMTP connection requests. A listener
defines an email processing service that is configured on an interface in the Cisco ESA.
Listeners apply to email entering the appliance from either the Internet or from internal
systems.
n Private listeners for email coming from hosts in the corporate (inside) network.
These emails are typically from an internal groupware, Exchange, POP, or IMAP
email servers.
Cisco ESA listeners are often referred to as SMTP daemons running on a specific
Cisco ESA interface. When a listener is configured, the following information must be
provided:
n Listener properties such as a specific interface in the Cisco ESA and the TCP port
that will be used. The listener properties must also indicate whether it is a public or
a private listener.
n The hosts that are allowed to connect to the listener using a combination of access
control rules. An administrator can specify which remote hosts can connect to the
listener.
Web Security
For any organization to be able to protect their environment against web-based security
threats, the security administrators need to deploy tools and mitigation technologies
that go far beyond traditional blocking of known bad websites. Nowadays, you can
download malware through compromised legitimate websites, including social media
sites, advertisements in news and corporate sites, gaming sites, and many more. Cisco has
developed several tools and mechanisms to help their customers combat these threats.
The core solutions for mitigating web-based threats are the Cisco Cloud Web Security
(CWS) offering and the integration of Advanced Malware Protection (AMP) to the Cisco
Web Security Appliance (WSA). Both solutions enable malware detection and blocking,
continuous monitoring, and retrospective alerting.
The Cisco WSA can be deployed in explicit proxy mode or as a transparent proxy using
the Web Cache Communication Protocol (WCCP). WCCP is a protocol originally devel-
oped by Cisco, but several other vendors have integrated it in their products to allow
clustering and transparent proxy deployments on networks using Cisco infrastructure
devices (routers, switches, firewalls, and so on).
Www
3 2 1
Internet Web Cisco ASA Cisco WSA Inside Host
Server
Step 1. An internal user makes an HTTP request to an external website. The client
browser is configured to send the request to the Cisco WSA.
Step 2. The Cisco WSA connects to the website on behalf of the internal user.
Step 3. The firewall (Cisco ASA) is configured to only allow outbound web traffic
from the Cisco WSA, and it forwards the traffic to the web server.
3
2 WCCP
4 1
Internet Web Cisco ASA R1 Inside Host
Server
Step 2. The internal router (R1) redirects the web request to the Cisco WSA using
WCCP.
Step 3. The Cisco WSA connects to the website on behalf of the internal user.
Step 4. Also in this example, the firewall (Cisco ASA) is configured to only allow
outbound web traffic from the WSA. The web traffic is sent to the Internet
web server.
Figure 6-25 demonstrates how the WCCS registration works. The Cisco WSA is the
WCCP client, and the Cisco router is the WCCP server.
“Here I am”
Www
“I see you”
Cisco Router Cisco WSA
(WCCP Server) (WCCP Client)
During the WCCP registration process, the WCCP client sends a registration announcement
(“Here I am”) every 10 seconds. The WCCP server (the Cisco router in this example) accepts
the registration request and acknowledges it with an “I See You” WCCP message. The
WCCP server waits 30 seconds before it declares the client as “inactive” (engine failed).
WCCP can be used in large-scale environments. Figure 6-26 shows a cluster of Cisco WSAs,
where internal Layer 3 switches redirect web traffic to the cluster.
Internet
The Cisco WSA comes in different models. The following are the different Cisco WSA
models:
n Cisco WSA S680: A high-performance WSA designed for large organizations with
6,000 to 12,000 users. A two rack-unit (RU) appliance with 16 (two octa core) CPUs,
32 GB of memory, and 4.8 TB of disk space.
n Cisco WSA S670: A high-performance WSA designed for large organizations with
6,000 to 12,000 users. A two RU appliance with 8 (two octa core) CPUs, 8 GB of
memory, and 2.7 TB of disk space.
Additional Cisco CTD Solution Components 183
n Cisco WSA S380: Designed for medium-sized organizations with 1,500 to 6,000
users. A two RU appliance with six (one hexa core) CPUs, 16 GB of memory, and
2.4 TB of disk space.
n Cisco WSA S370: Designed for medium-sized organizations with 1,500 to 6,000
users. A two RU appliance with four (one quad core) CPUs, 4 GB or memory, and
1.8 TB of disk space.
The Cisco WSA runs Cisco AsyncOS operating system. The Cisco AsyncOS supports
numerous features that will help mitigate web-based threats. The following are examples
of these features:
n Layer 4 traffic monitor: Used to detect and block spyware. It dynamically adds IP
addresses of known malware domains to database of sites to block.
n File reputation: Using threat information from Cisco Talos. This file reputation
threat intelligence is updated every 3 to 5 minutes.
n File sandboxing: If malware is detected, the Cisco AMP capabilities can put files in
a sandbox to inspect its behavior, combining the inspection with machine-learning
analysis to determine the threat level. Cisco Cognitive Threat Analytics (CTA) uses
machine-learning algorithms to adapt over time.
n Application visibility and control: Allows the Cisco ASA to inspect and even block
applications that are not allowed by the corporate security polity. For example,
an administrator can allow users to use social media sites like Facebook but block
micro-applications such as Facebook games.
184 Chapter 6: Cisco Cyber Threat Defense and NetFlow
Www
Cisco SMA
New York
Www
London
Www
Raleigh, NC
Www
Paris
The Cisco SMA comes in different models. These models are physical appliances or the
Cisco Content Security Management Virtual Appliance (SMAV). The following are the
different Cisco SMA models:
n Cisco SMA M680: Designed for large organizations with over 10,000 users
n Cisco SMA M380: Designed for organizations with 1,000 to 10,000 users
n Cisco SMAV M300v: Designed for organizations with 1,000 to 5,000 users
n Cisco SMA M170: Designed for small businesses or branch offices with up to 1,000 users
n Cisco SMAV M100v: Designed for small businesses or branch offices with up to
1,000 users
Additional Cisco CTD Solution Components 185
Note Cisco also has a Cisco SMAV M000v that is used for evaluations only.
n Cisco ASA
n Cisco WSA
Organizations using the transparent proxy functionality through a connector can get
the most out of their existing infrastructure. In addition, the scanning is offloaded from
the hardware appliances to the cloud, reducing the impact to hardware utilization and
reducing network latency. Figure 6-28 illustrates how the transparent proxy functionality
through a connector works.
HTTP request to
1
example.org
Branch Office
In Figure 6-28, the Cisco ASA is enabled with the Cisco CWS connector at a branch
office. The following steps explain how Cisco CWS protects the corporate users at the
branch office:
Step 1. An internal user makes an HTTP request to an external website (securemeinc.org).
Step 2. The Cisco ASA forwards the request to Cisco CWS global cloud infrastructure.
Step 3. It notices that example.org had some web content (ads) that was redirecting
the user to a known malicious site.
Cisco ISE provides network access control (NAC) features, including posture policies to
enforce that end-user devices are configured with the most up-to-date security settings
or applications before they enter the network. The following agent types are supported
by the Cisco ISE for posture assessment and compliance:
n Cisco NAC web agent: A temporary agent that is installed in end-user machines at
the time of login. The Cisco NAC Web Agent is no longer visible on the end-user
machine after the user terminates the session.
Cisco ISE provides a comprehensive set of features to allow corporate users to connect
their personal devices, such as mobile phones, tablets, laptops, and other network devic-
es to the network. This is what is called bring your own device (BYOD). BYOD intro-
duces many challenges when protecting network services and enterprise data. Cisco ISE
provides support for multiple Mobile Device Management (MDM) solutions to enforce
policy on endpoints. ISE can be configured redirect users to MDM onboarding portals,
Summary 187
prompting them to update their device before they can access the network. Cisco ISE
can also be configured to provide Internet-only access to users who are not compliant
with MDM policies.
Cisco ISE supports the Cisco Platform Exchange Grid (pxGrid). Cisco pxGrid is a multi-
vendor, cross-platform network system that combines different parts of an IT infrastruc-
ture, such as the following:
n Security monitoring
n Detection systems
Cisco pxGrid has a unified framework with an open application programming interface
(API) designed in a hub-and-spoke architecture. pxGrid is used to enable the sharing of
contextual-based information from Cisco ISE session directory to other policy network
systems such as Cisco IOS devices and the Cisco ASA.
The Cisco ISE can be configured as a certificate authority (CA) to generate and manage
digital certificates for endpoints. Cisco ISE CA supports standalone and subordinate
deployments.
Summary
The Cisco CTD Solution uses Cisco next-generation security products and components,
in addition to NetFlow and the Lancope StealthWatch System, for broad network vis-
ibility in the attack continuum. This chapter provided an introduction to the attack con-
tinuum and the deployment and configuration of NetFlow in key Cisco products such
as the Cisco ASA, Cisco NX-OS devices, and the Cisco NGA. Previous chapters covered
the NetFlow configuration in Cisco IOS-XE and classic Cisco IOS devices. This chapter
also covered the Cisco FirePOWER and FireSIGHT, and Cisco’s AMP for endpoint con-
trol and network malware control with AMP for networks. It also provided an overview
of the content security appliances and services such as the Cisco WSA and Cisco CWS,
which provide adaptive threat control of web traffic, in addition to the Cisco ESA,
which provides dynamic threat control for email traffic. At the end of the chapter, the
Cisco ISE was introduced. The Cisco ISE is used in the Cisco CTD Solution for user and
device identity integration with Lancope StealthWatch and remediation policy actions
using pxGrid.
This page intentionally left blank
Chapter 7
Troubleshooting NetFlow
Before you start learning in-depth troubleshooting techniques and detailed information
about debug commands, it is recommended that you understand the impact of debug
commands in production environments. Use debug commands with caution at all times.
The impact of using some of the debug commands will depend on your environment
and the CPU and memory utilization of your network infrastructure device. In some
cases, it is recommended that these commands be used only under the direction of your
router technical support representative when troubleshooting specific problems.
Enabling debugging can disrupt operation of an infrastructure device when networks are
experiencing high load conditions.
190 Chapter 7: Troubleshooting NetFlow
Before debugging, look at your CPU load with the show processes cpu command in
Cisco IOS, IOS-XE, and IOS-XR devices and with the show cpu command in Cisco
Adaptive Security Appliance (ASA) devices.
Tip The whitepaper titled “Troubleshooting High CPU Utilization on Cisco Routers” is
a great resource to learn more information about how to analyze CPU utilization in Cisco
IOS devices. You can find the whitepaper at http://www.cisco.com/c/en/us/support/
docs/routers/10000-series-routers/15095-highcpu.html.
The document in the following link provides information on how to monitor and trouble-
shoot the performance of a Cisco ASA security appliance: http://www.cisco.com/c/en/us/sup-
port/docs/security/asa-5500-x-series-next-generation-firewalls/113185-asaperformance.html.
Cisco routers, switches, and the Cisco ASA can display debug outputs to various inter-
faces, including the console, aux, and vty ports. These devices can also log messages to
an internal buffer to an external syslog server.
When you are connected to the console, no extra configuration is needed in order to
see the debug command output; however, make sure that the logging console level is
set to an appropriate level and that logging has not been disabled with the no logging
console command. Excessive debugs to the console port of a router can cause it to hang
or become extremely slow. This is because the router, switch, or Cisco ASA routinely
prioritizes console output before other device functions.
If you are connected via Telnet or Secure Shell (SSH), you must use the terminal monitor
command to see the debug output.
Note SSH is the recommended and most secure connection option of the two.
You can also log messages to an internal buffer. If you enable the logging to an internal
buffer, the log messages are copied to an internal buffer instead of to the device display-
ing them to the console. The buffer is a circular buffer. In other words, newer messages
overwrite older messages.
To log messages to an internal buffer, use the logging buffered command in Cisco IOS,
Cisco IOS-XE, Cisco IOS-XR, and Cisco ASA devices. Example 7-1 shows the different
options of the logging buffered command in a Cisco IOS router.
Example 7-2 shows the different options of the logging buffered command in a Cisco ASA.
To display the messages that are logged in the buffer, use the privileged EXEC command
show logging. Example 7-3 demonstrates how to enable logging buffered at severity 6
(informational), and then an example of the output of the show logging command in the
Cisco ASA.
Example 7-3 Example of logging buffered and show logging Commands in the Cisco ASA
Note For more information about the Cisco ASA logs and syslog messages, go to
cisco.com/go/asa or refer to the third edition of the Cisco Press book Cisco ASA: All-in-
One Next-Generation Firewall, IPS, and VPN Services.
Example 7-4 shows an example of the output of the show logging command in a Cisco
IOS router. The command is the same in Cisco IOS and Cisco IOS-XE.
Example 7-4 Example of show logging Command in Cisco IOS and Cisco IOS-XE
You can specify the size of the buffer and the severity level of the messages to be
logged.
In the Cisco ASA, you can specify the size of the logging buffer by using the logging
buffer-size command, as demonstrated in Example 7-5.
In Cisco IOS and Cisco IOS-XE, you can specify the size of the logging buffer using the
logging buffered command, as previously shown in Example 7-1.
To clear the log in Cisco IOS and Cisco IOS-XE, you can use the clear log command. In the
Cisco ASA, you can use the clear logging buffer command to clear the internal logging buf-
fer, the clear logging asdm command to clear the ASDM logging buffer, and the clear log-
ging queue to clear all the logging-related queues. These options are shown in Example 7-6.
Another best practice is to enable millisecond (msec) time stamps in your infrastructure
device. In Cisco IOS, you can enable time stamps with the service timestamps command,
as shown in Example 7-7.
In Example 7-7, the service timestamps debug datetime msec command is used to
enable time stamps for debug messages, and the service timestamps log datetime msec
command is used to enable time stamps for any other log messages.
These commands add time stamps in the format MMM DD HH:MM:SS, indicating the
date and time according to the system clock. When the device clock has not been set,
the date and time are preceded by an asterisk to indicate that the date and time are prob-
ably inaccurate.
With Cisco ASA devices, time stamps are enabled with the logging timestamp command.
Tip It is highly recommended that you use a Network Time Protocol (NTP) server to
synchronize the clock in all your network infrastructure devices.
10.1.10.0/24
10.2.20.20
RTP-R1
RTP-R2 G0/0 G01
RTP-R3
.2 .1 .1 .2
G0/2
.1
10.1.48.0/24 10.2.22.22
.2
172.18.104.179
Elasticsearch, Logstash,
and Kibana (ELK)
The RTP office hosts a call center where more than 200 employees access several
internal applications. The security and network administrators want to enable Flexible
NetFlow in the router labeled RTP-R1 to monitor the traffic between the hosts in the
call center and the application servers. The hosts in the call center are in the 10.1.10.0/24
network, and the application servers are in the 10.2.20.0/24 network, as shown in
Figure 7-1. The router RTP-R1 also has a connection to a management network where
the security administrator has a server running Elasticsearch, Logstash, and Kibana
(otherwise known as ELK). This server is configured with the IP address 172.18.104.179.
!
interface GigabitEthernet0/1
ip address 10.2.1.1 255.255.255.0
duplex auto
speed auto
media-type rj45
!
interface GigabitEthernet0/2
ip address 10.1.48.1 255.255.255.0
duplex auto
speed auto
media-type rj45
!
In Example 7-8, a flow exporter is configured with the name EXPORTER-1. The destina-
tion host is the ELK server with the IP address 172.18.104.179 and configured to send
Flexible NetFlow information using UDP port 9995. You can also use the show running-
config flow exporter command to view all flow exporter configurations, as shown in
Example 7-9.
A flow record is configured called RTP-FLOW-RECORD-1. You can also use the show
running-config flow record to see all flow records that have been configured in the
Cisco IOS device, as shown in Example 7-10.
This flow record is configured to match IPv4 traffic based on the following:
n Protocol
n Source address
n Destination address
You can use the show flow record name command to see the details of the configured
flow record. Example 7-11 includes the output of the show flow record RTP-FLOW-
RECORD-1 command displaying the details of the RTP-FLOW-RECORD-1 flow record.
As you learned in previous chapters, a flow record must have at least one match crite-
rion for use as the key field, and usually it has at least one collect criterion for use as
a non-key field. There are hundreds of possible combinations for the options you can
configure in flow records.
198 Chapter 7: Troubleshooting NetFlow
You can display several record options by using the show flow record command.
Example 7-12 shows the output of the show flow record command for your reference.
The show flow record command can show traditional NetFlow collection schemes, IPv4
input NetFlow with origin autonomous systems (AS), and many other fields. The output
of this command gives you a good reference of the fields that can be used to customize
a Flexible NetFlow record.
No. of users: 0
Total field space: 53 bytes
Fields:
match ipv4 tos
match ipv4 protocol
match ipv4 source address
match ipv4 destination address
match transport source-port
match transport destination-port
match interface input
match flow sampler
collect routing source as
collect routing destination as
collect routing next-hop address ipv4
collect ipv4 source mask
collect ipv4 destination mask
collect transport tcp flags
collect interface output
collect counter bytes
collect counter packets
collect timestamp sys-uptime first
collect timestamp sys-uptime last
The following are the highlights of the other NetFlow record options categories that are
not displayed in Example 7-12:
n AS aggregation schemes
n AS aggregation schemes
The administrator also uses the debug flow exporter command to troubleshoot the
communication to the NetFlow collector (ELK server). Example 7-15 demonstrates the
debug flow exporter.
After the debug flow exporter command is enabled in Example 7-15, a debug message
is shown indicating that a flow exporter packet has been sent to the NetFlow collector.
There are several additional options for the debug flow exporter command, as shown in
Example 7-16.
If multiple flow exporters are configured, you can specify the name of the configured
exporter you want to troubleshoot. Example 7-17 shows how to enable debug flow
exporter just for the EXPORTER-1 exporter.
The following are the optional keywords of the debug flow exporter command:
Remember that NetFlow uses UDP for communication. UDP is connectionless, meaning
that the sender transmits data without any confirmation that the destination received the
data. Subsequently, the next thing is to make sure that basic IP connectivity between the
router and the ELK server is even possible. The administrator uses one of the most fun-
damental tools available, ping. He notices that he cannot even ping the server, as shown
in Example 7-18.
The administrator then verifies that RTP-R1 has a route for the 172.18.104.179 host by
using the show ip route 172.18.104.179 command, as shown in Example 7-19.
RTP-R1 does have a static route to the 172.18.0.0/16 network, but it was incorrectly
configured. The route was pointing to 10.1.48.3 instead of the RTP-R4 router (10.1.48.2)
in the management network. After the administrator corrects the route, he was able to
ping the ELK server and see all the NetFlow data in the Kibana dashboard.
As you can see in Example 7-20, the flexible NetFlow flow monitor RTP-FLOW-
MONITOR-1 has been associated to interface Gigabit Ethernet0/0. The direction of the
traffic that is being monitored by the flow monitor has been configured to input. There
are two possible values (input and output). When a flow monitor is configured with the
input keyword, it monitors all traffic is being received by the interface. When a flow
monitor is configured with the output keyword, it monitors all traffic is being transmit-
ted by such interface.
The show flow monitor command can also be used to verify the configuration of an
existing flow monitor, as shown in Example 7-21.
You can also specify the name of the flow monitor to display the information for a
specific flow monitor. There are two additional optional keywords you can use with this
command (cache and statistics), as demonstrated in Example 7-22.
Example 7-23 displays the status, statistics, and data for the flow monitor named RTP-
FLOW-MONITOR-1.
Flows added: 13
Flows aged: 9
- Active timeout ( 1800 secs) 0
- Inactive timeout ( 15 secs) 9
- Event aged 0
- Watermark aged 0
- Emergency aged 0
Example 7-24 displays the high-level statistics, and data for the flow monitor named
RTP-FLOW-MONITOR-1.
Flows added: 13
Flows aged: 12
- Active timeout ( 1800 secs) 0
- Inactive timeout ( 15 secs) 12
- Event aged 0
- Watermark aged 0
- Emergency aged 0
Troubleshooting NetFlow in Cisco IOS and Cisco IOS XE Devices 207
The show flow exporter export-ids command is a useful command that can be used
as a reference when learning the different NetFlow or IPFIX export fields that can
be exported and their IDs. You have three options with this command, as shown in
Example 7-26.
Example 7-27 shows the output of the show flow exporter export-ids netflow-v9 com-
mand. This command output can be used as a reference to learn the NetFlow Version 9
export fields.
You can also use the debug flow exporter and debug flow monitor commands to display
flow monitor transactions and flow exporter communications to the NetFlow collector.
Example 7-28 shows the output of these commands. In this example, you can see the step-
by-step process of how a source interface is selected by the flow exporter and how the
flow monitor (mon-1) is created. In addition, you can see that the exporter (exporter-1) is
successfully registered to the flow monitor (mon-1). After the flow record (record-1) is cre-
ated, you can see that the source and destination IP addresses are recorded. At the end of
the output of the debugs, you can see that the packet is queued to be sent to the collector.
Troubleshooting NetFlow in Cisco IOS and Cisco IOS XE Devices 209
Example 7-28 debug flow exporter and debug flow monitor Command Output
*Jan 26 16:43:55.310: FLOW EXP: Source interface Ethernet3/6 has had change of
IP address
*Jan 26 16:43:55.310: FLOW EXP: Selected Source IP address 0.0.0.0, dst 14.0.0.1
*Jan 26 16:43:55.318: FLOW EXP: Source interface Ethernet3/6 has had change of
IP address
*Jan 26 16:43:55.318: FLOW EXP: Selected Source IP address 0.0.0.0, dst 14.0.0.1
*Jan 26 16:43:55.462: FLOW EXP: Source interface Ethernet3/6 has had change of
IP address
*Jan 26 16:43:55.462: FLOW EXP: Selected Source IP address 14.0.0.2, dst 14.0.0.1
*Jan 26 16:43:55.462: FLOW EXP: Source interface Ethernet3/6 has had change of
IP address
*Jan 26 16:43:55.462: FLOW EXP: Selected Source IP address 14.0.0.2, dst 14.0.0.1
*Jan 26 16:44:02.682: FLOW MON: 'mon-1' created.
*Jan 26 16:44:02.750: FLOW EXP: Exporter exporter-1 successfully registered
Client mon-1
*Jan 26 16:44:02.834: Flow record: Master(record-1) Created
*Jan 26 16:44:03.694: FLOW EXP: Selected Source IP address 14.0.0.2, dst 14.0.0.1
*Jan 26 16:44:04.694: FLOW MON: Running ip input feature on Ethernet3/7
*Jan 26 16:44:04.694: FLOW MON: Running ip post input feature on Ethernet3/6
*Jan 26 16:44:04.694: FLOW MON: Running ip input feature on Ethernet3/7
*Jan 26 16:44:04.694: FLOW MON: Running ip post input feature on Ethernet3/6
*Jan 26 16:44:04.694: FLOW MON: Running ip input feature on Ethernet3/7
*Jan 26 16:44:04.694: FLOW MON: Running ip post input feature on Ethernet3/6
*Jan 26 16:44:04.694: FLOW MON: Running ip input feature on Ethernet3/7
*Jan 26 16:44:04.694: FLOW MON: Running ip post input feature on Ethernet3/6
*Jan 26 16:44:05.694: FLOW EXP: Time based resending of Template (ID: 256,
Exporter: em_1)
*Jan 26 16:44:05.694: FLOW EXP: Packet queued for process send
There are many application types that can be associated by the exporter. You can use
the show flow exporter option application table command to display the detailed
application options that can be used. You can familiarize yourself with all the supported
applications by looking at the output of Example 7-29.
Example 7-29 show flow exporter option application table Command Output
! The following are the Layer 4 standard protocols supported by the flow exporter
! in Flexible NetFlow.
! In this example, NBAR was not configured and no applications are displayed.
Engine: NBAR (NBAR_CUSTOM, ID: 6)
Note The spread time must be smaller than half of the interval. Thus, it will be set to
half the interval time or to the configured spread interval, whichever is lower, but not
lower than one second.
You should configure spreading when the interval synchronization timeout is lower than
10 seconds. This is so that the asynchronous monitors will be able to aggregate the data
within a few seconds.
Note The default spread interval is 30 seconds. The maximum synchronized interval
timeout value is 300 seconds. The maximum synchronized interval timeout value could
be larger for native Flexible NetFlow monitors.
214 Chapter 7: Troubleshooting NetFlow
It is important to understand that the NetFlow/IPFIX header time stamp is set to the
time when the record leaves the device, not when the record leaves the NetFlow cache.
This is a common misconception. The time stamp fields in the record itself capture the
time stamp of the packets and are accounted for in the NetFlow cache.
To configure the Prevent Export Storms feature, use the flow monitor type perfor-
mance-monitor command. Example 7-31 shows an example configuration.
You can use the show flow monitor type performance-monitor command to show the
details of the performance monitor configuration and statistics, as shown in Example 7-32.
To view the configuration of a flow monitor applied to a given interface, you can use
the show flow interface command, as demonstrated in Example 7-34.
Example 7-35 demonstrates how to display the status and statistics for the flow monitor
named RTP-DC-MONITOR-1.
n PktCnt: The number of packets that have been monitored and accounted for
n ByteCnt: The number of bytes that have been monitored and accounted for
You can display the status and statistics for a Flexible NetFlow flow monitor by using
the show flow sw-monitor name statistics command, as shown in Example 7-36.
Several additional commands can help you display NetFlow configuration statistics and
prove useful when troubleshooting NetFlow problems in Cisco NX-OS devices:
n show hardware flow aging: Used to display information about NetFlow aging flows
in hardware
n show hardware flow entry address table-address type {ip | ipv6} [module module]:
Used to display information about NetFlow table entries in hardware
n show hardware flow ip: Used to display information about NetFlow IPv4 flows in
hardware
n show hardware flow sampler: Used to display information about the NetFlow sam-
pler in hardware
n show hardware flow utilization: Used to display information about NetFlow table
utilization in the hardware
Figure 7-2 illustrates a high-level architecture of a Cisco ASR 9000 series router line card.
218 Chapter 7: Troubleshooting NetFlow
Interface 1
NPU-1
Interface 2
CPU NPU-2
Interface 3
NPU-3
Interface 4
Line Card
Figure 7-2 High-Level Architecture of a Cisco ASR 9000 Series Router Line Card
In Figure 7-2, the first NPU is configured with one interface, the second has two inter-
faces, and the third NPU has one interface. When you have one interface to one NPU,
the full interface rate is available for NetFlow processing. For instance, on a Cisco ASR
9000 series router, it will be 100,000 packets per second (pps) in Trident cards and
200,000 pps in Typhoon-based cards. When two interfaces are enabled on an NPU, the
total capacity of such NPUs is shared, depending on the type of the line card.
Figure 7-3 illustrates a diagram that explains the packet and NetFlow configuration flow in
a Cisco ASR 9000 running Cisco IOS-XR software. This process is also very similar in Cisco
Carrier Routing System (CRS) and Cisco Network Convergence System (NCS) devices.
Step 1. The NetFlow process manager is responsible for sending the configuration
parameters to the line card CPU.
Step 2. The NetFlow execution agent (EA) sends configuration parameters (such as
the exporter information, aging timers, and so on) to the NetFlow server.
Step 4. Once traffic is collected, the NetFlow sampled packets pass through the
sampling policer. The hardware ucode extracts data from the header fields
and sends them to the line card CPU (NetFlow producer) to construct a flow
record. The line card CPU sends the flow record to the NetFlow cache, and
they remain in the line card cache until they are aged due to either timer
expiry or cache exhaustion. There are two timers running for flow aging: the
active timer and the inactive timer.
Step 5. The NetFlow server is also responsible for sending the sampled NetFlow
records to the NETIO and subsequently to the external NetFlow collector.
Troubleshooting NetFlow in Cisco IOS-XR Software 219
NetFlow Process
1
Manager
Sends Configuration
Parameters to Line Card CPU
NetFlow EA
Line Card
CPU Configuration Information
Such as Exporter, Aging 2 3
Timer, and so on.
Sends Configuration
Parameters to
Forwarding ASIC
NETIO NetFlow Server Hardware (Such as
5 Sampling Rate)
Shared Memory
NetFlow Producer
Hardware/ucode
Note The recording of flow attributes in supported line cards is done by the line card
CPU. All flow packets from the NPs are punted to line card CPU. To prevent flow packets
arriving from the network processor (NP) at an overwhelming rate, the punt path is policed
by internal programming policers on all the NPs that have NetFlow-enabled interfaces. The
policer rate is determined based on the CPU capable rate divided by number of NetFlow
enabled interfaces on each NP.
Now that you have learned a few concepts of the NetFlow packet flow and architecture
in Cisco IOS XR devices, let’s examine some of the show commands that are very useful
for troubleshooting. Several of these commands are very similar to the commands you
learned earlier in this chapter.
Status: Normal
Transport UDP
Destination 172.18.104.179 (50001)
Source 10.1.1.24 (5956)
Flows exported: 0 (0 bytes)
Flows dropped: 0 (0 bytes)
In Example 7-37, the location keyword is used to specify the location where the cache
resides. The node-id argument is expressed in the rack/slot/module notation. In this
example, the node-id is 0/0/CPU0.
Tip You can use the show platform command to see the location of all nodes installed
in the router.
Troubleshooting NetFlow in Cisco IOS-XR Software 221
In the output of the show flow exporter command shown in Example 7-37, you can see
the following information:
n The status of the exporter. Normal means that the exporter is active and that the
router can export packets. Disabled means that the exporter cannot send packets
because the collector is unreachable or the configuration is in complete.
n The average export rate, in bytes per packets. The information there is shown for
intervals of the last hour, 1 minute, and 1 second.
n The differentiated services code point (DSCP) value for export packets configured
with the flow exporter-map command.
n The transport protocol. Cisco IOS XR software only supports UDP as the transport
protocol.
n The NetFlow version used (version 9 in this example). Only NetFlow Version 9 is
supported in Cisco IOS-XR.
In Example 7-39, the cache summary displays general cache information for RTP-
flow-mon-1:
n Watermark aged
n Emergency aged
The periodic export count section includes statistics for the following:
n Counter wrap
The last section of the output of Example 7-39 shows the number of flows exported,
matching entries, and the actual flow entries.
The show flow monitor command is very useful and can be combined in many different
combinations depending on the information you want to display and evaluate. The fol-
lowing are several examples of its usage:
n If you want to match on access control lists (ACLs) and one or more fields, use the
following options:
show flow monitor monitor_name cache match {ipv4 {acl name | source-address
match_options |destination-address match_options | protocol match_options | tos
match-options }| ipv6 {acl name | source-address match_options | destination-
address match_options | protocol match_options | tc match_options}| layer4
{source-port-overloaded match_options | destination- port-overloaded match_
options | tcp-flags match_flags_options}| bgp {source-as match_options |
destination-as match_options}| interface {ingress match_if_options | egress
match_if_options }| timestamp {first match_options | last match_options}|
counters {byte match_options | packets match_options}| misc {forwarding-
status match_options | direction match_dir_options}}
n You can use the following options to sort flow record information according to a
particular field:
show flow monitor monitor_name cache sort {ipv4 {source-address | destination-
address | tos | protocol}| ipv4 {source-address | destination-address | tc |
protocol}| mpls {label-2 | label-3 | label-4 | label-5 | label-6 | label-type
| prefix | top-label }| layer4 {source-port-overloaded | destination-
port-overloaded }| bgp {source-as | destination-as}| timestamp {first |
last}| counters {bytes | packets}| misc {forwarding-status | direction}{top |
bottom}
Troubleshooting NetFlow in Cisco IOS-XR Software 225
n You can use the following options to include or exclude one or more fields in the
show flow monitor command output:
show flow monitor monitor_name cache {include | exclude}{ipv4 {source-address
| destination-address | tos | protocol}| ipv6 {source-address | destination-
address | tc | flow-label | option-headers | protocol}| mpls {label-2 |
label-3 | label-4 | label-5 | label-6 | top-label}| layer4 {source-port-overloaded
| destination-port-overloaded}| bgp {source-as | destination-as}| timestamp
{first | last}| counters {bytes | packets}| misc {forwarding-status match_
options | direction match_dir_options}}
n The following options can be used to display summarized flow record statistics:
show flow monitor monitor_name cache summary location node_id
n You can use the following options to display only key field, packet, and byte infor-
mation for the flow records:
show flow monitor monitor_name cache brief location node_id
n You can use the following options to display flow record information for a particu-
lar node only:
The show flow monitor monitor_name cache summary command can also be used with
any combinations of the following options:
n format
n match
n include
n exclude
n sort
n summary
n location
Example 7-40 show flow monitor monitor-name cache summary Command Options in
Cisco IOS-XR
You can use the show flow monitor-map command to display information about a con-
figured flow monitor-map, as shown in Example 7-41.
The following are the fields displayed in the output of the show flow monitor-map
command shown in Example 7-41:
n The name of the export map that is associated with this monitor map (RTP-exp-1).
n The Current aging mode configured on this cache. In this example, Permanent indi-
cates that the removal of entries from the monitor map flow cache is disabled. This is
a configurable value that can be configured using the flow monitor-map command.
n The number of flow entries currently allowed in the flow cache before the oldest
entry is removed. This is a configurable value that can be configured using the flow
monitor-map command.
n The active flow timeout configured for this cache, in seconds. You can modify the
configured active flow timeout using the flow monitor-map command.
n The inactive flow timeout configured for this cache, in seconds. This is also configu-
rable using the flow monitor-map command.
n The update timeout configured for this cache, in seconds. You guess correctly; this
is also configurable using the flow monitor-map command.
producer you want to examine. Example 7-42 displays the output of the show flow plat-
form producer statistics command.
Example 7-42 shows the NetFlow Producer statistics for the location 0/0/CPU0. The
following counters are displayed:
n The number of IPV4 packets that were received from the remote end
n The number of packets that the producer could not enqueue to the NetFlow server
because the server input ring was full
n The number of packets that the producer could not enqueue to the NetFlow server
due to errors other than the server input ring being full
n The number of unrecognized packets received from the remote end that were
dropped
n The number of packets transmitted to the remote end that was dropped because
they were not recognized by the remote end
n The number of times that the producer needed to use the server
228 Chapter 7: Troubleshooting NetFlow
n The number of flow packets per SPP frame transmitted to the remote end
You can clear statistics collected by the NetFlow producer by using the clear flow platform
producer statistics location command in EXEC mode, as follows:
n show flow platform nfea sampler: Used to display NetFlow sampler map informa-
tion and statistics.
n show flow platform nfea interface: Used to display NetFlow EA information and
statistics for a given interface.
n show flow platform nfea sp location: Used to display NetFlow EA sampling profile
information and statistics for a given location.
n show flow platform nfea policer np: Used to display NetFlow EA policer informa-
tion and statistics for a given node.
n show flow trace: Useful to show low level information about the NetFlow manager,
NetFlow server, NetFlow EA, and others.
Example 7-43 shows the different options of the show flow trace command.
AUS-ASA
Inside Outside
Corporate Internet
Network
Management
192.168.1.1
192.168.1.205
NetFlow Collector
(ELK)
Austin, Texas
Figure 7-4 Austin Regional Office Network Topology
The Cisco ASA in Austin is configured to send NetFlow records to a collector with the
IP address of 192.168.1.205, which is reached by the management interface of the Cisco
ASA. The network administrator notices that he is not receiving NetFlow information in
the collector, even though basic IP connectivity is successful.
First let’s see whether NetFlow records (packets) are being sent by the Cisco ASA by
using the show flow-export counters command, as shown in Example 7-44.
Example 7-44 show flow-export counters Command Output in the Cisco ASA
In Example 7-44, the Cisco ASA shows that it has sent 369,388 packets to the NetFlow
collector. You can see that the destination is correctly set to 192.168.1.205, which
resides in the management interface. You can also see that the ASA is configured to
send the NetFlow packets using UDP 9901. The error counters are all zero. The show
230 Chapter 7: Troubleshooting NetFlow
f low-export counters command can help you determine whether there are any errors in
the transmission of NetFlow records/packets because of any of the following reasons:
After analyzing the output of the show flow-export counters command, the administrator
decides to use the capture command to capture all packets sourced from the Cisco ASA to
the NetFlow collector. The capture command is extremely useful when troubleshooting any
communication problems in the Cisco ASA, because it converts the Cisco ASA in a sniffer
capturing all packets for a given criteria. The syntax of the capture command is as follows:
capture capture_name [ type { asp-drop all [ drop-code ] | tls-proxy | raw-data
| lacp | isakmp [ikev1| ikev2] | inline-tag [ tag ] | webvpn user webvpn-user }]
[ access-list access_list_name ][ interface asa_dataplane ] [ buffer buf_size ]
[ ethernet-type type ] [ interface interface_name ][ reinject-hide ] [ packet-
length bytes ] [ circular-buffer ] [ trace trace_count ] [ real-time ][ trace ]
[ match prot { host source- ip | source -ip mask | any }{ host destination- ip
| destination -ip mask | any } [ operator port ]
Example 7-45 shows the configuration of the capture command entered by the adminis-
trator in the Cisco ASA in Austin.
Example 7-45 Collecting NetFlow Packet Captures Using the capture Command
In Example 7-45, the capture name is netflow-cap and the capture is applied to the
management interface. The administrator wants to collect all UDP traffic sourced from
the management interface of the Cisco ASA (192.168.1.1) to the NetFlow collector
(192.168.1.205) over UDP port 9901.
You can use the show capture command to review the capture configuration and to
make sure that the capture is working and collecting traffic, as shown in Example 7-46.
To view the details of the packet capture, use the show capture capture_name detail
command, as demonstrated in Example 7-47.
Troubleshooting NetFlow in the Cisco ASA 231
In Example 7-47, a total of 21 packets were captured, and you can see the details of
each packet. To view the actual dump of each of the packets collected, you can use the
show capture capture_name dump command, as shown in Example 7-48.
0x0100 a801 cdc0 a801 0100 0000 0002 07e2 0000 ................
0x0110 014a bc93 8432 0000 0224 0000 0000 0000 .J...2...$......
0x0120 014a bc93 8432 0100 0068 0017 0851 c0a8 .J...2...h...Q..
0x0130 0159 eede 0004 ac12 6c2b 0035 0008 1100 .Y......l+.5....
0x0140 000a 756e 24ac 126c 2bee de00 3501 0000 ..un$..l+...5...
0x0150 0000 014a bc93 8568 0000 014a bc93 8568 ...J...h...J...h
0x0160 433a 1af1 2bc0 c8ca 0000 0000 0000 0000 C:..+...........
0x0170 0000 0000 0000 0000 0000 0000 0000 0000 ................
0x0180 0000 0000 0000 0000 0000 0000 0000 0107 ................
0x0190 00c0 0017 0851 c0a8 0159 eede 0004 ac12 .....Q...Y......
0x01a0 6c2b 0035 0008 1100 000a 756e 24ac 126c l+.5......un$..l
0x01b0 2bee de00 3505 07e2 0000 014a bc93 8586 +...5......J....
0x01c0 0000 0020 0000 0127 0000 014a bc93 8568 ... ...'...J...h
0x01d0 0017 0851 c0a8 0159 eede 0004 ac12 6c2b ...Q...Y......l+
0x01e0 0035 0008 1100 000a 756e 24ac 126c 2bee .5......un$..l+.
0x01f0 de00 3502 07e2 0000 014a bc93 8586 0000 ..5......J......
0x0200 0020 0000 0127 0000 014a bc93 8568 0017 . ...'...J...h..
0x0210 081d c0a8 0182 d751 0004 4a7d 8965 01bb .......Q..J}.e..
0x0220 0003 0600 00ae 6359 0c4a 7d89 65d7 5101 ......cY.J}.e.Q.
0x0230 bb05 0000 0000 014a bc93 86c6 0000 0a3b .......J.......;
0x0240 0000 0352 0000 014a bc92 94d6 0000 0100 ...R...J........
0x0250 0068 0017 0852 c0a8 0185 cc0f 0004 0c95 .h...R..........
0x0260 da49 01bb 0003 0600 00ae 6359 0c0c 95da .I........cY....
0x0270 49cc 0f01 bb01 0000 0000 014a bc93 92b0 I..........J....
0x0280 0000 014a bc93 92b0 433a 1af1 2bc0 c8ca ...J....C:..+...
0x0290 0000 0000 0000 0000 0000 0000 0000 0000 ................
0x02a0 0000 0000 0000 0000 0000 0000 0000 0000 ................
0x02b0 0000 0000 0000 0107 00fc 0017 0852 c0a8 .............R..
0x02c0 0185 cc0f 0004 0c95 da49 01bb 0003 0600 .........I......
0x02d0 00ae 6359 0c0c 95da 49cc 0f01 bb05 07ed ..cY....I.......
0x02e0 0000 014a bc93 9364 0000 0034 0000 0034 ...J...d...4...4
0x02f0 0000 014a bc93 92b0 0017 0852 c0a8 0185 ...J.......R....
0x0300 cc0f 0004 0c95 da49 01bb 0003 0600 00ae .......I........
0x0310 6359 0c0c 95da 49cc 0f01 bb02 07ed 0000 cY....I.........
0x0320 014a bc93 9364 0000 0034 0000 0034 0000 .J...d...4...4..
0x0330 014a bc93 92b0 0017 07f0 c0a8 01cc 007b .J.............{
0x0340 0004 c63c 16f0 007b 0003 1100 00ae 6359 ...<...{......cY
0x0350 0cc6 3c16 f000 7b00 7b05 07eb 0000 014a ..<...{.{......J
0x0360 bc93 9788 0000 0000 0000 0000 0000 014a ...............J
0x0370 bc92 acdc 0017 07f0 c0a8 01cc 007b 0004 .............{..
0x0380 c63c 16f0 007b 0003 1100 00ae 6359 0cc6 .<...{......cY..
0x0390 3c16 f000 7b00 7b02 07eb 0000 014a bc93 <...{.{......J..
0x03a0 9788 0000 0030 0000 0030 0000 014a bc91 .....0...0...J..
0x03b0 bbf0
<output omitted>
234 Chapter 7: Troubleshooting NetFlow
Note For more information about the Cisco ASA capture command, see http://
www.cisco.com/c/en/us/td/docs/security/asa/asa-command-reference/A-H/cmdref1/
c1.html#pgfId-2147322.
Clearly, the Cisco ASA is sending the NetFlow packets to the NetFlow collector cor-
rectly. After reviewing the output of all the aforementioned commands, the network
administrator logs in to the NetFlow collector (ELK server) and notices that its logstash
NetFlow configuration file (logstash-netflow.conf in this example) was configured
incorrectly. It had 10.1.1.1 for the NetFlow source instead of the Cisco ASA manage-
ment interface IP address. The highlighted line in Example 7-49 shows the entry in the
logstash-netflow.conf file that was configured incorrectly.
input {
udp {
port => 9901
codec => netflow {
definitions => "/home/administrator/logstash-1.4.2/lib/logstash/codecs/
netflow/netflow.yaml"
versions => [9]
}
}
}
output {
stdout { codec => rubydebug }
if ( [host] =~ "10.1.1.1" ) {
elasticsearch {
index => "logstash_netflow5-%{+YYYY.MM.dd}"
host => "localhost"
}
} else {
elasticsearch {
index => "logstash-%{+YYYY.MM.dd}"
host => "localhost"
}
}
}
When troubleshooting NetFlow communication problems in the Cisco ASA, basic trouble-
shooting tools such as the capture command and other simple show commands can save you
hours of troubleshooting. These are considered the “Swiss army knives” that can help during
the troubleshooting of many communication and IP connectivity issues in the Cisco ASA.
Troubleshooting NetFlow in the Cisco NetFlow Generation Appliance 235
Note If no managed device is configured for a particular data port, the NGA populates
the input and output interface fields in flow records with a value corresponding to its
own local data port on which the flow was received.
To view the details about the configured managed devices, use the show managed-
device command, as shown in Example 7-50.
In Example 7-50, the IP address of the configured managed device is 10.1.1.10. The ID
is the identifier of the managed device; in this case, the managed device ID is 1. The
username used to communicate to the managed device is md-user and the data ports are
2 and 4.
Note The data ports are configured with the dataport ports command. These are the
data ports where NGA is receiving network traffic from the managed device. Each ports
is a comma-separated string (for example, 2,4 for data port 2 and data port 4).
236 Chapter 7: Troubleshooting NetFlow
You can use the show flow command to display information about the following:
To display and analyze information about the flow collectors configured in the system,
you can use the show flow collector command, as demonstrated in Example 7-52.
[email protected]#
Troubleshooting NetFlow in the Cisco NetFlow Generation Appliance 237
In Example 7-52, two flow collectors are configured (rtp-collector-1 and rtp-collector-2).
The IP address of rtp-collector-1 is 172.18.104.179, and the IP address of rtp-collector-2
is 172.18.104.180. Both are configured to communicate using UDP port 9995.
You can use the show flow exporter command to view and analyze the flow exporter
configuration in the Cisco NGA, as shown in Example 7-53.
Note When the exporter policy is configured to multi-destination, the exporter sends
the same NetFlow packet to all collectors set in the exporter. When the exporter policy is
configured as a policy weighted-round-robin, the Cisco NGA load balances the NetFlow
packets among collectors set in the exporter.
As you can see in Example 7-54, the show flow record command displays the following
information:
n The number of match fields configured for such flow record (10 in this example)
n The number of collect fields configured for the flow record (7 in this example)
exporter and flow monitor. It subsequently sends the flow information to the exporter,
which can apply filter rules, packs the flow records into NetFlow packets, and sends the
NetFlow packets to collectors.
The Cisco NGA supports up to four active flow monitors and up to six flow collec-
tors. You can use the show flow exporter command to display and analyze information
about the configured flow monitor, as shown in Example 7-55.
Show Tech-Support
As in other Cisco devices such as Cisco IOS, Cisco IOS-XE, Cisco IOS-XR, Cisco
NX-OS, and Cisco ASA, the Cisco NGA has its own version of the show tech-support
command (show tech for short). This is the most comprehensive show command that is
used for low-level troubleshooting in the Cisco NGA. The show tech command includes
numerous device statistics, logs, and low-level information that can be useful for
advanced users and for Cisco’s Technical Assistance Center (TAC).
Example 7-56 includes a short snippet of the show tech command.
! The version of the NGA appliance. In this example, no patches have been
! installed on the system.
NGA application image version: 1.0(2) RELEASE SOFTWARE [fc2]
Product Id: NGA3240-K9
Disk 0 size: 999 GB
Disk 1 size: 3 GB
Installed patches:
! IP address, DNS server, HTTP server, TACACS+, Telnet and SSH configuration
information
IP address: 10.1.1.215
Subnet mask: 255.255.255.0
IP Broadcast: 10.1.1.55
DNS Name: rtp-nga.cisco.com
Default Gateway: 10.1.1.1
Nameserver(s): 144.254.254.254
HTTP server: Disabled
HTTP secure server: Enabled
HTTP port: 80
HTTP secure port: 443
TACACS+ configured: No
Telnet: Disabled
SSH: Enabled
SNMPv1: Enabled
SNMPv2C: Enabled
NAM_TARGET=NFA_X520
NAM_TARGET_ID=13
MP=no
NAM_PROD_NO=NFA_X520
NAM_PROD_DESCR="Cisco NetFlow Generation Appliance (NFA_X520)"
NAM_VERSION="1.0(2) RELEASE SOFTWARE [fc2]"
NFA_MODEL=NGA3240-K9
NAM_PID=NGA3240-K9
NAM_SN=FCH1825V223
NAM_VID=V01
MEGARAID=1
NAM_LOCAL_DISK=/dev/sda
NAM_ROOT_PARTITION=/dev/sda1
NAM_NVRAM_PARTITION=/dev/sda2
NAM_STORAGE1_PARTITION=/dev/sda3
NAM_STORAGE_PARTITION=/dev/sda3
NAM_DISK=1002GB
NAM_DISK0=999GB
NAM_DISK1=3GB
`
Troubleshooting NetFlow in the Cisco NetFlow Generation Appliance 243
! Active connection information (similar to the output of the netstat Linux command.
As you can see in Example 7-56, the show tech command is very comprehensive, includ-
ing tons of information that can be useful to troubleshoot installation, configuration,
and communication issues in the Cisco NGA.
n show cache statistics rates monitor_name: Displays flow stats information at the
internal cache level with rate derived from the last minute.
n show collector statistics collector_name: Displays flow statistics at the flow collec-
tor level, both cumulative and last-minute rates. This displays how many packets and
flows have been sent to each collector.
n show dataport statistics cumulative: Displays statistics at the data port level where
network traffic arrives at NGA for processing.
n show dataport statistics rates: Displays statistics at the data port level with rates
computed for the last minute.
n show dataport statistics rates queues: Displays how balanced packets are at each
data port queues. Generally, queues at the data ports should be fairly balanced for
the best performance.
n show flow filter filter_name: Displays all flow filters configured in the system.
n show inventory: Displays the product ID and serial number of NGA device.
n show log config: Displays logging of configuration done via config network ftp-url
command.
n show patches: Displays all patches that have been installed in the system.
Summary
In this chapter, you learned many different commands, debugs, and tools that are useful
when troubleshooting NetFlow problems in Cisco IOS, Cisco IOS-XE, Cisco NX-OS,
and Cisco IOS-XR devices, as well as in the Cisco ASA 5500-X series Next-Generation
Firewalls and the Cisco NetFlow Generation Appliances. The first step in understanding
what show commands to use is to become familiar with them even during normal opera-
tions. Also, determine what debug commands to use by using them with caution. In the
beginning of this chapter, several tips and information about debug commands were pro-
vided as a general guidance when using these types of commands.
Chapter 8
Case Studies
This chapter covers several case studies and real-life scenarios on how NetFlow is
deployed in large enterprises and in small and medium-sized businesses. The following
case studies are covered:
DDoS attacks can generally be divided into the following three categories:
n Amplification attacks
248 Chapter 8: Case Studies
Attacker (A)
In the example shown in Figure 8-2, the attacker (A) manipulates a host (source) to
attack a victim (V) web server. An example of this is when the attacker sends Network
Time Protocol (NTP) request packets to the source (S), who thinks these packets are
legitimate. The source (S) then responds to the NTP requests by sending the responses to
the victim (V), who was never expecting these NTP packets from source (S).
Tip NTP is just an example of a protocol that can be used for these types of DDoS
attacks. Other protocols such as Domain Name System (DNS) can also be very effective.
Amplification Attacks
Amplification attacks are a form of reflected attacks in which the response traffic (sent by
the unwitting participants) is made up of packets that are much larger than those that were
initially sent by the attacker (spoofing the victim). An example of this is when DNS que-
ries are sent for which the DNS responses are much larger in packet size than the initial
query packets. As a result, the victim is flooded by large DNS responses for which it never
actually issued queries. Figure 8-3 illustrates an example of a DNS amplification attack.
In Figure 8-3, an attacker sends spoofed DNS requests to DNS open resolvers on the
Internet. These spoofed DNS requests are small 64-byte packets. The DNS responses are
then sent to the victim by these open DNS resolvers.
Larg
s) e DN
4 Byte S Re
quests (6 spon
ses (
d Re 3500
Spoofe Byte
s)
Attacker Victim
DNS Open
Resolvers on the
Internet
Tip The Open Resolver Project is a nonprofit initiative to report information about DNS
open resolvers on the Internet. It provides reports and statistics of millions of open
resolvers. Their site allows you to search for open resolvers based on your IP address space.
You can learn more about the Open Resolver Project at http://openresolverproject.org.
Another example of amplification attacks are misused of web-based applications such as
Wordpress. For instance, the Wordpress Pingback feature has been exploited in the past by
250 Chapter 8: Case Studies
miscreants to attack other websites. The legitimate intent of a pingback is to create a blog
or website comment that is created when you link to another blog post (if “pingbacks” are
enabled). Some systems automate this and maintain automated lists linking back to sites that
covered their blog post. In order to implement pingback, Wordpress implements an XML-
RPC API function. This function will then send a request to the site to which you would like
to send a “pingback”.
An attacker can include the “victim” URL with a random parameter such as “victim.com?
123456=123456” to prevent caching. Subsequently, the Wordpress install will send a
request to the victim’s site.
Internet
NetFlow-Enabled
Router
Management
Network
StealthWatch
FlowCollector
Web Servers
StealthWatch
SMC
Enterprise Network
Figure 8-4 Enterprise Network with NetFlow-Enabled Internet-Edge Routers
Using NetFlow for Anomaly Detection and Identifying DoS Attacks 251
The following are some of the key devices in the topology illustrated in Figure 8-4:
In this example, the FC collects and analyzes NetFlow data produced by the two
NetFlow-enabled routers. The SMC manages the FC creating normal traffic baselines
providing visibility, reporting, and management functions.
Example 8-1 shows the Flexible NetFlow configuration of one of the Internet-edge routers.
es
sag
ol Mes
C ontr C&C
Internet
NetFlow-Enabled
Botnet
Router
Management
Network
10.10.10.100
StealthWatch
FlowCollector
10.10.10.101
Web Servers
StealthWatch
SMC
Enterprise Network
Figure 8-5 DDoS Against Enterprise Web Servers
Once the DDoS event is detected, the StealthWatch SMC alerts the administrator.
Systems such as Lancope’s StealthWatch System can integrate with packet scrubbing
solutions. An example of one is Radware’s DefensePro. Radware’s DefensePro can be
configured to provide DDoS attack mitigation and scrubbing (including Secure Sockets
Layer [SSL]-based attacks). DefensePro is installed in dedicated hardware to be able to
scale while mitigating DDoS attacks. The SMC can interact with DefensePro to divert
the suspicious flows to the scrubbing device using Border Gateway Protocol (BGP).
DefensePro blocks the attack traffic and forwards only the clean traffic to the destina-
tion. This is illustrated in Figure 8-6.
Using NetFlow for Anomaly Detection and Identifying DoS Attacks 253
s
age
Mess C&C
nt rol
Co
Internet
NetFlow
Enabled
Botnet
Router
BGP DefensePro
StealthWatch
FlowCollector
10.10.10.100
Web Servers
StealthWatch
SMC
10.10.10.101
Enterprise Network
Note The carrier-grade Cisco Firepower 9300 provides DDoS protection capabilities
with Radware DefensePro, and it also can be used in these type of scenarios. The Cisco
Firepower 9300 also provides Cisco ASA firewalling and virtual private networking (VPN)
capabilities. The Cisco Firepower 9300 platform supports up to three security modules.
One of the modules can be configured with Cisco ASA software. A second module can be
deployed with Firepower Threat Defense including Advanced Malware Protection (AMP),
Next-Generation IPS (NGIPS), and URL filtering. A third module can be configured with
Radware DefensePro.
In Figure 8-7, a service provider has a series of Lancope StealthWatch FCs configured in
a distributed manner. Each FC is managed by the SMC. The SMC interacts with a series
of scrubbing servers redirecting attack traffic to the scrubbing center. These scrubbing
servers provide protection to the SP customers (Enterprise A and B) and even other peer-
ing service providers.
254 Chapter 8: Case Studies
Other SPs
SP Network
FC
SMC
FC
FC Enterprise B
Enterprise A
ScrubbingCenter
The breach was not detected for several months after the attackers had already pene-
trated the network. The retailer had firewalls and intrusion prevention devices, but those
were not enough to detect or mitigate the attack. The attack was thought to be an insider
job, because the malware that was extracting the credit card numbers was very sophis-
ticated and tailored to such an organization. The breach was detected only because
law enforcement contacted the victimized organization, telling them that thousands
of fraudulent credit card transactions had been detected on credit cards that were last
legitimately used at the retailer.
Using NetFlow for Incident Response and Forensics 255
San Francisco, CA
Toronto, Austin, TX
Canda
After the organization started their incident response and forensics investigation, they
decided to deploy NetFlow in routers at the edge of the data center. The topology in
Figure 8-9 illustrates the network at the San Francisco headquarters and the two routers
that were configured with NetFlow.
The data center has numerous servers that are dedicated for credit card processing appli-
cations (software), as illustrated in Figure 8-10.
After deploying NetFlow in their data center edge routers, the retailer observed that
numerous DNS requests were being sent from the credit card processing servers to DNS
servers outside of their country (United States). The most interesting fact was that such
DNS servers were in embargoed countries where the retailer previously had never trans-
acted any business. In addition, most of these DNS requests were being sent during off-
hours (mostly around 2:00 to 4:00 a.m. local time).
The retailer was able to inspect NetFlow traffic and detect the country where the credit
card information was sent by using the MaxMind Geo location database. MaxMind pro-
vides IP intelligence to thousands of companies to locate their Internet visitors and per-
form analytics. MaxMind has a product called minFraud service, which helps businesses
prevent fraudulent online transactions and reduce manual review.
The attackers were sending stolen credit card data over DNS using tunneling. DNS is a
protocol that enables systems to resolve domain names (for example, example.com) into
IP addresses (for example, 93.184.216.34). DNS is not intended for a command channel
256 Chapter 8: Case Studies
or even tunneling. However, attackers have developed software that enabled tunneling
over DNS. Because traditionally DNS it is not designed for data transfer, it is less
inspected in terms of security monitoring. Undetected DNS tunneling (otherwise known
as DNS exfiltration) represents a significant risk to any organization.
Toronto Austin
Internet
San Francisco
Internet Edge
Call Distribution
Center
Finance
Data Center
NetFlow-
Enabled
Routers
DC Core DC Core
N9500 N9500
DC DC
Aggregation N9500 Aggregation N9500
UCS Fi UCS Fi
In this case, the credit cards were base64 encoded and sent over DNS requests (tunneling)
to cyber criminals abroad. Attackers nowadays use different DNS record types and
encoding methods to exfiltrate data from victims’ systems and networks. The following
are some examples of encoding methods:
n Base64 encoding
n NetBIOS encoding
n Hex encoding
NetFlow-
Enabled
Routers
DC Core DC Core
N9500 N9500
DC DC
Aggregation N9500 Aggregation N9500
Several utilities have been created to perform DNS tunneling (for the good and also for
the bad). The following are a few examples:
n DNScapy: Created by Pierre Bienaime, this Python-based Scapy tool for packet
generation even supports SSH tunneling over DNS, including a SOCKS proxy.
n DNScat (DNScat-B): Written by Ron Bowes, this tool runs on Linux, Mac OS X,
and Windows. DNScat encodes DNS requests in NetBIOS encoding or hex
encoding.
n Heyoka: This tool written in C supports bidirectional tunneling for data exfiltration.
n Iodine: Written by Bjorn Andersson and Erik Ekman in C, Iodine runs on Linux,
Mac OS X, and Windows, and can even be ported to Android.
n psudp: Developed by Kenton Born, this tool injects data into existing DNS requests
by modifying the IP/UDP lengths.
n Feederbot and Moto: This malware using DNS has been used by attackers to steal
sensitive information from many organizations.
Note Some of these tools were not created with the intent to steal data, but cyber criminals
have used them for their own purposes.
The retailer’s network security personnel were able to perform detailed analysis of the
techniques used by the attackers to steal this information and discovered the types
of malware and vulnerabilities being exploited in systems in the data center. Network
telemetry tools such as NetFlow are invaluable when trying to understand what is
happening (good and bad) in the network, and it is a crucial tool for incident response
and network forensics.
Retailers or any organizations that process credit cards or electronic payments are often
under regulation from the Payment Card Industry Data Security Standard (PCI DSS). PCI
DSS was created to encourage and maintain cardholder data security and expedite the
consistent use of data security methodologies. This standard enforces a baseline of tech-
nical and operational requirements. PCI DSS applies to the following:
n Banks
n Merchants
n Processors
n Acquirers
n Issuers
n Service providers or any other organization that store, process, or transmit cardholder
data (CHD) and/or sensitive authentication data (SAD)
As you can see from this list, adequate monitoring of systems is an underlying and fun-
damental requirement. NetFlow, intrusion prevention systems, and others are often used
to maintain this required visibility into what is happening in the network.
n Blueprints
n Chemical formulas
n Marketing strategies
n Manufacturing processes
n Source code
n A song
n A book
n Documentation guides
In 1996, to maintain the health and competitiveness of the U.S. economy, the United States
Congress passed the Economic Espionage Act to protect trade secrets from bad actors.
In the following case study, a mobile phone manufacturer in the United States was a
victim of intellectual property theft (also known as trade secret theft). The company has
their headquarters in San Jose, California, and a development campus in Bangalore, India.
The two sites connect over an IPsec site-to-site tunnel, as illustrated in Figure 8-11.
An attacker was able to steal many design documents and source code from this company.
He compromised internal systems in the San Jose site, and then used those systems as
stepping-stones to gain access to development resources at the campus in Bangalore over
the very same IPsec tunnel that was designed to keep all communication between San Jose
and Bangalore encrypted. Figure 8-12 illustrates the steps that the attacker followed to
compromise the user’s system in San Jose.
2 User opens
Victim the email.
Step 1. The attacker sends an e-mail to the victim. The attacker sends the e-mail “as
a reply” to make it look like a reply to an existing e-mail and not something
that was sent unsolicited. In addition, the e-mail had an HTML file attached.
The file size was only 250 bytes. This HTML file had an iFrame that will redi-
rect the user to a compromised WordPress site. The HTML file is as follows:
<html>
<head></head>
<body>
<iframe src="http://compromised-wordpress-site/resume.php"
width="1024" height="768" style="position:absolute;left:-10118px;">
</iframe>
</body>
</html>
This HTML iFrame is used to trick the user into visiting http://compromised-
wordpress-site/resume.php.
Step 2. The user opens the e-mail and the attached HTML file.
Using NetFlow for Incident Response and Forensics 261
Step 3. The user is redirected to the compromised WordPress site that was in the
iFrame of the HTML file.
Step 4. The WordPress site had a link to a Google Drive document that “appeared to
be a resume.” The user clicks the Google Drive document link and downloads
malware that is installed on his machine and used by the attacker to elevate
privileges and take control of his machine.
Once the attacker takes control of the victim’s system, it uses it to gain access to design
documents and source code from the engineering campus in Bangalore. Figure 8-13 illus-
trates the steps that the attacker followed.
5
Cloud Service
4
1 Attacker
3
Victim
Design Documents
and Source Code
Step 2. The victim is a development director who has access to design documents
and source code in the Bangalore site.
Step 3. The attacker leverages those permissions to gain access to such design
documents and source code.
Step 4. The design documents and source code are uploaded to a trusted cloud
service site.
Step 5. The attacker downloads the design documents and source code from the
cloud service site.
262 Chapter 8: Case Studies
The mobile phone company has NetFlow enabled in the router in the San Jose head-
quarters. The network security administrator notices a spike in traffic being downloaded
from the Bangalore site by the victim and also notices a lot of traffic being sent to the
cloud service site. After further investigation, the network security administrator deter-
mines that this is not normal and blocks the victim user from sending any data to the
Internet and contacts the user.
n Contractors: Internet access and access to three internal application servers is allowed.
Figure 8-14 illustrates how wireless guest users and contractors are authenticated and
allowed to the network.
CAPWAP VLAN 10
VLAN 20
802.1Q
3 Web Auth
Trunk
Internet
Guest
In Figure 8-14, contractors and guest users connect to the wireless network and are
authenticated by the Cisco Identity Services Engine (ISE). Contractors are assigned to
the contractor VLAN (VLAN 10), which allows them to connect to the three applica-
tion servers and to the Internet. The following are the steps illustrated in Figure 8-14 to
authenticate and allow guest users to connect to the Internet:
Step 4. An access control list (ACL) called GUEST ACL is also applied to prevent
them from connecting to the corporate network and to allow them to con-
nect only to the Internet.
NetFlow is configured in the Cisco Wireless LAN Controller (WLC) to monitor guest users
and contractors. The following are the high-level steps to configure NetFlow to monitor
wireless guest users and contractors in the WLC. Only the single static flow record type can
be exported from the Cisco WLC, as opposed to Flexible NetFlow in Cisco IOS devices:
The topology in Figure 8-15 is used for the example that follows. The Cisco WLC is config-
ured to export NetFlow records to a server running Elasticsearch, Logstash, and Kibana (ELK).
ISE
ELK
Contractors
Management
Network
CAPWAP
AP WLC 802.1Q Trunk
Guests
The following are the steps taken to configure NetFlow in the Cisco WLC web admin
interface:
a. Log in to the WLC and navigate to Wireless > NetFlow > Exporter, as
shown in Figure 8-16.
b. Click New to add a new exporter. Enter the exporter name, IP address, and
the port number. In this example, the exporter name is ELK-server, the IP
address is 10.10.10.88, and the port number is 9995, as shown in Figure 8-16.
264 Chapter 8: Case Studies
c. Click Apply to apply the changes, and click Save Configuration to save
the configuration. Figure 8-17 shows the configured exporter in the
Cisco WLC Exporter List screen.
a. In the web admin interface, navigate to Wireless > NetFlow > Monitor.
b. Click New and enter the monitor name, as shown in Figure 8-18.
c. On the Monitor List page, click the monitor name to open the NetFlow
Monitor > Edit page, as shown in Figure 8-19.
Step 3. Select the exporter name and the record name from the respective drop-down
lists, as shown in Figure 8-20. Only single static flow record type can be export-
ed from the Cisco WLC, as opposed to Flexible NetFlow in Cisco IOS devices.
Click Apply to apply the changes, and click Save Configuration to save the
configuration. Figure 8-21 shows the updated Monitor List page.
a. Navigate to WLANs and click the WLAN ID to open the WLANs >
Edit page.
b. On the QoS tab, choose the NetFlow monitor from the NetFlow
Monitor drop-down list, as shown in Figure 8-22.
c. Click Apply to apply the changes, and click Save Configuration to save
the configuration.
Note In this example, the WLAN IDs will be the WLANs for guest users and contractors.
If you configure multiple WLAN IDs, you need to repeat step 4 for each of the WLANs.
In the following case study, a network administrator uses NetFlow analysis to determine
his organization’s bandwidth needs to accommodate the growth over a period of time
and to decide on the changes to be implemented. In addition, he would like to identify
bandwidth bottlenecks and wasted bandwidth.
Figure 8-23 illustrates the network topology used in this case study. This is a medium-
sized enterprise with offices in San Juan, Puerto Rico. This enterprise is a video produc-
tion company. Their corporate users utilize numerous cloud-based services, in addition
to many different online tools, to produce and review their client videos.
Internet
San Juan
Internet Edge
The network administrator enables Flexible NetFlow in the distribution switches shown
in Figure 8-17 (Cisco Catalyst 4500X switches).
Example 8-2 shows the Flexible NetFlow configuration in the Cisco Catalyst 4500X
distribution switches.
The Cisco Catalyst 4500X distribution switches are configured to send NetFlow records
to a collector with the IP address 10.1.20.3.
Note The Cisco Catalyst 4500 series switches support ingress flow statistics collection
for switched and routed packets. However, they do not support Flexible NetFlow on
egress traffic.
The ip flow monitor mon1 layer2-switched input interface subcommand is used in inter-
face Gigabit Ethernet 2/1 to allow the collection of flow records even when the packet
is bridged. In the Cisco Catalyst 4500X, NetFlow is supported on multiple targets. These
targets include port, VLAN, per-port per-VLAN (Flexible NetFlow can be enabled on a
specific VLAN on a given port), and on a port-channel interface (instead of on individual
member ports).
n The volume of traffic to such cloud service providers and the impact on bandwidth
by cloud applications
In addition, rogue cloud applications, often referred to as shadow IT, can be identi-
fied by deploying NetFlow. The ease of use of public cloud services has also led to an
increase in rogue cloud applications. Many network administrators and other company
officials are often unaware of the number of cloud applications (often unauthorized
applications) that are used by their employees.
Note Cisco also provides a cloud consumption assessment service for their customers.
You can find more information about the Cisco Cloud Consumption Professional
Services at http://www.ipv6.cisco.com/web/partners/services/programs/collaborative/
downloads/datasheet_c78_729142_080513.pdf.
This new paradigm of shadow IT introduces a new set of challenges for business leaders.
These challenges include determining how to manage the costs and risks associated with
cloud adoption and how to establish effective cloud management processes.
In the following case study, a network administrator is tasked to monitor how often
users use cloud providers, specifically Amazon Web Services (AWS). The network
administrator immediately thought about using NetFlow on routers close to the Internet
edge of their network.
In this case, the company does not use Cisco Adaptive Security Appliances (ASAs), but
instead uses a third-party firewall solution. NetFlow is enabled in the routers behind the
corporate firewalls.
After the network administrator enables NetFlow in the routers, he struggles to figure
out how to monitor what traffic is destined for the AWS. Luckily, Amazon documents
all the IP address ranges that they use in all their availability zones and cloud services at
http://docs.aws.amazon.com/general/latest/gr/aws-ip-ranges.html.
Tip The IP address ranges can also be downloaded in JSON format from https://
ip-ranges.amazonaws.com/ip-ranges.json.
After further analysis, the network administrator notices that users are using cloud ser-
vices hosted in AWS 10 to 15 times more than anticipated, in terms of connections and
the amount of data being transferred. In addition, he noticed that some of these services
are even competitive services to those offered by their own company. He uses this data
to work with his InfoSec team to develop company-wide policies for cloud usage and
uses the existing NetFlow capabilities in his network to continue to monitor such usage.
Rogue cloud-based applications and services can consume a lot of bandwidth, which
in turn could result in an interruption of important business applications. The network
Summary 271
administrator also used NetFlow data to define quality of service (QoS) policies and set
priorities for several critical applications. The administrator used NetFlow data reports
with Type of Service (ToS) and DSCP fields to monitor the bandwidth usage by applica-
tion and to measure the effectiveness of the deployed QoS policies.
AWS
Internet
ISP
Routers
Firewalls
NetFlow-
Enabled
Routers
Summary
This chapter covered several case studies describing how NetFlow can be used for many
different security and nonsecurity applications. You learned how you can use NetFlow
for anomaly detection and to identify DoS attacks. Both enterprises and services provid-
ers can use NetFlow to mitigate DDoS attacks, including direct, reflected, and ampli-
fication DDoS attacks. NetFlow is also a very useful tool for incident response and
forensics. In this chapter, several case studies showed how an enterprise used NetFlow
to detect threat actors when attempting to steal credit card and other personally identifi-
able information (PII) data from its network. You also learned how another enterprise
used NetFlow to detect a sophisticated attacker who compromised internal system to
steal intellectual property and company trade secrets. Additional case studies covered
how to use NetFlow to monitor guest users and contractors, capacity planning, and
cloud usage.
This page intentionally left blank
Index
A appliances
FlowCollector, 145
ACI (Application Centric SMC (StealthWatch Management
Infrastructure) in data center, 30 Console), 147
Adaptive Security Device Manager Application Centric Infrastructure
(ASDM), 153-155 (ACI) in data center, 30
adjusting NetFlow timers in Cisco application control, 23-24
Nexus 7000 (example 6-18), 166 application recognition, 22
Ambari, 126 Application Visibility and
AMP (Advanced Malware Control (AVC). See Cisco AVC
Protection), 3 (Application Visibility and
Control)
AMP for Endpoints, 175-176
applications, Flexible NetFlow key
AMP for Networks, 176
fields, 63
AMP ThreatGRID, 176-177
applying flow monitor to interface
amplification attacks, 249-250
in Cisco Nexus 1000V, 164
anomaly detection, 8-9
Flexible NetFlow, 73
antivirus software, 174-175
applying NetFlow monitor and
Apache Flume, 119-120 sampler (example 6-20), 166
Apache Hadoop, 116-118 apt package database update
Apache HBase, 124-125 (example 4-7), 95
Apache Hive, 122-123 ASA 5500-X series, 3
Apache Kafka, 120-121 ASA 5585-X Adaptive Security
Apache Storm, 121-122 Appliances, 3
274 ASDM (Adaptive Security Device Manager)
E examples
adjusting NetFlow timers in Cisco
Nexus 7000, 166
east-to-west communication, 28
applying flow monitor to interface,
Elasticsearch, 92
73, 164
installing, 96-105
applying NetFlow monitor and sam-
in OpenSOC, 123-124 pler, 166
elasticsearch.yml configuration file apt package database update, 95
(example 4-8), 96-105
capture command, 230
ELK (Elasticsearch, Logstash and
clear logging command options in
Kibana), 80, 92-109
Cisco ASA, 193
deployment topology, 94
configuring NSEL using the CLI, 155
Elasticsearch, 92
configuring sampled NetFlow in
installing, 96-105 Cisco Nexus 7000, 166
installing, 95-96 creating IPv4 flow record with key
Kibana, 93 and non-key fields, 169
installing, 105-106 debug flow exporter and debug flow
Logstash, 92-93 monitor command output, 209
installing, 107-109 debug flow exporter command, 202
Marvel and Shield, 94 debug flow exporter command
options, 202
Nginx, installing, 106-107
debug flow record command output,
email security appliances (ESA) mod-
212
els, 177-179
debugging specific flow exporter, 203
email-based threats
defining flow collector, 170
Cisco Cloud Email Security, 179
defining flow exporter
Cisco ESA models, 177-179
in Cisco Nexus 1000V, 162
Cisco Hybrid Email Security,
179-180 in Cisco Nexus 7000 series, 165
list of, 177 in Cisco NGA, 170
enforcer, network as, 4 defining flow monitor
enterprise networks, identifying in Cisco Nexus 1000V, 163
DDoS attacks, 250-253 in Cisco NGA, 170
EP (exporting process), 16 with custom record in Cisco
ESA (email security appliances) mod- Nexus 7000, 165
els, 177-179 with original record in Cisco
Evident Software Evident Analyze, Nexus 7000, 165
75 defining flow record
exabytes, 112 in Cisco Nexus 1000V, 161
in Cisco Nexus 7000 series, 165
280 examples
defining NSEL export policy, 159 show flow command options, 236
disabling redundant syslog messages, show flow exporter command
157 output
displaying predefined flow records, in Cisco IOS and IOS XE
160 devices, 201
distribution switch Flexible NetFlow in Cisco IOS-XR software, 220
configuration, 268 in Cisco Nexus 1000V, 163
elasticsearch.yml configuration file, in Cisco NGA, 237
96-105
Flexible NetFlow, 72
Flexible NetFlow configuration, 73
show flow exporter export-ids
incorrectly configured logstash- netflow-v9 command output,
netflow.conf file, 234 208
installing NFdump in Ubuntu, 81-82 show flow exporter NX-OS
Internet-edge router Flexible command output, 215
NetFlow configuration, 251 show flow exporter option
IPFIX export format enabled, 74 application table command
logging buffer-size command in output, 209
Cisco ASA, 193 show flow exporter statistics
logging buffered command command output, 202
in Cisco ASA, 191 show flow exporter templates
command options, 207
in Cisco IOS devices, 190
show flow exporter templates
nfcapd command usage, 83 command output, 207
nfcapd daemon command options,
show flow exporter-map command
84
output in Cisco IOS-XR, 221
nfdump man pages excerpt, 86
show flow interface command
Oracle Java PPA installation, 95 output
ping command output, 203 in Cisco Nexus 1000V, 164
preventing export storms, 214 in Cisco NX-OS software, 216
processing and displaying nfcapd show flow interface GigabitEthernet
files with nfdump, 84 0/0 command output, 204
RTP-R1 Flexible NetFlow configura- show flow monitor command
tion, 195 options, 205
service timestamps command, 193 show flow monitor command output
show capture command output, 230 in Cisco IOS and IOS XE
show capture netflow-cap detail devices, 204
command output, 231 in Cisco IOS-XR software, 222
show capture netflow-cap dump in Cisco Nexus 1000V, 164
command output, 232
in Cisco NGA, 239
show flow collector command
Flexible NetFlow, 70
output, 236
firewalls 281
Visit ciscopress.com/newsletters.
Connect with Cisco Press authors and editors via Facebook and Twitter, visit
informit.com/socialconnect.
Connect, Engage, Collaborate
Knowledge Sharing
Documents
Blogs
Videos
Multi-Language Support
https://supportforums.cisco.com