IOS Security Reference Manual Ver. 0.9
IOS Security Reference Manual Ver. 0.9
IOS Security Reference Manual Ver. 0.9
0 (2012-14)
Contents
SECURING THE EDGE ROUTER
AAA
ACLs
CLI BASED FIREWALLS
IPS & IDS
LAYER 2 SECURITY
IPSec
APPENDIXES
1
22
28
39
50
60
67
81
SECURITY THE
EDGE ROUTER
Administrative Access Security
Banners
Login Security
SSH
Securing the System Files
Clock Configuration
System Logging
Role-Based CLI
Privilege Levels
Enabling SDM Support
Routers Passwords Recovery Procedure
Security Audits
Sample Routing Hardening Configuration
COMMANDS
COMMENTS
GLOBAL SETTINGS
<Router(config)#service password-encryption>
ADMINISTRATIVE PORTS
<Router(config)#line con 0>
CONFIGURE PASSWORDS
<Router(config-line)#password (password)>
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
<Router(config-line)#no exec-timeout>
OR
<Router(config-line)#exec-timeout 0 0>
*DISABLE INCOMING
CONNECTIONS
<Router(config-line)#no exec>
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
BANNERS
STEP #
COMMANDS
<Router(config)#banner (type) & MESSAGE+TOKENS &>
COMMENTS
Banner types:
CONFIGURE BANNERS
Tokens:
$(hostname)
$(domain)
$(line)
$(line-desc)
& - delimiting character, indicates the beginning and end of the message
(cannot be part of the message itself)
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
LOGIN SECURITY
STEP #
COMMANDS
COMMENTS
To verify:
<Router#show login>
<Router(config)#login-on failure (*log | trap) (*every (1-65535))>
Alternatively:
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
COMMANDS
COMMENTS
CONFIGURE HOSTNAME
<Router(config)#hostname (hostname)>
To verify:
*TUNE EXEC-TIMEOUT
TSHOOT
<Router(config-line)#login local>
<Router(config-line)#transport input ssh>
<Router(config)#ip ssh version (1-2)>
show ip ssh
show ssh
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
COMMANDS
COMMENTS
<Router(config)#secure boot-image>
<Router(config)#secure boot-config>
TSHOOT
<Router#reload>
VIEW FILES
<rommon #1>dir
RESTORE CONFIGURATION
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
CLOCK CONFIGURATION
STEP #
COMMANDS
COMMENTS
MANUAL
Sets the router as a NTP slave with the IP address of the NTP
master.
NTP
<Router(config)#ntp authenticate>
TSHOOT
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
SYSTEM LOGGING
STEP #
COMMANDS
<Router(config)#logging host (hostname | A.A.A.A)>
KEYWORD
SERVER
CONSOLE
EMERGENCIES
BUFFER
ALERTS
CRITICAL
ERRORS
WARNINGS
NOTIFICATIONS
INFORMATIONAL
DEBUGGING
LINES
<Router(config)#logging on>
COMMENTS
ENABLE LOGGING
TSHOOT
show logging
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
ROLE-BASED CLI
STEP #
ENABLE AAA
COMMANDS
COMMENTS
<Router(config)#aaa new-model>
<Router(config-view)#secret (password)>
CREATE VIEWS
Examples:
<Router(config-view)#commands exec include configure>
<Router(config-view)#commands configure include interface>
SUPERVIEW
<Router(config-view)#secret (0 | 5) (password)>
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
10
PRIVILEGE LEVELS
STEP #
COMMANDS
COMMENTS
LEVEL 1
DISABLE
ENABLE
EXIT
HELP
LOGOUT
LEVEL 2-14
customizable
commands available at lower levels are available at
higher levels
LEVEL 15
configure
exec
global config.
EXEC mode
interface
line
interface subconfig.
line subconfig.
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
11
COMMANDS
COMMENTS
CONFIGURE HOSTNAME
<Router(config)#hostname (hostname)>
ENABLE AUTHENTICATION
ENABLE AUTHENTICATION
VIA THE LOCAL USER
DATABASE
<Router(config-line)#login local>
ENABLE SSH
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
12
COMMANDS
COMMENTS
The procedure requires physical access to the device
and cannot be performed over a virtual connection.
Relevant values:
rommon #2>reset
0x2102
default setting
enters ROM if booting fails
0x2142
<Router#show startup-config>
<Router(config)#config-register 0x2102>
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
13
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
14
SECURITY AUDITS
DISABLES
ENABLES
SETS
SNMP
Finger
PAD
TCP Small Servers
UDP Small Servers
IP BootP
IDENT
CDP
IP Source Route
IP Redirects
IP Proxy ARP
IP Directed Broadcast
MOP
IP Unreachables
IP Mask Reply
password encryption
IP CEF
firewall rules on all outbound interfaces
unicast RPF on all outbound interfaces
logging
password encryption
IP CEF
firewall rules on all outbound interfaces
unicast RPF on all outbound interfaces
SSH
AAA
TCP Keepalives Inbound / Outbound
seq. # and timestamps on debugs
SNMP
Finger
PAD
TCP Small Servers
UDP Small Servers
IP BootP
IDENT
CDP
IP Source Route
IP Redirects
IP Proxy ARP
IP Directed Broadcast
MOP
IP Unreachables
IP Mask Reply
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
15
set hostname
<RTR1(config)#hostname RTR1>
<RTR1(config)#service password-encryption>
SSH
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
16
LOGIN
disable login for 60 sec. if there are 3 failed login attempts within 20 sec.
BANNERS
MOTD
LOGIN
EXEC
MANAGEMENT LINES
CONSOLE
o
<RTR1(config-line)#password cisco123>
<RTR1(config-line)#logging synchronous>
<RTR1(config-line)#exec-timeout 10 0>
AUX LINE
<RTR1(config-line)#password cisco123>
<RTR1(config-line)#logging synchronous>
<RTR1(config-line)#exec-timeout 10 0>
<RTR1(config-line)#no exec>
VTY LINES
<RTR1(config-line)#password cisco123>
<RTR1(config-line)#logging synchronous>
<RTR1(config-line)#exec-timeout 10 0>
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
17
<RTR1(config-line)#privilege 15>
<RTR1(config-line)#exec-timeout 5 0>
LOGGING
SDM SUPPORT
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
18
GLOBALLY
o
IP Source Routing
<RTR1(config)#no ip source-route>
Finger
BootP
DNS Lookup
<RTR1(config)#no ip domain-lookup>
IDENTD Services
<RTR1(config)#no ip identd>
X.25 PAD
Gratuitous ARPs
<RTR1(config)#no ip gratuitous-arps>
SNMP
<RTR1(config)#no snmp-server>
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
19
ON INTERFACES
o
Proxy ARP
<RTR1(config-if)#no ip proxy-arp>
ICMP Redirects
<RTR1(config-if)#no ip redirects>
ICMP Unreachables
<RTR1(config-if)#no ip unreachables>
<RTR1(config-if)#no ip mask-reply>
IP Directed Broadcast
<RTR1(config-if)#no ip directed-broadcast>
GLOBALLY
o
TCP Keepalives IN
<RTR1(config)#service tcp-keepalives-in>
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
20
AAA
AAA Local Authentication
COMMANDS
COMMENTS
<Router(config)#aaa new-model>
ENABLE AAA
EXAMPLE:
DEFINE A LIST OF
AUTHENTICATION METHODS
METHOD
enable
line password
local
none
enable password
line
local-case
USES
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
21
TSHOOT
EXAMPLE:
<Router(config)#username Admin secret cisco123>
<Router(config)#aaa new-model>
<Router(config)#aaa authentication login default local-case enable>
<Router(config)#line con 0>
<Router(config-line)#login authentication default> (* hardcoding a default method is not necessary)
<Router(config)#aaa local authentication attempts max-fail 2>
<Router(config)#aaa authentication banner & Authentication commences: &>
<Router(config)#aaa authentication username-prompt Username:>
<Router(config)#aaa authentication password-prompt Password:>
<Router(config)#aaa authentication fail-message & Wrong password &>
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
22
ENABLE AAA
COMMANDS
COMMENTS
<Router(config)#aaa new-model>
<Router(config)#tacacs-server host (A.A.A.A) (*single-connection) key (key)>
DEFINE A LIST OF
AUTHENTICATION METHODS
TSHOOT
EXAMPLE
<Router(config)#aaa new-model>
<Router(config)#tacacs-server host 10.0.0.3 single connection key cisco123>
<Router(config)#aaa authentication login default group tacacs+ local-case enable>
<Router(config)#line con 0>
<Router(config)#login authentication default>
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
23
COMMANDS
COMMENTS
This means that the administrator must create a user with full
access rights before authorization is enabled.
ENABLE AAA
<Router(config)#aaa new-model>
RESOURCE TYPE
network
TSHOOT
DESCRIPTION
authorization for starting L2
connections
exec
commands level_#
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
24
EXAMPLE
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
25
COMMAND
COMMENTS
ENABLE AAA
<Router(config)#aaa new-model>
USAGE TYPES:
TYPE
DESCRIPTION
network
exec
command lvl
system
TRIGGERS:
TYPE
DESCRIPTION
start-stop
stop-only
none
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
26
TSHOOT
EXAMPLE
<Router(config)#aaa new-model>
<Router(config)#tacacs-server host 10.0.0.3 single-connection key cisco123>
<Router(config)#aaa accounting exec default start-stop group tacacs+>
<Router(config)#aaa accouting command 15 default stop-only group tacacs+>
<Router(config)#aaa accouting system default stop-only group tacacs+>
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
27
ACLs
Standard ACLs
Extended ACLs
Misc ACL Features
o
o
o
o
o
o
o
o
Sequencing
Wildcards
Port Operators
TCP Established
Reflexive ACLs
Dynamic ACLs
Time Based ACLs
Turbo ACLsMisc ACL Features
STANDARD ACLs
RANGE
1 - 99
1300 - 1999
FILTER BASED ON
SOURCE ADDRESS
POSITION
WORK AT
L3 NETWORK LAYER
REMARK
SYNTAX
COMMENTS
RULES
ACTIVATION
EXAMPLE
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
28
SYNTAX
COMMENTS
CREATE ACL
REMARK
RULES
ACTIVATION
EXAMPLE
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
29
EXTENDED ACLs
RANGE
100 - 199
2000 - 2699
DESTINATION ADDRESS
SOURCE ADDRESS
IP PROTOCOL (NAME / NUMBER)
PROTOCOL INFORMATION
o ICMP: message type
o TCP /UDP: source and/or destination port names and numbers
o TCP: flags
FILTER BASED ON
POSITION
WORK AT
L3 NETWORK LAYER
L4 TRANSPORT LAYER
SYNTAX
COMMENTS
REMARK
RULES
ACTIVATION
EXAMPLE
allow all protocols used by IPSec suite originated by host Sydney (192.168.0.1) to reach host Perth (192.168.0.2)
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
30
SYNTAX
COMMENTS
CREATE ACL
REMARK
RULES
ACTIVATION
EXAMPLE
allow all protocols used by IPSec suite originated by host Sydney (192.168.0.1) to reach host Perth (192.168.0.2)
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
31
the more restrictive statements should be at the top of the list and the less restrictive ones at the bottom
by default, statements are added to the end of the list (can be overridden by using the sequence numbers)
there is an invisible deny 0.0.0.0 255.255.255.255 statement at the end of the list that drops all traffic not explicitly permitted
one ACL per protocol, per interface and per direction is allowed
an empty ACL permits all traffic
an ACL needs to have at least one statement permitting traffic for the invisible deny any to take effect
explicit deny ip any any statement should be put at the end of the ACL to be able to view hit counts for denied traffic
SEQUENCING
SYNTAX
COMMENTS
To resequence:
WILDCARDS
SYNTAX
COMMENTS
0 = match exactly
1 = ignore
32
PORT OPERATORS
SYNTAX
COMMENTS
<Router(config)#access-list (name | #) (permit | deny) (tcp | udp) (source) (*operator) (protocol name | 0-255)
(destination) (*operator) (protocol name | 0-255)>
Example:
eq
OPERATOR
range
MATCHES
match only packets on a given port
match only packets in the range of ports
gt
lt
neq
COMMENTS
Example:
Allows / denies traffic coming from the outside that was initiated
from the inside.
allow any HTTPS traffic to host SYDNEY (10.0.0.3) as long as it was originated by SYDNEY.
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
33
REFLEXIVE ACLs
COMMENTS
<R1(config)#interface (interface)>
<R1(config-if)#ip access-group (outbound ACL name) out>
<R1(config-if)#ip access-group (inbound ACL name) in>
EXAMPLE
allow only TELNET and ICMP traffic into the local network as long as it was originated by HOME (98.174.249.99)
deny all traffic originated from the remote network
the ACLs need to be configured on the border router CLOUD on the outside interface s1/1
34
opens a temporary door in the firewall and grants access to specified resources provided the user is authenticated using Telnet / SSH
the access request is put on hold until the user is authenticated using a Telnet / SSH connection
once authentication is complete the remote connection is dropped and a single-entry dynamic ACL is added to the existing extended ACL
the traffic is permitted for specified period (idle and absolute timeouts)
only one policy can be configured for all dynamic ACL users and this single policy is applied to all the authenticated users
SYNTAX
COMMENTS
Supported methods of authentication:
<R1(config-line)#login local>
<R1(config-line)#autocommand access-enable (*host) (*idle (1-9999))>
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
35
EXAMPLE
allow remote host JEREMY (172.30.2.11/24) to access 192.168.1.0/24 network upon successful authentication with REMOTE router (67.40.69.33/24)
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
36
<R1(config)#access-list 101 (permit | deny) (0-255 | name) (source) (destination) time-range (range name)>
<R1(config)#time-range WWW_ACCESS>
<R1(config-time-range)#periodic weekdays 05:59 to 16:59>
<R1(config)#access-list 101 deny tcp any any eq 80>
<R1(config)#interface s1/0>
<R1(config-if)#ip access-list 101 out>
TURBO ACLs
SYNTAX
<Router(config)#access-list compiled>
To verify:
<Router#show access-list compiled>
COMMENTS
Reduces the ACL lookup time by compiling ACLs into a hash
table.
The lookup time is the same no matter which ACL command is
being looked up
Can only be used on an ACL that has more than three entries!
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
37
show access-list
show ip access-list (1-1999 | 1300-2799 | name | dynamic | (interface (interface))
show running-config
show ip interface (interface)
debug ip packet (1-99 | 1300-2699) (*detail)
COMMAND
VERIFIES
ACL type
ACL number / name
ACL sequence number
ACL rules
ACL matches
does not display remarks
show running-config
ACL remarks
ACL rules
ACL and direction bound to an interface
*the order of rules for a given ACL matches the order the rules where entered (even if ACLs
were re-sequenced)
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
38
CLI BASED
FIREWALLS
CBAC
Cisco IOS based firewall that filters TCP and UDP packets based on their L7 Application Layer information
generates real time audits and trails
creates and maintains session table to build dynamic ACL entries
CBAC CONFIGURATIONS
STEP #
COMMANDS
COMMENTS
Example:
<Router(config)#ip inspect name (rule name) (protocol name) (*alert (on | off)) (*routertraffic) (*audit-trail (on | off)) (*timeout 5-43200)>
Example:
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
39
<Router(config)#interface s1/1>
in - on an INTERNAL interface
out - on an EXTERNAL interface
no ip inspect - removes all CBAC commands, the
state table, and all temporary ACL entries
created by CBAC.
*TIMERS + THRESHOLDS
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
40
EXAMPLE
the border Router, Cloud, has two active interfaces: s1/0 (INSIDE) and s1/1 (OUTSIDE)
the OUTSIDE traffic cannot initiate connection to the devices on the INSIDE and is dropped at the border router
RIP updates are excepted; their exchange is crucial for the network operation
device on the INSIDE can initiate connection to the OUTSIDE devices and the return traffic is permitted through the border router
allowed protocols: HTTP, ICMP, TELNET
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
41
VERIFIES
PAREMTER
all
config
interfaces
name
sessions
session details
DESCRIPTION
all available information
CBAC configuration
rules activated on interfaces
rules details
summary of inspections in the CBAC table
detailed information on inspection in the CBAC table
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
42
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
43
COMMANDS
COMMENTS
<Router(config-sec-zone)#description (description)>
CREATE ZONES
A policy can be defined using the self zone either as the source or
destination.
The self zone does not require any interfaces to be configured as
members all the IP interfaces on the router are automatically
assigned to the self zone.
<Router(config)#interface (interface)>
<Router(config-if)#zone-member security (zone name)>
ASSIGN INTERFACES
TO THE ZONES
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
44
L3/4 TYPE
The order is significant since the statements are processed topdown for a match.
Example:
L3/4 TYPE
*<Router(config-pmap)#class class-default>
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
45
PAIR ZONES
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
46
VERIFIES
zones configured
interfaces associated with zones
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
47
ZBF LOGIC
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
48
YES
NO
DROP
YES
NO
YES
YES
APPLY POLICY-MAP:
NO
DROP
POLICY STATEMENTS:
DROP
PASS
INSPECT
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
49
IPS Implementations
IPS Signatures
IPS Management and Monitoring
ISP Configurations
IPS Verification and Tshooting
IDS vs IPS
IDS (Intrusion Detection System)
PROS
CONS
IDS cannot stop malicious traffic from single-packet attacks from reaching the target system
IDS requires assistance from other networking devices (e.g. routers, firewalls) to respond to attack
less helpful in stopping email viruses and automated attacks e.g. worms
more vulnerable to network evasion techniques
a well thought-out security policy is essential to successfully deploy an IDS
implemented in inline mode all ingress and egress traffic must flow through it for processing
no traffic is allowed into the trusted network without first being analyzed
IPS can drop the trigger packet, the packets in connection or packets from a source IP address
PROS
CONS
if the traffic matches a signature the IDS can stop the attack immediately
IDS can use traffic normalization techniques to reduce or eliminate many of the network evasion capabilities
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
50
IPS IMPLEMENTATIONS
HOST BASED IPS IMPLEMENTATION
COMMENTS
installed on individual computers using HIPS (Host Intrusion Prevention System) e.g. CSA
HIPS audits host log files, file systems and resources
protect systems using policies that network administrators configure and deploy on agents
the agents check whether an action is allowed or denied before any system resources are accessed and acted upon
can stop attacks by reacting in real time without any updates
PROS
can monitor OS processes and protect critical system resources including files that may exist only on that specific host
has access to traffic in unencrypted form
with HIPS the success or failure of an attack can be readily determined
does not provide a complete network pictures and has difficulty coordinating the events happening across the entire
network
has to support multiple OS
CONS
COMMENTS
PROS
CONS
a module on a device
a dedicated appliance
a networking device with IPS
capabilities (e.g. router)
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
51
IPS SIGNATURES
ATOMIC SIGNATURES
COMMENTS
consists of a single packet, activity or event that is examined to determine if it matches a configured signature
because they can be matched on a single event there is no need to maintain state information by the IPS
the entire inspection can be accomplished in an atomic operation that does not require knowledge of past / future activities
detecting atomic signatures require minimal resources (e.g. RAM) on the IPS /IDS device
easy to identify and understand because they are compared against a specific event or packet
an IDS is vulnerable to an atomic packet attacks because until it finds the attack malicious single packets are allowed into the network
an IPS prevents atomic packet attacks from entering the network
COMMENTS
the signature identifies a sequence of operations distributed across multiple hosts over a period of time
stateful properties of a composite signature usually require several pieces of data to match an attack signature
ATOMIC
SERVICE
ATOMIC.IP
ATOMIC.ICMP
ATOMIC.IPOPTIONS
ATOMIC.UDP
ATOMIC.TCP
SERVICE.DNS
SERVICE.HTTP
SERVICE.FTP
STRING.TCP
STRING.UDP
STRING.ICMP
STRING
MULTI-STRING
MULTI-STRING
OTHER
NORMALIZER
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
52
PATTERN BASED
COMMENTS
ANOMALY
POLICY
the administrator defines behaviors that are suspicious based on historical analysis
enables a single signature to cover an entire class of activities without having to specify each individual situation
HONEYPOT
COMMENTS
FALSE POSITIVE
FALSE NEGATIVE
TRUE POSITIVE
TRUE NEGATIVE
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
53
COMMENTS
ATOMIC ALERTS
GENERATE AN ALERT
SUMMARY ALERTS
- a single alert that indicates multiple occurrences of the same signature from the same source
- limit the number of alerts generated and make it difficult for an attacker to consume resources on the sensor
- can be configured to summarize atomic alerts as well
RESET TCP
CONNECTION
by logging the alerts the administrator can perform analysis later and identify exactly what is taking place
and make a decision as to whether it should be allowed or denied in the future
enables the device to stop an attack before it has the chance to perform malicious activity
the analysis engine determines which packets should be forwarded and which should be dropped
the drop action can be expanded to drop all packets for a specific session or all packets from a specific host
for a specific amount of time
used to terminate TCP connections by generating a packet for the connection with the TCP RST flag set
an IPS can use the TCP reset action to abruptly end a TCP connection that is performing unwanted
operation
can be used with conjunction with deny packet / connection actions
future traffic can be blocked by the IPS device update the ACL on one of the infrastructure devices
the ACL expires after defined amount of time
can be used with conjunction with other actions such as dropping unwanted traffic
the IPS can block traffic at multiple locations throughout the network
allows to configure exceptions
BLOCK FUTURE
ACTIVITY
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
54
MANAGEMENT
METHOD
LOCAL
correlating attacks and other events that are happening simultaneously at different points across the
network
NTP should be used to ensure that all alerts are accurately time-stamped
a correlation tool can correlate the alerts based on the timestamps
a centralized monitoring facility allows for accurate even correlation
SECURITY STAFF
INCIDENT RESPONSE
PLAN
MANAGING
SIGNATURES
large enterprises require the appropriate security staff to analyze numerous alerts and to tune and
optimize IPS sensors
a response plan needs to be designed to restore the state of the system to the state before the attack
IEV
CSM
MARS
EVEN CORRELATION
SDM
IDM
CENTRAL
an alternative to syslog
format was developed to improve
communication of events generated
by security devices
primarily communicates IDS events
but the protocols is intended to be
extensible and allows additional
event types to be included as they
are defined
Cisco SDM can monitor syslog and
SDEE-generated events
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
55
IPS CONFIGURATIONS
CONFIGURATION VIA CISCO CLI
STEP #
COMMANDS
COMMENTS
Required files:
IOS-Sxxx-CLI.pkg
realm-cisco.pub.key.txt
<R1#mkdir (directory_name)>
<R1#dir flash:>
<R1(config)#crypto key pubkey-chain rsa
named-key realm-cisco.pub signature
key-string
30820122 300D0609 2A864886 F70D0101 01050003 82010F00 3082010A 02820101
00C19E93 A8AF124A D6CC7A24 5097A975 206BE3A2 06FBA13F 6F12CB5B 4E441F16
17E630D5 C02AC252 912BE27F 37FDD9C8 11FC7AF7 DCDD81D9 43CDABC3 6007D128
B199ABCB D34ED0F9 085FADC1 359C189E F30AF10A C0EFB624 7E0764BF 3E53053E
5B2146A9 D7A5EDE3 0298AF03 DED7A5B8 9479039D 20F30663 9AC64B93 C0112A35
FE3F0C87 89BCB7BB 994AE74C FA9E481D F65875D6 85EAF974 6D9CC8E3 F0B08B85
50437722 FFBE85B9 5E4189FF CC189CB9 69C46F9C A84DFBA5 7A0AF99E AD768C36
006CF498 079F88F8 A3B3FB1F 9FB7B3CB 5539E1D1 9693CCBB 551F78D2 892356AE
2F56D826 8918EF3C 80CA4F4D 87BFCA3B BFF668E9 689782A5 CF31CB6E B4B094D3
F3020301 0001
quit
exit
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
56
exit>
To remove:
<R1(config)#no crypto key pubkey-chain rsa)
<R1(config)#no named-key realm-cisco.pub>
<R1(config-ips-category-action)#exit>
<R1(config-ips-category)#exit>
<R1(config)#interface (interface)>
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
57
To verify:
<R1#show ip ips signature>
<R1(config-)#category>
<R1(config-ips-category)#(all | ios_ips (basic | advanced))>
MODYFING A GROUP OF
SIGNATURES
<R1(config-ips-category-action)#event-action (action)>
<R1(config-ips-category-action)#exit
<R1(config-ips-category)#exit>
Do you want to accept these changes? [confirm] (Y | N)
<R1(config)#ip ips signature-definition>
<R1(config-sigdef)#signature (1-65535) (0-65535)>
<R1(config-sigdef-sig)#status>
MODYFING AN INDIVIDUAL
SIGNATURE
<R1(config-sigdef-sig-status)#exit
<R1(config-sigdef-sig)#engine>
<R1(config-sigdef-sig-engine)#event-action (action)>
<R1(config-sigdef-sig)#exit>
<R1(config-sigdef)#exit>
Do you want to accept these changes? [confirm] (Y | N)
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
58
VERIFIES
Displays additional configuration data that is not displayed with the show running-config
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
59
LAYER 2
SECURITY
Layer 2 Attacks
Securing Layer 2
o
o
o
o
DTP Modes
Switchport Security
STP Security
Misc
LAYER 2 ATTACKS
ATTACK
HOW IT WORKS
COMMENTS
the attacker broadcasts BPDUs that contain false STP configuration and topology changes
aim to promote the rouge device to the rank of ROOT BRIDGE, which will result in the attacker
having access to otherwise inaccessible traffic
LAN Storm packets flood the LAN creating excessive traffic and hurting network performance
broadcasts and multicasts are flooded on all ports within the same VLAN
storms can increase the CPU utilization on a switch to 100%
PortFast
ROOT guard
BPDU guard
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
60
VLAN ATTACKS
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
61
SECURING LAYER 2
DTP MODES
MODE
OVERVIEW
COMMENTS
TRUNK
To hardcode mode on an interface:
DYNAMIC AUTO
NON-NEGOTIATE
<S1(config-if)#switchport nonegotiate>
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
62
ACCESS
TRUNK
DYNAMIC AUTO
DYNAMIC DESIRABLE
NON-NEGOTIATE
ACCESS
ACCESS
MISMATCH
ACCESS
ACCESS
MISMATCH
TRUNK
MISMATCH
TRUNK
TRUNK
TRUNK
TRUNK
DYNAMIC AUTO
ACCESS
TRUNK
ACCESS
TRUNK
MISMATCH
DYNAMIC DESIRABLE
ACCESS
TRUNK
TRUNK
TRUNK
MISMATCH
NON-NEGOTIATE
MISMATCH
TRUNK
MISMATCH
MISMATCH
TRUNK
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
63
SWITCHPORT SECURITY
STEP #
COMMANDS
COMMENTS
<S1(config-if)#switchport port-security>
<S1(config-if)#shutdown>
<S1(config-fi)#no shutdown>
OR
<S1(config)#errdisable recovery cause psecure-violation>
AGING
TSHOOT
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
64
STP SECURITY
STEP #
COMMANDS
<S1(config)#spanning-tree portfast default>
PortFast
<S1(config-if)#spanning-tree portfast>
COMMENTS
BPDU Guard
BPDU Filter
Root Guard
<S1(conif-if)#spanning-tree bpdufilter>
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
65
MISC
<S1(config-if)#storm-control (broadcast | multicast | unicast) level ()>
level (level-low)
bps (bps-low)
pps (pps-low)
Storm Control
SPAN Ports
To verify:
<S1#show monitor>
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
66
IPSec
IPSec Configuration
IKE Phase 1
IKE Phase 2
IPSec CONFIGURATION
IKE PHASE 1
COMMANDS
COMMENTS
ENABLE ISAKMP
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
67
AUTHENTICATION
ENCRYPTION
HASH
DH LEVEL
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
68
IF LOCAL ID = HOSTNAME
CREATE PSKs
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
69
IKE PHASE 2
COMMANDS
COMMENTS
To verify:
<Router#show crypto ipsec transform-set (sets name)>
o
o
o
o
*TUNE IPSec SA
PARAMETERS
AU AUTHENTICATION (hashing)
ESP AUTHENTICATION (hashing)
ESP ENCRYPTION
COMPRESSION
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
70
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
71
VERIFIES
EXAMPLE
policy number
encryption algorithm
hashing algorithm
authentication method
DH group
lifetime
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
72
DESCRIPTION
The tunnel has been initialized but nothing
has been negotiated yet.
MM_NO_STATE
AG_NO_STATE
MM_SA_SETUP
MM_KEY_EXCH
DH has completed.
AG_INIT_EXCH
AG_AUTH
QM_IDLE
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
73
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
74
clear crypto sa
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
75
PEER 1: HOME
LOCAL ID
IP ADDRESS
PEER 2: REMOTE
IP ADDRESS
98.174.249.99
67.40.69.33
#10
#60
POLICY
NUMBER
AUTHENTICATION
ENCRYPTION
HASHING
DH LVL
LIFETIME
NAME
ACCEPTED FROM
cbtkey
67.40.69.33
98.174.249.99
NAME
AH HASHING
N/A
ESP HASHING
ESP-AES 123
ESP ENCRYPTION
COMPRESION
ESP-SHA-1-HMAC
N/A
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
76
CRYPTO ACL
S2S-VPN-TRAFFIC
NAME
INTERESTING TRAFFIC
S2S-VPN-TRAFFIC
CRYPTO MAP
S2S-VPN
S2S-VPN
SEQUENCE #
100
200
INTERFACE
s1/0
s1/1
NAME
COMMANDS
<Router(config)#crypto isakmp enable>
<Rotuer(config)#crypto isakmp policy 10>
<Router(config-isakmp)#authentication pre-share>
<Router(config-isakmp)#encryption aes 128 >
<Router(config-isakmp)#group 2>
<Router(config-isakmp)#hash sha>
<Router(config-isakmp)#lifetime 86400>
VERIFY:
<Router#show crypto isakmp policy>
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
77
COMMANDS
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
78
CONFIGURATION FILES
HOME
!
crypto isakmp policy 10
encr aes
authentication pre-share
group 2
crypto isakmp key cbtkey address 67.40.69.33
!
crypto ipsec transform-set CBTVPN esp-aes esp-sha-hmac
!
crypto map S2S-VPN 100 ipsec-isakmp
set peer 67.40.69.33
set transform-set CBTVPN
match address S2S-VPN-TRAFFIC
!
interface Serial1/0
ip address 98.174.249.99 255.255.255.0
serial restart-delay 0
crypto map S2S-VPN
!
!
ip access-list extended S2S-VPN-TRAFFIC
permit ip 172.30.2.0 0.0.0.255 192.168.1.0 0.0.0.255
!
REMOTE
!
crypto isakmp policy 60
encr aes
authentication pre-share
group 2
crypto isakmp key cbtkey address 98.174.249.99
!
crypto ipsec transform-set CBTVPN esp-aes esp-sha-hmac
!
crypto map S2S-VPN 100 ipsec-isakmp
set peer 98.174.249.99
set transform-set CBTVPN
match address S2S-VPN-TRAFFIC
!
interface Serial1/1
ip address 67.40.69.33 255.255.255.0
serial restart-delay 0
crypto map S2S-VPN
!
!
ip access-list extended S2S-VPN-TRAFFIC
permit ip 192.168.1.0 0.0.0.255 172.30.2.0 0.0.0.255
!
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
79
PEER 1
LOCAL ID
IP ADDRESS
PEER 2
POLICY
NUMBER
AUTHENTICATION
ENCRYPTION
HASHING
DH LVL
LIFETIME
NAME
ACCEPTED FROM
IKE PHASE 2
TRANSFORM SET
NAME
AH HASHING
ESP HASHING
ESP ENCRYPTION
COMPRESION
CRYPTO ACL
NAME
INTERESTING TRAFFIC
CRYPTO MAP
NAME
SEQUENCE #
INTERFACE
BASIC SECURITY ver. 1.0 CREATED BY PAWEL PAUL NADSTOGA (PNADSTOGA@GMAIL.COM) 2012-14
80
APPENDIXES
IPv4 Subnetting
Common Ports
ACLs
Zone Based Firewall
IPSec
packetlife.net
Actions
! Legacy syntax
access-list <number> {permit | deny} <source> [log]
! Modern syntax
ip access-list standard {<number> | <name>}
[<sequence>] {permit | deny} <source> [log]
permit
deny
remark
evaluate
ACL Numbers
1-99
IP standard
1300-1999
Source/Destination Definitions
any Any address
host <address> A single address
100-199
IP extended
2000-2699
200-299 Protocol
IP Options
300-399 DECnet
400-499 XNS
500-599 Extended XNS
600-699 Appletalk
700-799 Ethernet MAC
800-899 IPX standard
900-999 IPX extended
1000-1099 IPX SAP
1100-1199 MAC extended
1200-1299 IPX summary
TCP Options
ack Match ACK flag
fin Match FIN flag
psh Match PSH flag
rst Match RST flag
syn Match SYN flag
urg Match URG flag
established
Match packets in an
established session
Logging Options
log Log ACL entry matches
Log matches including
log-input ingress interface and
source MAC address
by Jeremy Stretch
Troubleshooting
show access-lists [<number> | <name>]
show ip access-lists [<number> | <name>]
show ip access-lists interface <interface>
show ip access-lists dynamic
show ip interface [<interface>]
show time-range [<name>]
v2.0
COMMON PORTS
packetlife.net
TCP/UDP Port Numbers
7 Echo
554 RTSP
19 Chargen
2745 Bagle.H
546-547 DHCPv6
2967 Symantec AV
6970 Quicktime
560 rmonitor
3050 Interbase DB
7212 GhostSurf
22 SSH/SCP
23 Telnet
587 SMTP
25 SMTP
591 FileMaker
3127 MyDoom
42 WINS Replication
43 WHOIS
3222 GLBP
8118 Privoxy
49 TACACS
53 DNS
3306 MySQL
8767 TeamSpeak
69 TFTP
691 MS Exchange
3689 iTunes
8866 Bagle.B
70 Gopher
860 iSCSI
3690 Subversion
79 Finger
873 rsync
80 HTTP
20-21 FTP
67-68 DHCP/BOOTP
88 Kerberos
102 MS Exchange
110 POP3
113 Ident
9800 WebDAV
4444 Blaster
9898 Dabber
9988 Rbot/Spybot
4672 eMule
9999 Urchin
4899 Radmin
5000 UPnP
1080 MyDoom
5001 Slingbox
1194 OpenVPN
5001 iperf
143 IMAP4
1214 Kazaa
5004-5005 RTP
1241 Nessus
177 XDMCP
5060 SIP
179 BGP
1337 WASTE
5190 AIM/ICQ
201 AppleTalk
9119 MXit
4333 mSQL
161-162 SNMP
9100 HP JetDirect
9101-9103 Bacula
3784-3785 Ventrilo
123 NTP
137-139 NetBIOS
8086-8087 Kaspersky AV
7648-7649 CU-SeeMe
5222-5223 XMPP/Jabber
10000 Webmin
10000 BackupExec
10113-10116 NetIQ
11371 OpenPGP
12035-12036 Second Life
12345 NetBus
13720-13721 NetBackup
14567 Battlefield
15118 Dipnet/Oddbob
264 BGMP
1512 WINS
5432 PostgreSQL
19226 AdminSecure
318 TSP
19638 Ensim
1701 L2TP
5554 Sasser
20000 Usermin
5631-5632 pcAnywhere
24800 Synergy
381-383 HP Openview
389 LDAP
1723 MS PPTP
1725 Steam
445 Microsoft DS
464 Kerberos
1812-1813 RADIUS
25999 Xfire
27015 Half-Life
27374 Sub7
28960 Call of Duty
1863 MSN
6129 DameWare
497 Retrospect
6257 WinMX
500 ISAKMP
512 rexec
Chat
513 rlogin
2049 NFS
6566 SANE
Encrypted
6588 AnalogX
Gaming
514 syslog
2082-2083 cPanel
6346-6347 Gnutella
515 LPD/LPR
6665-6669 IRC
520 RIP
2222 DirectAdmin
2302 Halo
540 UUCP
2483-2484 Oracle DB
6699 Napster
Legend
Malicious
Peer to Peer
Streaming
6881-6999 BitTorrent
by Jeremy Stretch
v1.1
packetlife.net
Actions
! Legacy syntax
access-list <number> {permit | deny} <source> [log]
! Modern syntax
ip access-list standard {<number> | <name>}
[<sequence>] {permit | deny} <source> [log]
permit
deny
remark
evaluate
ACL Numbers
1-99
IP standard
1300-1999
Source/Destination Definitions
any Any address
host <address> A single address
100-199
IP extended
2000-2699
200-299 Protocol
IP Options
300-399 DECnet
400-499 XNS
500-599 Extended XNS
600-699 Appletalk
700-799 Ethernet MAC
800-899 IPX standard
900-999 IPX extended
1000-1099 IPX SAP
1100-1199 MAC extended
1200-1299 IPX summary
TCP Options
ack Match ACK flag
fin Match FIN flag
psh Match PSH flag
rst Match RST flag
syn Match SYN flag
urg Match URG flag
established
Match packets in an
established session
Logging Options
log Log ACL entry matches
Log matches including
log-input ingress interface and
source MAC address
by Jeremy Stretch
Troubleshooting
show access-lists [<number> | <name>]
show ip access-lists [<number> | <name>]
show ip access-lists interface <interface>
show ip access-lists dynamic
show ip interface [<interface>]
show time-range [<name>]
v2.0
Security Zone
A group of interfaces which share a common level of security
Zone Pair
A unidirectional pairing of source and destination zones to which a
security policy is applied
Inspection Policy
An inspect-type policy map used to statefully filter traffic by
matching one or more inspect-type class maps
Parameter Map
An optional configuration of protocol-specific parameters referenced
by an inspection policy
MPLS WAN
Internet
G0/0
G0/1
! Match by protocol
class-map type inspect match-any ByProtocol
match protocol tcp
match protocol udp
match protocol icmp
! Match by access list
ip access-list extended MyACL
permit ip 10.0.0.0 255.255.0.0 any
!
class-map type inspect match-all ByAccessList
match access-group name MyACL
Security Zones
Trusted
packetlife.net
Internet
Guest
Corporate
LAN
G0/2.10
G0/2.20
Guest
Wireless LAN
Pass
Troubleshooting
show zone security
show zone-pair security
show policy-map type inspect
by Jeremy Stretch
IPSEC
packetlife.net
Protocols
Encryption Algorithms
L2
IP
TCP/UDP
Transport
Mode
L2
IP
ESP/AH
Tunnel
Mode
L2
New IP
ESP/AH
Strength
56
Weak
168
Medium
AES Symmetric
128/192/256
Strong
RSA Asymmetric
1024+
Strong
DES Symmetric
3DES Symmetric
Hashing Algorithms
Length (Bits)
MD5 128
Strength
Medium
SHA-1 160
Strong
IKE Phases
TCP/UDP
IP
TCP/UDP
Transport Mode
The ESP or AH header is inserted behind the IP header; the
IP header can be authenticated but not encrypted
Tunnel Mode
A new IP header is created in place of the original; this
allows for encryption of the entire original packet
Configuration
crypto isakmp policy 10
encryption aes 256
hash sha
authentication pre-share
group 2
lifetime 3600
Phase 1
A bidirectional ISAKMP SA is established
between peers to provide a secure management
channel (IKE in main or aggressive mode)
IPsec Modes
Original
Packet
Type
ISAKMP Policy
Phase 2
Two unidirectional IPsec SAs are established for
data transfer using separate keys (IKE quick
mode)
Terminology
Data Integrity
Secure hashing (HMAC) is used to ensure data
has not been altered in transit
Data Confidentiality
Encryption is used to ensure data cannot be
intercepted by a third party
Data Origin Authentication
Authentication of the SA peer
Anti-replay
Sequence numbers are used to detect and
discard duplicate packets
Hash Message Authentication Code (HMAC)
A hash of the data and secret key used to
provide message authenticity
Diffie-Hellman Exchange
A shared secret key is established over an
insecure path using public and private keys
Troubleshooting
show crypto isakmp sa
show crypto isakmp policy
show crypto ipsec sa
show crypto ipsec transform-set
debug crypto {isakmp | ipsec}
by Jeremy Stretch
v2.0