BRKSEC-3172 Advanced IOS XR Security
BRKSEC-3172 Advanced IOS XR Security
BRKSEC-3172
ACHTUNG
Presentation_ID © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Public 2
Agenda
Overview
Control Plane Protection – Local Packet Transport Services (LPTS)
LPTS Overview
Configuring LPTS
Monitoring LPTS
Troubleshooting LPTS
Presentation_ID © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Public 3
Overview
Presentation_ID © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Public 4
Why are we here?
Presentation_ID © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Public 5
Router level Control, Management, and
Data Plane Attack methods
Remote attacks
Typically multiple hops away from the router
Sent to some destination IP on the device under attack
Directly connected attacks
1 hop away from device under attack
Sent to destination IP on the device under attack
Inline attacks
Some inline tool to become “man in the middle”
Requires physical access to something on the wire
Manipulation of packets or data gathering
Goal of all attacks are to compromise device resources
or redirect flows for data gathering purposes
Presentation_ID © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Public 6
Types of Attacks
Pipe Cloggers
TTL attacks
ICMP: unreachables, redirects, subnet pings
Ping of death – ping with size > 64 Kbyte
State Overflowers/Resource Hogs
Unauthorized route injection (routing protocols)
Buffer overflow – attacker has to know the specific vulnerability within
the code and protocol.
TCP SYN Flood
Unauthorized Access Gainers
Dictionary attacks
SNMP attack
Unauthorized access (Telnet, SSH, HTTPS, SNMP)
Spoofing valid protocol packets
And plenty more ways to wreak havoc
Presentation_ID © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Public 7
Control Plane Management Plane
• TTL Security – BGP, OSPF, BFD • Instance limit – Telnet, SSH, VTY
• Authentication – BGP, OSPF, ISIS, EIGRP, • Peer Filtering – HTTP, Telnet, SSH, SNMP
LDP, MSDP, RSVP • AAA – tacacs, radius
• Resource Limits – OSPF, ISIS, EIGRP, • MPP – Management Plane Protection
BGP, RIB, PIM, IGMP, MSDP
• Hardware and Software policers via LPTS
IOS XR Security at
a glance
F Distributed
RP (dRP)
A CPU
B
PIFIB Egress LC
ucode
(TCAM, dynamic) R
I
Ingress Packet Switching Engine For-us traffic such as
C L2, BFD, ARP
For-us traffic processed
ucode
by LPTS – mgmt, L3
control plane, ICMP
Transit traffic
Presentation_ID © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Public 9
Control Plane Protection
Presentation_ID © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Public 10
Local Packet Transport Services:
High-level view for protection Control Plane
Application1
Received Traffic on RP
Transit Traffic
Application1
LPTS
on RP
Forwarding Internal
Information FIB (IFIB)
Base (FIB)
Bad packets Local Stack
on LC
Presentation_ID © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Public 12
Local Packet Transport Service
LPTS implementation in Hardware
LPTS has Hardware policers on line cards to limit traffic
sent to local or remote nodes
LPTS entries in TCAM classifies packets to select a
policer to apply
The policer value can be tuned to 0 (to drop all packet
matching classification criteria)
Polices on protocol (BGP, OSPF, SSH) and flow state
(BGP established, BGP configured, and BGP listen)
Policing done on the LC Hardware ASIC before packets
hit RP/LC CPU
All filters are automatically and dynamically installed by
the IOS XR infrastructure
Presentation_ID © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Public 13
How Local Packet Transport Services
Works
Presentation_ID © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Public 14
IOS XR LPTS in action
LPTS is an automatic, built in “firewall” for
control plane traffic. Router bgp
Every Control and Management packet from neighbor 202.4.48.99
the line card is rate limited in hardware to …
ttl_security
!
protect RP and LC CPU from attacks mpls ldp
…
!
LC 1 IFIB TCAM HW Entries
Local port Remote port Rate Priority
Socket
LPTS
any 179 202.4.48.99 any 1000 medium ttl BGP
202.4.48.1 179 202.4.48.99 2223 10000 medium 255
200.200.0.2 13232 200.200.0.1 646 100 medium
LDP
SSH
LC 2 IFIB TCAM HW Entries …
Presentation_ID © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Public
TCP Handshake
15
“Receive” Packet Flow
Execute a sweep range ping
For LC CPU to a CRS-1 and you will see
packets dropping
Port 0
Presentation_ID © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Public 16
Inside the LC CPU
LC-CPU
NetIO
CPU Queues
from IngressQ
Critical High Med Low
Prio Prio Prio
Presentation_ID © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Public 17
Locally Destined Packet Flow CPU
Queues
RP CPU
Port 0
PreIFIB
SPONGE
RX PSE INGRESSQ Reass.
L3 Engine FABRICQ
SPONGE
EGRESSQ TX PSE Reass.
L3 Engine FABRICQ
Control packet path
Presentation_ID © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Public 18
Inside RP-CPU
RP-CPU
NetIO
CPU Queues
from FabricQ
Presentation_ID © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Public 19
LPTS data structures
Presentation_ID © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Public 20
LPTS PIFIB Key Fields
show lpts pifib
RP/0/RP0/CPU0:RTPTME-CRS#
hardware entry location 0/0/CPU0
Sample LPTS Entry ----------------------------------------
V - Vital; M - Fabric Multicast;
C - Moose Congestion Flag; L - Listener Tag; T -
Min TTL;
F - Flow Type;
DestNode - Destination Node;
L4 Protocol : TCP DestAddr - Destination Fabric Address;
VRF ID : default Sq - Ingress Shaping Queue; Dq - Destination Queue;
Po - Policer; Ct - Stats Counter;
Source IP : 10.8.8.5 Lp - Lookup priority; Sp - Storage Priority;
Port/Type : Port:28043 Ar - Average rate limit; Bu - Burst;
Source Port : 179 HAr - Hardware Average rate limit; HBu - Hardware
Burst;
Is Fragment : 0 Rsp - Relative sorting position;
Is SYN : any Rtp - Relative TCAM position;
Interface : any na - Not Applicable or Not Available
V/M/C/L/T/F : 1/0/1/IPv4_STACK/0/BGP-known
DestNode : 0/RP0/CPU0
DestAddr : 30
Sq/Dq/Ct : 24/6/0x7ff60
Accepted/Dropped : 6305/0
Lp/Sp : 1/255
# of TCAM entries : 1
Po/Ar/Bu : 113/25000pps/100ms
HPo/HAr/HBu : 113/25000pps/100ms
State : Entry in TCAM
Rsp/Rtp : 35/35
Presentation_ID © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Public 21
LPTS PIFIB Lookup Results
show lpts pifib hardware
RP/0/RP0/CPU0:RTPTME-CRS#
entry location 0/0/CPU0
Sample LPTS Entry ----------------------------------------
V - Vital; M - Fabric Multicast;
C - Moose Congestion Flag; L - Listener Tag; T - Min TTL;
F - Flow Type;
DestNode - Destination Node;
DestAddr - Destination Fabric Address;
L4 Protocol : TCP Sq - Ingress Shaping Queue; Dq - Destination Queue;
VRF ID : default Po - Policer; Ct - Stats Counter;
Source IP : 10.8.8.5 Lp - Lookup priority; Sp - Storage Priority;
Port/Type : Port:28043 Ar - Average rate limit; Bu - Burst;
Source Port : 179 HAr - Hardware Average rate limit; HBu - Hardware Burst;
Is Fragment : 0 Rsp - Relative sorting position;
Is SYN : any Rtp - Relative TCAM position;
Interface : any na - Not Applicable or Not Available
V/M/C/L/T/F : 1/0/1/IPv4_STACK/0/BGP-known
DestNode : 0/RP0/CPU0
DestAddr : 30
Sq/Dq/Ct : 24/6/0x7ff60
Accepted/Dropped : 6305/0
Lp/Sp : 1/255
# of TCAM entries : 1
Po/Ar/Bu : 113/25000pps/100ms
HPo/HAr/HBu : 113/25000pps/100ms
State : Entry in TCAM
Rsp/Rtp : 35/35
Presentation_ID © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Public 22
LPTS Software Entries (summary view)
RP/0/RP0/CPU0:CRS1-4#show lpts pifib brief location 0/7/CPU0
* - Any VRF; I - Local Interest;
X - Drop; R - Reassemble;
L4 Protocol : -
Destination IP : any
Source IP : any
Port/Type : any
Source Port : any
Is Fragment : 0
Is SYN : any
Interface : TenGigE0/0/0/1 (0x1080040)/3
V/M/C/L/T/F : 1/0/1/CLNS_STACK/0/ISIS-known
DestNode : 0/2/CPU0
DestAddr : 8
Sq/Dq/Ct : 24/6/0x7ffac
Accepted/Dropped : 0/0
Lp/Sp : 0/255
# of TCAM entries : 1
Po/Ar/Bu : 108/20000pps/100ms
HPo/HAr/HBu : 108/20000pps/100ms
State : Entry in TCAM
Rsp/Rtp : 0/0
Presentation_ID © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Public 25
Configuring Local Packet Transport
Services
Presentation_ID © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Public 26
LPTS policers are configurable globally
or per linecard from 3.5.1 and up
Users can set rate values for each type of traffic
lpts pifib hardware police
flow fragment rate 0
flow bgp default rate 0
Presentation_ID © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Public 29
Monitoring Local Packet Transport
Services
Presentation_ID © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Public 30
Monitoring methods for LPTS
Presentation_ID © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Public 31
Troubleshooting Local Packet Transport
Services
Presentation_ID © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Public 32
Verifying table entries and counters
Verify the bindings
show lpts binding brief - Individual client requests
show lpts clients - Is there a client for every node configured for traffic?
show lpts flows brief - Arbitrated, resolved requests turned into flows for ifib.
Verify the lpts entries in RP netio
sh lpts ifib slices all - Useful if slice location migrates due to extra RP/DRP
resources.
sh lpts ifib entry brief - Verify final software fib entry.
sh lpts ifib statistics location r/s/m – Valid only on RPs and DRPs*.
Verify the linecard pifib software and hardware entries
==pre-ifib in LC/RP (Netio)==
sh lpts pifib entry brief location r/s/m – Summary view
sh lpts pifib entry location r/s/m – Gives software stats.
==TCAM in LC Only==
sh lpts pifib hardware entry brief location r/s/m – Summary view
sh lpts pifib hardware entry statistics location r/s/m -- Counters
sh lpts pifib hardware usage location r/sm – TCAM resource utilization
sh lpts pifib hardware police location r/sm – Policer values
Presentation_ID © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Public 33
LPTS Debugs
debug lpts packet location <r/s/m>
On LC, shows LC CPU activity only (not PSE)
On RP/DRP, shows secondary look-ups and packet delivery
One message per layer per packet.
Presentation_ID © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Public 34
“debug lpts packet” example
RP/0/0/CPU0:Jul 16 18:12:19.035 : netio[64]: lpts ifib
[0xda3159b4/104 if 0x02000400 IP4 10.0.2.1 -> 10.0.2.2
ICMP 0 0] to local stack
RP/0/0/CPU0:Jul 16 18:12:28.294 : netio[64]: lpts decaps
[0xda314bb4/4474 if 0x02000400 CLNS] to local stack
RP/0/0/CPU0:Jul 16 18:12:28.697 : netio[64]: lpts decaps
[0xda3159b4/32 if 0x02000400 IP4 10.0.2.1 -> 224.0.1.9
IGMP 22 0] to local stack
RP/0/0/CPU0:Jul 16 18:12:29.898 : netio[64]: lpts pifib
[0xda3159b4/62 Mg0/0/CPU0/0 IP4 10.91.36.2.1985 ->
224.0.0.2.1985 UDP] to local MCAST4_FM
RP/0/0/CPU0:Jul 16 18:12:29.899 : netio[64]: lpts ifib
[0xda3159b4/62 Mg0/0/CPU0/0 IP4 10.91.36.2.1985 ->
224.0.0.2.1985 UDP] no matching entry in MCAST4_FM slice,
dropping
Presentation_ID © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Public 35
LPTS always on debugs
Traces
Global Traces
show lpts trace global
Captures process starts, slice assignments, dependencies
Per-Process Traces
show lpts trace {pa | fm | ff | platf}
Transactions, errors, and platform-specific information.
Presentation_ID © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Public 36
LPTS Demo – impact on CPU Utilization
ATTAAAA
AAAAAA
AAAACK!
l33t Hax0rs
(played by Agilent)
CRS
Presentation_ID © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Public 37
Data Plane Protection Methods
Presentation_ID © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Public 38
Data Plane Exceptions
“Receive” traffic not processed by LPTS
Type Policer Queue Most traffic directly processed by
(pps) priority LC CPU is handled by LC
CDP 1000 High microcode without LPTS (no
ARP 1000 High dynamic state)
L2 control 1000 Critical Different priority queues towards
the CPU
IPv4 options 2500 Medium
Presentation_ID © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Public 40
Data Plane protection with ACLs
Presentation_ID © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Public 42
Management Plane Protection
Presentation_ID © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Public 43
MPP Overview
Management Protocols are secured at various levels
By default Management
protocols are off if MPP is
configured
Presentation_ID © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Public 44
MPP Overview
Presentation_ID © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Public 45
How Management Plane Protection
Works
Presentation_ID © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Public 46
IOS XR behavior before MPP Management Traffic
Transit Traffic
NOC
Management Services are
off by default DCN
When management
services are enabled, they
are enabled on all
interfaces I/F 1
I/F 2
Presentation_ID © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Public 47
IOS XR with In-band MPP Management Traffic
Transit Traffic
NOC
I/F 1 is configured as MPP
in-band interface. I/F 1 is DCN
also part of global IP/MPLS
routing/forwarding.
In-band MPP
Management traffic to RP
from all non-MPP I/F 1
interfaces is dropped (I/F 2
and I/F 3). LPTS
Out-of-band
RP Eth/Console/Aux R I
continues to operate as P RP /
dedicated out-of-band. CPU F
E
MPP integrates with LPTS 3
t
to provide HW-based h
filtering!
I/F 2
Presentation_ID © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Public 48
MPP In-band Support
Presentation_ID © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Public 49
IOS XR with out-of-band MPP Management Traffic
Transit Traffic
Presentation_ID © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Public 51
Restrictions
Presentation_ID © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Public 52
Management Plane Protection
Configuration
Presentation_ID © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Public 53
Before Configuring MPP
Presentation_ID © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Public 54
MPP In-band Configuration Tasks
Presentation_ID © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Public 55
Sample Config - 1
RP/0/RP1/CPU0:akki#show running-config | inc (ssh|snmp)
ssh server
snmp-server community PUBLIC SystemOwner Protocols
RP/0/RP1/CPU0:akki#show running-config control-plane Enabled
control-plane
management-plane
inband In-band
interface GigabitEthernet0/2/0/1 Interface
allow SSH
allow SNMP peer
address ipv4 1.1.1.1 All Peers
address ipv4 192.168.0.0/16 allowed for SSH
address ipv6 2000:21:1:1::1
address ipv6 2000:20::/64
Peer Filtering
for SNMP
Presentation_ID © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Public 56
MPP Out-of-band Configuration Tasks
Presentation_ID © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Public 57
Sample Config
Presentation_ID © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Public 58
Sample Config (contd..)
Presentation_ID © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Public 59
Troubleshooting Management Plane
Protection (MPP)
Presentation_ID © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Public 60
Troubleshooting MPP -- LPTS
RP/0/RP0/CPU0:CRS1-4#show lpts bindings brief | i (any.23 )
0/RP0/CPU0 TCP LR IPV4 TCP default any.23 any Mg0/RP0/CPU0/0
0/RP0/CPU0 TCP LR IPV4 TCP default any.23 any Gi0/7/1/0
0/RP0/CPU0 TCP LR IPV4 TCP default any.23 3.3.3.3 Gi0/7/1/3
0/RP0/CPU0 TCP LR IPV4 TCP default any.23 5.5.5.0/28 Gi0/7/1/3
RP/0/RP0/CPU0:CRS1-4#
RP/0/RP0/CPU0:CRS1-4#show lpts bindings brief | i (any.161 )
0/RP0/CPU0 UDP LR IPV4 UDP default any.161 any Mg0/RP0/CPU0/0
0/RP0/CPU0 UDP LR IPV4 UDP default any.161 any Lo87
RP/0/RP0/CPU0:CRS1-4#
RP/0/RP0/CPU0:CRS1-4#show lpts bindings brief | i (any.22 )
control-plane
management-plane
inband
interface Loopback87
allow SNMP
!
interface GigabitEthernet0/7/1/0
allow SSH
allow Telnet
!
interface GigabitEthernet0/7/1/3
allow Telnet peer
address ipv4 3.3.3.3
address ipv4 5.5.5.0/28
!
!
Presentation_ID © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Public 61
Troubleshooting MPP -- LPTS
RP/0/RP0/CPU0:CRS1-4#show lpts pifib hardware entry bri location 0/7/cpu0 | i (.23 )
(def).23 3.3.3.3 TCP GigabitEthernet0/7/1/3 0/RP0/CPU0 24
7
(def).23 5.5.5.0/28 TCP GigabitEthernet0/7/1/3 0/RP0/CPU0 24
7
(def).23 any TCP GigabitEthernet0/7/1/0 0/RP0/CPU0 24
7
(def).23 10.10.20.100.33732 TCP any 0/RP0/CPU0 24 6
(def).23 10.10.20.100.53964 TCP any 0/RP0/CPU0 24 6
RP/0/RP0/CPU0:CRS1-4#
RP/0/RP0/CPU0:CRS1-4#
RP/0/RP0/CPU0:CRS1-4#show lpts pifib hardware entry bri location 0/0/cpu0 | i (.23 )
(def).23 10.10.20.100.33732 TCP any 0/RP0/CPU0 24 6
(def).23 10.10.20.100.53964 TCP any 0/RP0/CPU0 24 6
RP/0/RP0/CPU0:CRS1-4#
control-plane
management-plane
inband
interface Loopback87
allow SNMP
!
interface GigabitEthernet0/7/1/0
allow SSH
allow Telnet
!
interface GigabitEthernet0/7/1/3
allow Telnet peer
address ipv4 3.3.3.3
address ipv4 5.5.5.0/28
Presentation_ID © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Public 62
MPP show commands
Presentation_ID © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Public 63
MPP debug commands
Presentation_ID © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Public 64
Monitoring commands
Presentation_ID © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Public 65
Summary – IOS XR Security FTW!
Presentation_ID © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Public 66
Complete Your Online
Session Evaluation
Presentation_ID © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Public 67
Enter to Win a 12-Book Library
of Your Choice from Cisco Press
Presentation_ID © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Public 68
Presentation_ID © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Public 69
Glossary
FIB: Forwarding Information Base
RIB: Routing Information Base
RP: Route Processor
dRP: Distributed Route Processor
LC: Line Card
LPTS: Local Packet Transport Service
MPP: Management Plane Protection
CoPP: Control Plane Protection
PSE: Packet Switching Engine
IngressQ: Input queuing chip on LCs
FabricQ: Output fabric queuing chip on LCs
Presentation_ID © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Public 70