ASA Firewalldesign
ASA Firewalldesign
ASA Firewalldesign
Deployment
Bancha Sae-Lao
MFEC Public Co.,Ltd.
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 1
Session Objectives
At the end of the session, you should have:
§ Knowledge of common firewall deployment scenarios
including firewall virtualization and High Availability
§ A better understanding of how logging and packet
capture can help profile network protocols and their
behaviors
§ General knowledge of Application Inspection in the
firewall and how it can be used for advanced protocol
filtering
§ “Best Practice” suggestions for optimizing your firewall
deployment
§ Note: this session will NOT cover IOS Firewall
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 2
Agenda
§ Introduction
§ Firewall Deployment Modes
§ Access Control
§ High Availability Features
§ Understanding NAT
§ Logging and the Firewall
§ Application Inspection
§ ASA 5580 and the FWSM
§ New Features in 8.3
§Q&A
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 3
Cisco Firewall Basics
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 4
What is Firewall?
§ A firewall is a security device which is configured to permit, deny or
proxy data connections set by the organization's security policy.
Firewalls can either be hardware or software based
§ A firewall's basic task is to control traffic between computer
networks with different zones of trust
§ Today’s firewalls combine multilayer stateful packet inspection and
multiprotocol application inspection
§ Modern firewalls have evolved by providing additional services
such as VPN, IDS/IPS, and URL filtering
§ Despite these enhancements, the primary role of the firewall is to
enforce security policy
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 6
Cisco Firewall – What is It?
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 7
Firewall Design
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 8
Simple Internet Firewall Design
Two interfaces: trusted and untrusted
Internet
Trusted Network
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 9
Internet Firewall with DMZ
A perimeter network or DMZ (De-
Militarized Zone) is a common design
element used to add an additional
interface to a Firewall
Internet Server
Internet DMZ
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 10
Internet Firewall with Multi DMZ
Adding more than one DMZ allows Internet Server
enforcement of different policies
DMZ (Out)
Internet
DMZ (In)
Complexity of packet
Intranet
flow increases
significantly as more
DMZ interfaces are VPN Server
added
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 11
Dual Firewall Design
Internet
Intranet
§ Each firewall is configured for a
specific purpose (inbound vs
outbound connections)
§ Often deployed at trust boundaries
§ Logging from each firewall might be
useful for forensics
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 12
Cisco Firewall
Deployment Modes
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 13
Firewall Design – Modes of Operation
domains
§ Often a NAT
boundary
10.1.1.1
§ Policy is applied to
flows as the transit
10.1.1.0 /24
the firewall
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 15
Firewall – Transparent Mode
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 16
How Does Transparent Mode Work?
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 17
Firewall Transparent Mode Requirements
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 18
Firewall – Transparent (L2) Mode
firewall transparent
10.1.1.0 /24 - vlan 10
hostname ciscoasa
!
interface GigabitEthernet0/0
nameif outside
Management IP
security-level 0
10.1.1.100
!
interface GigabitEthernet0/1
nameif inside
security-level 100
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 19
Why Deploy Transparent Mode?
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 20
Firewall Design - Virtualization
§ Virtualization provides a way to create
multiple firewalls in the same physical
chassis
§ Maximum number of virtual firewalls is 50
for the ASA and 250 for the FWSM (not
supported on ASA 5505)
§ Virtualization is a licensed
feature
§ Commonly used to apply
unique security policies in
one physical chassis
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 21
Virtual Firewalls
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 22
Virtual Firewall on ASA and FWSM
§ Context = a virtual firewall
§ All virtualized firewalls must define a System context and an Admin
context at a minimum
Virtual Firewall
Vfw A
Admin context:
context: contexts
Remote root access
and access to all Vfw B
contexts
Vfw C
System context:
context:
Physical ports assigned
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 24
Unsupported Features with Virtualization
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 25
Firewall Design -- Mixed Mode
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 26
Firewall Access Control
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 27
Firewall Security Levels
§ A security level is a number between 0 and 100 that
determines how firewall rules are processed for the
data plane
§ Security levels are tied to an interface: the inside or
private side interface is always 100 (most trusted) and
the outside or public interface is always 0 (least trusted)
§ DMZ interfaces, if used, may be assigned numbers
between 1 and 99
§ Traffic on the ASA is allowed by default from a higher
security level interface to a lower security level interface
§ An ACL must explicitly permit traffic from a lower
security level interface to a higher (e.g. outside to in)
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 28
Access Control Lists
Type Description
Standard Used for routing protocols, not firewall rules
Extended Source/destination port and protocol
Ethertype Used with transparent mode
Webtype Used for clientless SSL VPN
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 30
ACL New Features (8.3)
§ Older versions of PIX code 6.x and earlier had issues with
exceptionally large ACL entries (100k+)
§ With the release of 7.0.x and 8.0.x code ACL processing
was vastly improved to create an consistent performance
response regardless of ACL size
§ In 8.3 ACLs timestamps were modified to include the last
time an ACL was hit, instead of just the more generic “hit-
count”
§ Fourth hash is the timestamp in UNIX Epoch format
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 31
ACL New Features (8.3) - Continued
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 32
Object Groups Simplify Configurations
(config)# object-group network ADMINS § Object groups allow
(config-protocol)# description Administrator grouping of similar
Addresses
(config-protocol)# network-object host 10.1.1.4
items for easing
(config-protocol)# network-object host 10.1.1.78 configuration and
(config-protocol)# network-object host 10.1.1.34 operational
maintenance of the
(config)# object-group service RAD-GROUP udp ASA firewall
(config-service)# description RADIUS Group
(config-service)# port-object eq radius
§ Can be grouped by
(config-service)# port-object eq radius-acct protocol, network or
service
§ Can be nested for more
granular configuration
options
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 33
ASA 8.3 Global Policies
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 34
Understanding NAT
Network Address Translation
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 35
Understanding Network Address
Translation (NAT) and the Firewall
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 36
NAT Control
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 37
Dynamic NAT
NAT Pool
10.1.1.x translates into 172.16.1.x
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 38
Port Address Translation (PAT)
10.1.1.x /24
172.16.1.100:1025
172.16.1.100:1026
172.16.1.100:1027
…
172.16.1.100:2800
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 39
Static NAT
10.1.1.1 172.16.1.1
NAT Pool
Web Server 10.1.1.1 to 172.16.1.1
10.1.1.1
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 40
Static PAT
10.1.1.x
172.16.1.100:80
172.16.1.100:22
172.16.1.100:25
Web Server 10.1.1.1
SSH 10.1.1.2
SMTP 10.1.1.3
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 41
Three Options for Bypassing NAT
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 42
Policy NAT
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 43
Configuring NAT
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 44
Pre 8.3 NAT Best Practices
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 45
NAT Redesign in ASA 8.3
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 46
NAT Order of Operation
§ NAT rules are applied via top down order with first match
§ Rules are processed in the following order:
1. Manual NAT rules
2. Object-based NAT rules
3. Manual (twice) NAT rules (translating both source and dest)
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 47
ASA 8.3 Unified NAT Table
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 48
Firewall High Availability
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 49
HA Feature – Interface Redundancy
interface Redundant1
§ Up to 8 redundant interface member-interface GigabitEthernet0/2
pairs are allowed. member-interface GigabitEthernet0/1
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 50
HA with Interface Redundancy
Before… After with redundant interface
Primary Backup
FW Failover
FW Failover
State
State
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 51
Caveats of Interface-level Redundancy
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 52
HA Feature – Route Tracking
§ Method for tracking the availability of static routes with the
ability to install a backup route should the primary route fail
§ Commonly used for static default routes, often in a dual
ISP environment
§ Uses ICMP echo replies to monitor the availability of a
target host, usually the next hop gateway
§ Can only be used in single routed mode
asa(config)# sla monitor 123
asa(config-sla-monitor)# type echo protocol ipIcmpEcho 10.1.1.1 interface outside
asa(config-sla-monitor-echo)# frequency 3
asa(config)# sla monitor 123 life forever start-time now
asa(config)# track 1 rtr 123 reachability
asa(config)# route outside 0.0.0.0 0.0.0.0 10.1.1.1 track 1
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 53
Firewall HA - Active/Standby
§ Supported on all models including ASA 5505**
§ Requires an additional “Plus” license (5505 and 5510 only)
§ ASA only supports LAN Based failover (no serial cable).
§ Both platforms must be identical in software, licensing, memory and
interfaces (including SSM modules)
§ Same mode (i.e. routed or transparent)
§ Not recommended to share the state and failover link, use a dedicated
link for each
§ Preferably these cables will be connected into the same switch with no
hosts
Primary Backup
ASA
Failover ASA
State
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 54
How Failover Works
§ Failover link passes Hellos between active and standby
units every 15 seconds (tunable from 3-15 seconds)
§ After three missed hellos, primary unit sends hellos
over all interfaces to check health of its peer
§ Whether a failover occurs depends on the responses
received
§ Interfaces can be prioritized by specifically monitoring
them for responses
§ If the failed interface threshold is reached then a
failover occurs
§ For more details refer to the Configuration Guide:
http://www.cisco.com/en/US/docs/security/asa/asa82/configuration/guide/ha_overvi
ew.html
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 55
What does Stateful Failover Mean?
State Info Passed to Standby Things NOT Passed to Standby
NAT Translation Table User authentication table
TCP connection states Routing table information **
UDP connection states State information for SSMs (IPS etc.)
ARP Table DHCP Server Leases
L2 Bridge Table (Transparent Mode) Stateful failover for phone proxy
HTTP State *
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 57
Firewall HA – Transparent Mode
§ Transparent Firewall can
run in A/S or A/A mode
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 58
A/S Failover in Transparent Mode
§ Mandatory that no loops in network topology
§ Switches connected to HA firewalls should be
configured for STP, understand the implications
§ Use RPVST (802.1w) and Port Fast feature on
switches where possible
§ No BPDU Guard or Loop Guard on ports connecting to
firewalls
§ Use caution if deploying transparent firewalls in
Active/Active mode because BPDUs are forwarded by
default
§ TAC Podcast on Transparent Firewall:
http://www.cisco.com/en/US/solutions/ns170/tac/security_tac_podcasts.html
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 59
Firewall HA: Active/Active Failover
§ Supported on all
platforms except the
5505
§ Requires an additional
“Plus” license (5510
only)
§ Requires virtualization
which requires additional
licensing
VFW-1 VFW-4 VFW-2 VFW-3
Active Standby Standby Active § Virtualization does not
support VPN, multicast
or routing protocols
Red = Virtual Pair 1 § No load-balancing or
Blue= Virtual Pair 2 load-sharing support
today
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 60
Firewall HA: A/A Failover with Asymmetric
Routing support
§ ASR mode adds support for asymmetric traffic flows through
an A/A system
WWW § A/A ASR is enabled by adding multiple A/A units to the same
ASR Group
X
VFW-1 VFW-4 VFW-2 VFW-3
Active Standby Standby Active
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 61
Limitations of Active/Active Failover
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 63
Best Practice #1:
Know your network and the traffic in it
Source:
www.sans.org/resources/top5_logreports.pdf
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 64
Overview: Logging with Syslog
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 65
ASA Event Format
Severity Codes
§ Severity codes are combined
(0 – 7) with facility codes to generate a
message priority
• 0 - Emergency § Syslog server uses these facility
• 1 - Alert codes to organize event
• 2 - Critical messages as they arrive
• 3 - Error
§ Eight logging facilities are
• 4 - Warning
available (local0 – local8)
• 5 - Notice
• 6 – Informational § Local4 (20) is the default for all
• 7 - Debug
PIX/ASA and FWSM events
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 67
Logging Levels and Events
Log
Alert Event Messages
Level
0 Emergencies Not used, only for RFC compliance
1 Alerts Mostly failover-related events
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 69
Logging to an External Syslog Server
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 70
Best Practice #2: Log to Buffered Memory
for shorter duration tuning/troubleshooting
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 72
Buffered Logging Configuration in ASDM
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 73
Logging to ASDM Real Time Viewer
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 74
ASDM Syslog Viewer “Show Rule”
§ Choosing this in the ASDM Log Viewer will then highlight the appropriate
rule on the ASDM Security Policy page
§ This only works for syslog ids 106100 and 106023, any other syslog will
result in an error message
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 75
Best Practice #3: Egress Filtering + Log
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 76
Active and Passive Egress Filtering
Actively denying all unspecified traffic:
asa(config)# access-list ACTIVE_FILTER extended [permit
some traffic here] <log> interval 300
...
asa(config)# access-list ACTIVE_FILTER extended deny ip
any any log interval 300
asa(config)# access-group ACTIVE_FILTER in interface
inside
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 77
Best Practice #4: Log to Syslog server(s)
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 79
Log Analysis
The HACME Office
Case Study
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 80
Case Study: The HACME Remote Office
• Remotely monitored
small remote office ?
• Default outbound policy; xx.77.67.190
no egress filtering Outside
192.168.1.201
Internet ASA
…
192.168.1.1
Inside
• Complaints of suspicious
activity sourced from asa(config)# logging enable
show us general
traffic/protocol patterns
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 81
Log Analysis is Critical
§ Logging is a security analyst’s best friend
§ Understanding how to read and interpret log data is
critical for traffic analysis and forensics
§ You can’t analyze what you don’t capture
§ Automated tools and scripts make trending and pattern
matching much easier
§ Does your SECOPS staff understand how to interpret
log data?
§ Let’s begin the interactive portion of the session….
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 82
A Typical Firewall Log File
%ASA-6-106100: access-list inside_access_in permitted udp inside/192.168.1.200(1047) -> outside/24.25.5.150(53) hit-cnt
1 first hit [0xa925365e, 0x0]
%ASA-6-302015: Built outbound UDP connection 3601 for outside:24.25.5.150/53 (24.25.5.150/53) to
inside:192.168.1.200/1047 (xx.77.67.190/1619)
%ASA-6-302016: Teardown UDP connection 3601 for outside:24.25.5.150/53 to inside:192.168.1.200/1047 duration 0:00:00
bytes 147
%ASA-6-106100: access-list inside_access_in permitted udp inside/192.168.1.200(1563) -> outside/10.16.151.94(1029) hit-
cnt 1 first hit [0xa925365e, 0x0]
%ASA-6-305011: Built dynamic UDP translation from inside:192.168.1.200/1563 to outside:xx.77.67.190/1644
%ASA-6-302015: Built outbound UDP connection 3602 for outside:10.16.151.94/1029 (10.16.151.94/1029) to
inside:192.168.1.200/1563 (xx.77.67.190/1644)
%ASA-6-302016: Teardown UDP connection 3544 for outside:171.68.10.143/1029 to inside:192.168.1.200/1530 duration 0:02:02
bytes 0
%ASA-6-305012: Teardown dynamic TCP translation from inside:192.168.1.200/1558 to outside:xx.77.67.190/2470 duration
0:00:30
%ASA-6-106100: access-list inside_access_in permitted udp inside/192.168.1.200(1563) -> outside/171.70.156.234(1029)
hit-cnt 1 first hit [0xa925365e, 0x0]
%ASA-6-302015: Built outbound UDP connection 3603 for outside:171.70.156.234/1029 (171.70.156.234/1029) to
inside:192.168.1.200/1563 (xx.77.67.190/1644)
%ASA-6-305012: Teardown dynamic UDP translation from inside:192.168.1.200/1520 to outside:xx.77.67.190/1638 duration
0:02:35
%ASA-6-302016: Teardown UDP connection 3545 for outside:171.70.156.234/1029 to inside:192.168.1.200/1530 duration
0:02:04 bytes 0
%ASA-6-106100: access-list inside_access_in permitted tcp inside/192.168.1.200(1564) -> outside/171.70.156.234(1029)
hit-cnt 1 first hit [0xa925365e, 0x0]
%ASA-6-305011: Built dynamic TCP translation from inside:192.168.1.200/1564 to outside:xx.77.67.190/2475
%ASA-6-302013: Built outbound TCP connection 3604 for outside:171.70.156.234/1029 (171.70.156.234/1029) to
inside:192.168.1.200/1564 (xx.77.67.190/2475)
%ASA-6-302014: Teardown TCP connection 3596 for outside:171.70.156.234/1029 to inside:192.168.1.200/1559 duration
0:00:30 bytes 0 SYN Timeout
%ASA-6-305012: Teardown dynamic TCP translation from inside:192.168.1.200/1549 to outside:xx.77.67.190/2462 duration
0:01:00
%ASA-6-305012: Teardown dynamic TCP translation from inside:192.168.1.200/1562 to outside:xx.77.67.190/2474 duration
0:00:30
%ASA-6-106100: access-list inside_access_in permitted udp inside/192.168.1.200(1047) -> outside/24.25.5.150(53) hit-cnt
1 first hit [0xa925365e, 0x0]
%ASA-6-302015: Built outbound UDP connection 3605 for outside:24.25.5.150/53 (24.25.5.150/53) to
inside:192.168.1.200/1047 (xx.77.67.190/1619)
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 83
Best Practice #5: Use Logging Filters
asa(config)# sh logging | ?
begin Begin with the line that matches
exclude Exclude lines that match
grep Include/exclude lines that match
include Include lines that match
asa(config)# sh logging | grep ?
-v Exclude lines that match
LINE Regular Expression
To see events generated by host 192.168.1.201
show logging | grep 192.168.1.201
NOTE: Verify there are no trailing spaces after host ip address
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 84
HACME Office Sample Log #1
asa(config)# sh logging | grep 192.168.1.201 !truncated
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 85
HACME Office Sample Log #2
asa(config)# sh logging | grep 192.168.1.201 !truncated
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 86
HACME Office Sample Log #3
asa(config)# sh logging | grep 192.168.1.201 !truncated
%ASA-6-302013: Built outbound TCP connection 1373 for
outside:198.133.219.25/80 (198.133.219.25/80) to
inside:192.168.1.201/1353 (xx.77.67.190/1630)
%ASA-6-302013: Built outbound TCP connection 1374 for
outside:198.133.219.25/80 (198.133.219.25/80) to
inside:192.168.1.201/1354 (xx.77.67.190/1631)
%ASA-5-304001: 192.168.1.201 Accessed URL
198.133.219.25:/swa/j/zag2_vs_log1.asc?Log=1&title=Cisco%2
0Systems,%20Inc&basepage=http://www.cisco.com/&cb=11769134
19359
%ASA-6-302014: Teardown TCP connection 1374 for
outside:198.133.219.25/80 to inside:192.168.1.201/1354
duration 0:00:00 bytes 1023 TCP FINs
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 87
HACME Office Sample Log #4
%ASA-6-302015: Built outbound UDP connection 6203 for
outside:24.25.5.150/53 (24.25.5.150/53) to
inside:192.168.1.201/1025 (xx.77.67.190/1990)
%ASA-6-305011: Built dynamic TCP translation from
inside:192.168.1.201/2224 to outside:xx.77.67.190/3241
%ASA-6-302013: Built outbound TCP connection 6204 for
outside:83.140.172.211/6667 (83.140.172.211/6667) to
inside:192.168.1.201/2224 (xx.77.67.190/3241)
%ASA-6-305011: Built dynamic UDP translation from
inside:192.168.1.201/2225 to outside:xx.77.67.190/2004
%ASA-6-302015: Built outbound UDP connection 6206 for
outside:10.16.151.86/1029 (10.16.151.86/1029) to
inside:192.168.1.201/2225 (xx.77.67.190/2004)
%ASA-6-302013: Built outbound TCP connection 6207 for
outside:83.140.172.211/6667 (83.140.172.211/6667) to
inside:192.168.1.201/2224 (xx.77.67.190/3241)
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 88
What runs on TCP 6667?
Source: http://isc.sans.org/port.html?port=6667
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 89
Log File After Egress Filtering Enabled
asa(config)# sh logging | grep 192.168.1.201 !truncated
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 90
Whose web site is that?
C:\Documents and Settings\ nslookup 66.151.158.177
Server: dns-133-lb-01.some.dns.com
Address: 172.16.1.14
Name: poll.gotomypc.com
Address: 66.151.158.177
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 91
Application Inspection
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 92
Modular Policy Framework (MPF)
PIX 6.3
Rules
Inside Outside
Prior to 7.x All of My Flows Were Treated Pretty Much the Same
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 94
Code Red v1
§ Compromised Windows IIS web servers via buffer overflow in the
indexing service
§ Advisory released on June 18th, worm released July 12th, 2001
§ 359K+ machines infected in the first 14 hours, with 2K per minute
new infections at its peak
§ Exploit string of Code Red v1:
GET
/default.IDA?NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
NNNNNNNNNNNNNNNNN%u9090%u6858%ucbd3%u7801%u9090%
u6858%ucbd3%u7801%u9090%u6858%ucbd3%u7801%u9090%u909
0%u8190%u00c3%u0003%u8b00%u531b%u53ff%u0078%u0000%u0
0=a HTTP/1.0
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 98
Code Red I and II URI Filtering
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 99
The Evil Continues: Nimda
§ September 18, 2001 over
1M hosts infected in 24
hours
§ Multi-vector worm looking for
any of several MSFT
vulnerabilities (MIME, HTTP,
etc.)
IIS Webserver Unicode Directory Traversal:
GET /scripts/..%c1%9c../winnt/system32/cmd.exe?/c+dir
GET /scripts/..%5c../winnt/system32/cmd.exe?/c+dir
§ Mitigate in firewall by dropping any HTTP request that
contains Non-ASCII headers
asa(config)# match request header non-ascii
drop-connection log
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 100
HACME Case Study
Continuing with Application
Inspection
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 101
HACME Remote Office Part 2
• After implementing
egress filtering, we
noticed some interesting
activity with host ?
192.168.1.201 talking xx.77.67.190
via tcp/80 to outside (0)
Go2myPC.com 192.168.1.201
Internet
…
192.168.1.1
• Use the advanced
HTTP inspection engine Inside (100)
to implement a policy
that blocks users from
using that service, while
allowing access to 192.168.1.212
tcp/80 for allowed traffic
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 102
Case Study Part 2: Blocking Go2myPC
§ Go2myPC uses tcp/8200 by default. If this is not available, the
application will fall back to tcp/80 and tcp/443
§ Option #1: Block and log all traffic types to domain name or ip
address
Not the best solution as this may not be possible in all contexts
§ Option #2: Block and log tcp/8200 globally, and inspect all HTTP
requests from 192.168.1.201
Not a perfect solution, but let’s use the regex capabilities of the
HTTP inspection engine
§ We must understand the application that we’re attempting to filter,
so we need to find a string that fingerprints the application
§ The capture capability of the ASA is an excellent tool for this
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 103
Firewall Capture for Application Profiling
access-list HOSTCHECK extended permit ip host 192.168.1.201 any
access-list HOSTCHECK extended permit ip any host 192.168.1.201
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 104
Using Capture for Application Profiling
§ An alternative option is to save the capture in .pcap format and
view in a protocol analyzer
§ Using a browser: https://<fw_ipaddr>/capture/<capture
name>/pcap/<filename>.pcap and save the file for analysis
§ Using Wireshark’s “Follow the TCP Stream” feature shows the
startup of the Go2myPC application:
GET /servlet/com.ec.ercbroker.servlets.PingServlet
HTTP/1.0
HTTP/1.0 200 OK
Pragma: no-cache
Content-Type: text/plain
Content-Length: 41
ERCBroker broker http://www.gotomypc.com
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 105
Capture viewed in Wireshark
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 106
ASDM Regex Build Wizard
§ We chose to ignore
case resulting in
this string match
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 107
Case Study Part 2 – ASDM HTTP Inspect
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 109
Verification of HTTP Inspect
%ASA-6-302013: Built outbound TCP connection 5559 for
outside:66.151.158.177/80 (66.151.158.177/80) to
inside:192.168.1.201/1369 (xx.77.67.190/3184)
%ASA-6-106100: access-list inside_access_in denied tcp
inside/192.168.1.201(1370) -> outside/66.151.158.177(8200) hit-
cnt 1 first hit [0xfe57d861, 0x0]
%ASA-5-304001: 192.168.1.201 Accessed URL
66.151.158.177:/servlet/com.ec.ercbroker.servlets.PingServlet
%ASA-5-415006: HTTP - matched request uri regex Block-Go2MyPC in
policy-map block-go2mypc URI matched - Dropping connection from
inside:192.168.1.201/1369 to outside:66.151.158.177/80
%ASA-6-302014: Teardown TCP connection 5559 for
outside:66.151.158.177/80 to inside:192.168.1.201/1369 duration
0:00:00 bytes 0 Flow closed by inspection
%ASA-5-304001: 192.168.1.201 Accessed URL
66.151.158.177:/servlet/com.ec.ercbroker.servlets.PingServlet
%ASA-5-415006: HTTP - matched request uri regex Block-Go2MyPC in
policy-map block-go2mypc URI matched - Dropping connection from
inside:192.168.1.201/1371 to outside:66.151.158.177/80
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 110
ASA 5580 and FWSM
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 111
ASA 5580 and FWSM Comparison
ASA 5580 FWSM
4 RU Appliance with dual Linecard for Catalyst 6500
power supplies
Up to 10GB throughput Up to 5GB throughput
Supports SSL VPN and Supports IPSEC VPN for
IPSEC VPN termination management ONLY
Line rate ACLs up to ACE limits vary by software
500,000 ACEs supported release
Supports NetFlow No Netflow support today
ASA codebase is same FWSM code base is
across platforms unique to FWSM
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 112
Which ASA code should I use?
§ Tracking firewall code releases can be a very daunting
task, even for Cisco folks
§ Release Notes are your friend, read them!
§ ASA Releases:
7.0(8) GD status as of April 2008
7.2 (4)
8.0.4 ED status, introduced SSL VPN enhancements and EIGRP
8.1.2 ED release for ASA 5580 platform ONLY
8.2.1 ED released May 2009 for all ASA platforms
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 113
ASA 8.3 New Features
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 114
Some New Features in 8.3
§ Network Object Optimization
§ ACL Time Stamp
§ Global Firewall Rules
§ NAT Simplification
§ Botnet Traffic Filters (BTF) Enhancement
§ Licensing Changes
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 115
Botnet Traffic Filtering (BTF)
Session_ID
© 2010 Cisco 116 1
CiscoSystems,
Presentation_ID
Presentation_ID © 2007
Inc.All
Systems, Inc.
Allrights
rights reserved.
reserved.
Cisco
Cisco
Public
Confidential
1
Q and A
Thank you
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 117
Session_ID
Presentation_ID © 2010 Cisco Systems, Inc. All rights reserved. Cisco Public 118