| Author: | Herbert Haas |
|---|---|
| Address: | herbert AT perihel DOT at http://www.perihel.at/sec/ |
| Revision: | 0.1 |
| Date: | 2007-08-20 |
| Copyright: | Copyright (c) 2007 Herbert Haas. |
Abstract
This document summarizes important facts about modern firewall features with a strong focus on the Cisco Adaptive Security Appliance (ASA). This is not a tutorial. The reader should already be familiar with security fundamentals. Besides theory, practial issues are exemplified on the basis of Cisco firewall products. If you find any mistakes please send me an E-Mail, thanks!
When a user logs in, the servers are accessed one at a time starting with the first server you specify in the configuration, until a server responds.
This is the Cut-through Proxy configuration. Note that RADIUS automatically returns an ACL in the access-accept message. That is, only when you configure a TACACS+ group you must also use the aaa authorization match command to identify interesting traffic to be authorized.
Note that when the user session arrives at a lower security level interface then there MUST be an interface ACL already configured and this ACL must permit the traffic that should be used for authentication (HTTP, HTTPS, Telnet, FTP). Remember that the user starts by sending e. g. a HTTP request to a server behind the ASA. If this initial request would be denied, then the ASA cannot send a HTTP redirect to the user.
When using TACACS+ for authorization the traffic MUST be authenticated first, otherwise it is denied.
It is recommended to configure aaa authentication secure-http-client whenever HTTP authentication is planned to enforce HTTPS-based authentication.
It is also possible to directly access the authentication pages on the ASA without being redirected using the following URLS:
http://interface_ip:1080/netaccess/connstatus.html https://interface_ip:1443/netaccess/connstatus.html
Use the per-user-override keyword in an access-group command to override the interface ACL with the downloadable ACL:
- Without per-user-override both ACLs must permit the traffic of a user session.
- With per-user-override only the downloaded ACL is used by the ASA.
The track feature uses a monitoring process to check whether a static route is still working. The monitoring process periodically sends ICMP echo requests to the target. If an echo reply is not received within a specified time period, the object is considered down and the associated route is removed from the routing table. A previously configured backup route is used in place of the removed route. Check whether the monitoring target can respond to ICMP echo requests.
The configuration is this:
(config)# route outside 20.5.0.0 255.255.0.0 10.1.1.1 track 999 (config)# sla monitor 7 (config-sla-monitor)# type echo protocol ipIcmpEcho 10.1.1.1 interface outside (config)# sla monitor schedule 7 life forever start-time now (config)# track 999 rtr 7 reachability
Allows for the following parameters:
- <conform-rate> is a rate limit - only applied when <burst-size> is reached
- <burst-size> can be optionally specified - specifies how many instantaneous bytes may be received without applying any rate limitations.
Since 7.2 the input option is available. LLQ traffic is not rate limited. Police and priority cannot be configured together.
Requires that a priority-queue has been configured on particular outbound interfaces first! Optionally some additional parameters can be configured:
(config)# priority-queue outside (config-priority-queue)# queue-limit 2048 (config-priority-queue)# tx-ring-limit 256
Apply the tcp-map:
tcp-map MyTCPMap checksum-verification policy-map XYZ class ABC set connection advanced-options MyTCPMap
The strict option checks:
- whether the number of commas in the PORT and PASV reply commands is exactly five - otherwise the command is truncated and the connection will be closed.
- whether each command ends with <CR><LF> characters as required by the RFC.
- the size of the RETR and STOR commands
- whether command spoofing is performed such as sending the PORT command from the server.
- whether reply spoofing is performed such as sending the PASV reply command (227) from the client.
- whether negotiated ports are within the reserved and forbidden well-known range (1-1023)
- whether command pipelining is performed such as placing commands after the port numbers in the PORT and PASV reply commands.
The ASA supports the following VPN protocols:
There is no GRE support.
Now called SSL-VPN.
Locally terminated by the ASA, then decrypted and forwarded to a configured server.
- Imap4s accepts incoming IMAP4 over SSL (Port 993)
- Pop3s accepts incoming POP3 over SSL (Port 995)
- Smtps accepts incoming SMTP over SSL (Port 988)
Abbreviations:
NOTE: The SSL VPN Client (SVC) can also be used with the ASA!
Here is a onfiguration example with the most important commands:
http server enable webvpn enable outside ! on every interface where webvpn users come in title Smoerebroed WebSeite title-color ... access-list acl_company webtype deny url http://*.company.com url-list MYURLS "CentralServer" http://10.1.1.2 url-list MYURLS "CIFS Share" cifs://10.1.1.3/shared port-forward MYAPPLICATIONS 2023 10.1.1.4 23 ! Telnet to 127.0.0.1:2023 port-forward MYAPPLICATIONS 3023 Termserv 23 ! Telnet to 'Termserv' pop3s server 10.1.1.30 authentication-server-group (inside) MYRADIUS authentication piggyback ! requires established WebVPN HTTPS session (alternatives: aaa|certificate) group-policy MyWEBVPN attributes vpn-tunnel-protocol webvpn webvpn functions url-entry file-access file-entry file-browsing port-forward mapi url-list value MYURLS port-forward value MYAPPLICATIONS filter value MyWebVPNACL tunnel-group MyWebVPN type webvpn nbns-server 10.1.1.100 ! NetBIOS Server if name resolution for CIFS shares required tunnel-group MyWebVPN general-attributes authentication-server-group (inside) MyRADIUS
Three modes:
- Java applet with port forwarding
- Only selected applications such as Telnet, e-mail, SSH, ...
- Tunnel client "SSL VPN Client (SVC)" loaded through Java or ActiveX
- Less than 250 kByte
- Supports all IP based applications !!!
Config steps
- virtual gateway: IP and port for WebVPN, also trustpoint (default: SSLVPN)
- virtual context: define features (e.g. URL list) and connect with virtual gateway - multiple contexts possible
- policy group: within virtual context, used to apply objects such as URL lists, CIFS shares, port fwd definitions
The firewall decides whether to download/upgrade/remove the client software from the remote PC
Client can also be installed manually in advance
Besides TLS also DTLS (Datagram Transport Layer Security) is supported (for realtime traffic)
DTLS is automatically supported but can be disabled:
webvpn enable outside tls-only !!! normally you would omit the latter parameter !!!
You can install multiple clients on the ASA (simply copy into flash) but you must tell the ASA which binary to use:
!!! the latter number is the order for download - place the most needed first !!! # svc image anyconnect-a.bin 1 !!! this could be the windows client (most often used) # svc image anyconnect-b.bin 2 !!! this could be the linux client !!! check: # show webvpn svc
Always enable Dead Peer Detection (DPD) when enabling DTLS because the remote firewalls may use an inactivity timout for UDP traffic.
Basically the transparent FW uses the learning principle similar as a bridge. But there is no flooding if the destination is not found - instead:
- The packet is dropped
- If destination is local then an ARP is sent to learn the associated port
- If destination is not local then a PING is sent to learn the associated port
Simply switch to transparent mode via:
[no] firewall transparent show firewall
Configure management IP address in global config mode:
ip address 10.0.1.1 255.255.255.0
Observe bridging table:
show mac-address-table
Optionally mitigate MITM via ARP inspection:
arp outside 5.4.3.2 000c.abcd.9876 arp inspection outside enable [flood | no-flood]
Add static entries:
mac-address-table static inside 000c.affe.affe
Disable learning e. g. on outside interface:
mac-learn outside disable
If you have two parallel and independent (no FO configuration) firewalls then configure the firewalls to permit BPDU traffic so that the spanning tree can avoid loops. (In active/standby or active/active configurations there is always one active path.)
If a FW thinks that is in a failed state but this is not true (any longer) then reset the state machine via failover reset.
Failure detection
(config)# failover polltime ? configure mode commands/options: <1-15> Poll interval in seconds, default is 1 second interface Configure failover poll interval for the failover interface msec msec keyword, specify milliseconds interval after msec keyword unit Configure failover poll interval for the unit
See Cisco's ASA Model Comparison for a detailed comparison.
See Cisco's ASA Software Version 7.0 for a feature listing.
Here only some important facts are listed:
ASA does not support DHCP requests from a DHCP relay agent.
Also known as NAT zero or NAT exeption.
If combined with an ACL (as usual) such as:
nat (inside) 0 access-list 101
then any host on a lower security level interface can establish a connection to an inside host matched by this ACL. There is no need for an beforegoing outbound connection!
Note that when using nat (inside) 0 0.0.0.0 0.0.0.0 an outside host can only reach an inside host when an outbound connection exists.
Especially when you have redundant ISP connections use the track option with the route command to enable periodic reachability tests via ICMP echo requests. If there is no echo response that route will be removed from the routing table. You can also ping something behind the next hop of course, such as a server.
Here is the general configuration:
(config)# sla monitor 7 !!! any tracking ID will do (config-sla-monitor)# type echo protocol ipIcmpEcho 91.23.45.19 interface outside !!! This is the Next Hop IP (config)# sla monitor schedule 7 life forever start-time now !!! lots of alternative options possible (config)# track 42 rtr 7 reachability !!! associates a tracked static route with the SLA monitoring process (config)# route outside 0.0.0.0 0.0.0.0 91.23.45.19 1 track 42
Also a DHCP learned route can be tracked:
(config-if)# ip address dhcp setroute !!! setroute allows the ASA to learn default gateway via DHCP (config-if)# dhcp client route track 42
It is possible to define an additional default route which is only used for traffic from a tunnel terminating on the ASA:
route dmz 0 0 172.17.9.9 tunneled
Note: Does not work with RPF on that egress interface (here: dmz), TCP interface, and VoIP inspection.
Enable OSPF:
hostname(config)# router ospf 2 hostname(config-router)# network 2.0.0.0 255.0.0.0 area 0
Optionally, set some interface parameters:
hostname(config-router)# interface inside hostname(config-interface)# ospf cost 20 hostname(config-interface)# ospf retransmit-interval 15 hostname(config-interface)# ospf transmit-delay 10 hostname(config-interface)# ospf priority 20 hostname(config-interface)# ospf hello-interval 10 hostname(config-interface)# ospf dead-interval 40
Also on the interface, enable message authentication:
hostname(config-interface)# ospf authentication-key cisco !!! Which password used for RX hostname(config-interface)# ospf message-digest-key 1 md5 cisco !!! Which password used for TX hostname(config-interface)# ospf authentication message-digest !!! Yes, use message authentication
The ASA also supports route-maps and distribute-lists.
Syslog: default facility number is 20 (LOCAL4). Can be changed using the logging facility command. Syslog servers file message based on the facility number in the messages. Eight possible numbers: 16 (LOCAL0) through 23 (LOCAL7)
logging mail critical logging from-address asa11@neimou.com logging recipient-address admin@dahoam.com smtp-server 10.0.0.1 172.16.0.1 ! primary and secondary server
write standby only synchronizes the running-config. Enter copy run start (or write mem) to additionaly save it to the NVRAM.
Configure stateful failover using the failover link <if-name> command.
Specify number of defect interfaces before failover condition:
(config)# failover interface-policy <1-250>
Disable health monitoring on certain uncritical interfaces:
(config)# no monitor-interface ethernet4
Pairs an active and standby physical interface. When the active interface fails, the standby interface becomes active and starts passing traffic. You can assign only two member interfaces to a redundant interface and the interfaces must not have a name assigned.
(config)# interface redundant 1 (config-if)# member-interface gigabitethernet 0/0 !!! the order is important: first one will be active !!! (config-if)# member-interface gigabitethernet 0/1 (config)# interface redundant 2 (config-if)# member-interface gigabitethernet 0/2 (config-if)# member-interface gigabitethernet 0/3
The redundant interface uses the MAC address of the first physical interface that you add. If you change the order of the member interfaces in the configuration, then the MAC address changes to match the MAC address of the interface that is now listed first.
Optionally set the active interface:
(config-if)# redundant-interface redundant1 active-member gigabitethernet0/1
Available since 8.0(2), supports routed, transparent, single and system-context mode.
Two options:
You cannot configure both. ASA password recovery ======================
- Reboot
- Press Escape to enter ROMMON
- confreg 0x41 and reload (will use default config with default passwords)
- copy start run
- edit passwords
- (config)# config-register 0x1
Optionally enter: no service password-recovery (user can only enter ROMMON when the flash is erased)
Another possibility with interactive dialogue:
Press ESC during boot to get into the ROMMON
Enter confreg
Write down the actual register values
Enter 'Y' to the question "Do you wish to change this configuration? y/n [n]:"
During the interactive dialog leave all default values except for "Disable system configuration?" answer 'Y'
Back at the rommon prompt enter 'boot'
When the ASA has reloaded press return at the password prompt
clear the configuration (write erase)
reset the configuration register:
#conf t (config)# config-register 0x00000001 (or whatever you had - this is the default value (short: 0x1))