- Defending your network against attack requires constant vigilance and education. There
are 10 best practices that represent the best insurance for your network. - Physical Security
- Operating System Security
- Router Hardening
- Several important tasks are involved in securing administrative access to an infrastructure device:
- Enable Secret Password
- Minimum Character Length
- Encrypt All Passwords
- Configuring Local Username Account
- Login Feature
- Banner
- Configure SSH
- Configuring Privilege Levels
- Configure Role-Based CLI Access
- Securing the Cisco IOS Image and Configuration Files
- Restore a primary bootset from a secure archive
- Recovering a router password
- ******* DISABLE ROMmon *********
- Configure system logging
- Using SNMP for Network Security
- Network Time Protocol (NTP)
- Local AAA authentication
- Access Control List (ACLs)
- Configure Time-Based ACLs
- Troubleshooting Complex ACL Implementations
- Configuring CBAC
- Design zone-based firewall
- Configure ZPF
- Troubleshooting
Firewall Technology
1.
Defending your network against attack requires constant vigilance and education. There are 10 best practices
that represent the best insurance for your network.
escalation attacks.
more than just a username. For example, entering "jdoe; rm -
rf /" might allow an attacker to remove the root file system
from a UNIX server. Programmers should limit input characters and not accept invalid characters such as | ; < > as input.
phone, via email, or in person.
software, and content filtering.
2.
Physical Security
personnel, is free of electrostatic or magnetic interference, has fire suppression, and has controls for temperature
and humidity.
DoS attack from power loss to the building.
3.
Operating System Security
network from some DoS attacks, while supporting the widest range of security services.
features in an operating system evolve over time. Keep in mind that the latest version of an operating system might
not be the most stable version available.
4. Router
Hardening
controlled.
these services are unnecessary and can be used by an attacker to gather information or for exploitation.
5. Several
important tasks are involved in securing administrative access to an infrastructure device:
the permitted methods of access.
occurs and when.
the number of failed login attempts and the time between logins.
interactive sessions.
the vulnerability of data in transit over a communication channel to sniffing, session hijacking, and man-in-the-
middle (MITM) attacks.
6. Enable
Secret Password
0 &nbs
p; / line vty 0
4 &nbs
p; / line aux 0
bsp; # password
csc5io
bsp; # login
bsp; # exec-timeout minutes
seconds &n
bsp; //
Disable Unattended Connections
7. Minimum
Character Length
log
8. Encrypt
All Passwords
encryption
9.
Configuring Local Username Account
authentication
10. Login
Feature
(config)# login
block-for seconds attempts tries within seconds
(config)# login
quiet-mode access-class {acl-name | acl-number}
(config)# login
delay seconds //wait [seconds] before try other pwd
(config)# login
on-failure log [every login]
(config)# login
on-success log [every login]
remark Permit only Administrative hosts
permit 192.168.10.10
permit 192.168.10.10
ADMIN
11. Banner
12. Configure
SSH
name //if router’s unique
hostname.
rsa general-key modulus modulus-size
//encrypt
key pairs
//enable VTY login line
local
period
//Bob is username
13. Configuring
Privilege Levels
ping
cisco5
5 secret cisco5
14. Configure Role-
Based CLI Access
Create and manage specific view
Aaa new-
model
Enable [view
[view-name]]
Parser view
view-name
view **Must be set immediately after
create view
Secret encrypted-pwd
Commands
parser-mode
{include | include-exclusive
| exclude} [all] [interface interface-name |
command]
cisco
show
ping
cisco5
ping
Create and manage a superview
Enable view-
root
Parser view
view-name superview
Secret
encrypt-pwd
View view-name
cisco
SHOWVIEW
VERIFYVIEW
view-name
view all
15. Securing the
Cisco IOS Image and Configuration Files
Secure boot-
image
Secure boot-config
Show secure bootset
16. Restore a primary
bootset from a secure archive
filename
17. Recovering a
router password
Confreg 0x2142
reset
No or Ctrl+C
18. *******
DISABLE ROMmon *********
=> password recovery is enabled.
19. Configure
system logging
Logging host
[host-name
| ip-
add]
//set destination
Logging trap
level &n
bsp; //optional
Logging source-interface
interface-type interface-
number //particular int
Logging
on &nb
sp; //enable logging
logging host 10.2.2.6
logging trap informational
logging source-interface loopback 0
logging on
Configure system logging (SDM):
Level list box. Messages will be logged for the level selected and below.
field.
20. Using SNMP for
Network Security
To enable SNMPv1 and SNMPv2 using Cisco SDM:
button.
support.
SNMP Properties window used to enable support.
existing community string, or click Delete to delete a community
string.
SDM would generate based on a read only community string of cisco123 is
Assigns a read-only community string.
Assigns a read-write community string.
Cisco SDM can be used to add, edit, or delete a trap receiver.
displays.
Add in the Trap Receiver section of the SNMP Properties
window. The Add a Trap Receiver window displays.
connect to the trap receiver. Typically, this is the IP address of the SNMP management station that monitors your
domain. Check with the site administrator to determine the address if unsure.
and click Edit. To delete an existing trap receiver, choose a trap receiver from the trap receiver list and click
Delete.
pane.
21. Network Time
Protocol (NTP)
RFC 1305
2010
Configure NTP Master
//Make NTP
server
(config)# ntp server
{ip-add | hostname} [version number] [key
keyid] [source interface] [prefer]
//allow synchronized by NTP
server
NTP security
//enable authentication feature
authentication-key key-number md5 key-value //defin
key
key key-number //Authen NTP will syn
associations detail //verify
secure []
22. Local AAA
authentication
model
//Enable AAA globally
aaa local authen attempts max-fail [num]
//fail
attempts
lockout
lockout
username ADMIN secret cisco12345
aaa new-model
aaa authentication login default local-
case
aaa authentication login TELNET-LOGIN local-
case
line vty 0 4
aaa local authentication attempts max-fail
10
Firewall Technology
Access Control List (ACLs)
Standard ACLs:
Extended ACLs:
source that is being filtered.
deny} protocol source-add
[source-wildcard][operator operand] destination-add [destination-wildcard] [operator operand] [established]
Apply ACL to an interface:
Apply ACL to VTY line:
class access-list-number {in | out}
remark LAN ACL
deny ip host 192.168.1.6 any
permit tcp 192.168.1.0 0.0.0.255 any established
deny ip any any
exit
Fa0/0
exit
remark DMZ ACL
permit tcp any host 192.168.2.5 eq 25
permit tcp any host 192.168.2.6 eq 80
deny ip any any
exit
Fa0/1
the log parameter. Should be enabled only during attack.
(config)#
access-list 101 permit tcp 192.168.1.0 0.0.0.255 192.168.2.0 0.0.0.255 eq 22 log
Configure Time-Based ACLs
time_range_name
-of-the-week] hh:mm
range employee-time
periodic weekdays 12:00 to 13:00
periodic weekdays 17:00 to 19:00
exit
list 100 permit ip 192.168.1.0 0.0.0.255 any time-range employee-
time
list 100 deny ip any any
FastEthernet 0/1
exit
Troubleshooting Complex ACL Implementations
-lists [access-list-number | access-list-name]
Configuring CBAC
detection, and generation of audits and alerts.
protocol [alert {on | off}] [audit-trail {on | off}] [timeout seconds]
FWRULE smtp alert on audit-trail on timeout
300
on timeout 300
list 101 permit tcp 10.10.10.0 0.0.0.255 any
list 101 permit udp 10.10.10.0 0.0.0.255 any
list 101 permit icmp 10.10.10.0 0.0.0.255 any
list 101 deny ip any any
applied to the internal interface in the inbound direction. The ACL processes traffic initiating from the internal
network prior to leaving the network.
Fa0/0
an extended ACL in which SMTP and HTTP traffic is permitted from the external network to the DMZ network only, and all
other traffic is denied.
list 102 permit tcp any 209.165.201.1 0.0.0.0 eq
80
list 102 permit icmp any any echo-reply
list 102 permit icmp any any
unreachable
list 102 permit icmp any any administratively-
prohibited
list 102 permit icmp any any packet-too-
big
list 102 permit icmp any any
echo &
nbsp;
list 102 permit icmp any any time-
exceeded
list 102 deny ip any any
applied to the interface connecting to the external network in the inbound direction.
S0/0/0
configuration stopped here, all returning traffic, with the exception of ICMP messages, is denied because of the
external ACL. Next, create inspection rules for TCP inspection and UDP inspection.
inspection rules are applied to the internal interface in the inbound direction.
Fa0/0
audits.
Alert:
alert
Audit:
location.
trail
off
Troubleshooting:
sessions
list
parameter
Zone-Based Policy Firewall
Design zone-based firewall
Zones
zones
infrastructure
traffic requirements
Configure ZPF:
(config)# Zone security
zone-name
(config-sec-zone)# description
line-of-description
classes
(config)# Class-map type inspect
[match-any | match-all] class-map-name
(config)# Class-map type inspect
protocol-name [match-any | match-all] class-map-name
access-group {access-group | name access-group-name}
protocol protocol-name
class-map class-map-name
policies
(config)# Policy-map type inspect
policy-map-name
class-name
default
| urlfilter} policy-map
pairs
Zone-pair security
zones
(config)# Zone-pair security
zone-pair-name [source source-zone-name | self] destination [self | destination-
zone-name]
(config-sec-zone-pair)# service-
policy type inspect policy-map-name
(config-if)# zone-member security
zone-name
security INSIDE
sec-zone)# description Inside Network
class-map type inspect FOREXAMPLE
cmap)# match access-group 101
access-list 101 permit ip 10.0.0.0 0.0.0.255 any
map type inspect InsideToOutside
class type ispect FOREXAMPLE
security InsideToOutside source Inside destination Outside
pair)# description Internet Access
pair)# service-policy type inspect InsideToOutside
pair)# interface F0/0
member security Inside
interface S0/0/0.100 point-to-point
member security Outside
Troubleshooting:
session
Implementing Intrusion Prevention
Implementing Intrusion Prevention
1. Configure
IPS
2.
Download the IOS IPS Files
IOS-SXXX-CLI.pkg //signature
package
Realm-cisco.pub.key.txt //public crypto key used by
IOS IPS
3.
Create an IOS IPS configuration Directory in
Flash
Mkdir directory-name
Rename current-name new-name
Dir flash: //verify
4.
Configure an IOS IPS Crypto Key
Crypto key pubkey-chain rsa
Name-key realm-cisco.pub
signature
Key-string
Quit
Exit
Show run //verify
5.
Enable IOS IPS
a.
Identify the IPS rule name and specify the
location
(config)# Ip ips name [rule
name] [optional ACL]
Ip ips name iosips // IPS rule iosips is created
Ip ips name ips list ?
(config)# Ip ips config location flash:directory-name
Ip ips config location flash:ips //IPS
location in flash:ips
b.
Enable SDEE and logging event notification
(config)# Ip http server //if HTTP server not enable,
router cannot respond SDEE
(config)# Ip ips notify sdee //enable IPS SDEE
(config)# Ip ips notify log //enable logging
c.
Configure the signature category
(config)# Ip ips signature-category
(config-ips-category)# Category all
(config-ips-category-action)# Retired true
(config-ips-category-action)# Exit
(config-ips-category)# Category ios_ips
basic
(config-ips-category-action)# Retired false
(config-ips-category-action)# Exit
(config-ips-category)# Exit
[confirm] Y
d.
Apply IPS rule to a
interface
Interface Giga 0/0 //IPS
rule is applied in an incoming direction
Ip ips iosips
in
Exit
Exit
Interface Giga 0/1 //IPS
rule is applied in an incoming & outgoing direction
Ip ips iosips
in
Ip ips iosips
out
Exit
Exit
6.
Load the IOS IPS signature package to the Router
Copy ftp://ftp_user:pwd@Server_IP_Add/signature_package idconf
# Copy
ftp://cisco:cisco@10.1.1.1/IOS-S376-CLI.pkg idconf
# Show
ip ips signature count //verify the signature
2. Modify
Cisco IOS IPS Signature
How to retire
individual signatures, signature 6130 with sbusig
ID of 10.
(config)# ip ips
signature-definition
(config-sigdef)# signature 6130 10
(config-sigdef-sig)# status
(config-sigdef-sig-status)#
retired true
(config-sigdef-sig-status)# exit //3 times
[confirm] Y
How to unretired all signatures that belong to the IOS IPS Basic catregory
(config)#
ip ips signature-category
(config-ips-category)# category ios_ips
basic
(config-ips-category-action)# retired false
(config-ips-category-action)# exit //2times
[confirm] Y
How to change signature actions to alert, drop, and reset for signature
6130 with subsig ID of 10
(config)#
ip ips signature-definition
(config-sigdef)#
signature 6130 10
(config-sigdef-sig)# engine
(config-sigdef-sig-engine)# event-action production-alert
(config-sigdef-sig-engine)# event-action deny-packet-inline
(config-sigdef-sig-engine)# event-action reset-tcp-connection
(config-sigdef-sig-engine)# exit //3times
[confirm] Y
How to change event action for
all signature that belong to the signature IOS IPS Basic category
(config)#
ip ips signature-definition
(config-ips-category)# category ios_ips
basic
(config-ips-category-action)# event-action produce-alert
(config-ips-category-action)# event-action deny-packet-inline
(config-ips-category-action)# event-action reset-tcp-connection
(config-ips-category-action)# exit
[confirm] Y
3. Verifying
Cisco IOS IPS
Show ip ips all
Monitor Cisco IOS IPS
(config)#
Logging 192.168.10.100
(config)# Ip ips notify log
(config)#
logging
on
Monitor IPS by SDEE
(config)#
ip http server
(config)#
Ip http secure-server
(config)#
Ip ips notify sdee
(config)#
Ip sdee events 500