FireWalls(SIC)
FireWalls(SIC)
0.2 FIREWALLCHARACTERISTICs
IBELL94b] lists thc following design goals for a firewall:
1. Alltraffic fron inside to outside, andvice versa, must pass through the firewall.
This is achicved by physically blocking all access to the local nctwork except via
the fircwall.Various configurations are possible,as explaincd later in this chapter.
2. Only authorized traffic, as deined by the local sccurity policy. willbc allowed to
pass Various types of firewalls are uscd, whichimplement various typcsof securi
ty policies, as explained later in this chapter.
3, The firewall itself is immune to penetration.This implies the use of ahardened
syslemwith a secured operating systenm. Trusted computer systems are suitable
forhosting a firewall andoften required in government applications. This topic
is discussed in Chapter 10.
(SMIT97]lists four general techniques that firewalls use to control access and
cnforce the site's security policy. Originally, firewals focused primarily on service
control. but they have since evolved to provide all four:
" Service control: Determines the types of Internet services that can be
accessed. inbound or outbound. The firewall may filter traffic on the basis of
IPaddress, protoçol,or port number; may provide proxy software that receives
and interprets each service request before passing it on; or may host the server
software itself, such as a Web or mail service.
" Direction control:Determines the direction in which particular service
requests may be initiated and allowed to flow through the firewall.
User control: Controls access to aservice according to which user is attempt
ing to access it. This feature is typically applied to users inside the firewall
perimeter (local users). It may also be applied to incoming traffic from
external users;the latter requires some form of secure authentication technol
ogy, such as is provided in IPSec (Chapter 21).
Behavior control: Controls how particular services are used. For example, the
firewall may filter e-mail to eliminate spam, or it may enable external access to
only aportion of the information on a local Web server.
Before proceeding to the details of firewall types and configurations, it is best
to summarize what one can expect from afirewall. The following capabilities are
within the scope of afirewall:
1. Afirewall defines a single choke point that keeps
unauthorized users out of
lhe protected network, prohibits potentially vulnerable services from entering
or leaving the network, and provides protection from various kinds of IP
spoofing and routing attacks. The use of a single choke point simplifies security
managenment becausc security capabilities are consolidated on a single system
orset of systems.
L Afirewall provides a location for monitoring security-related events. Audits and
alarms can be implemented on the firewall system.
PREVENTION:
NSYSTEMS
AND INTRUSION
CHAPTER9/ FIREWALLS
276 3. Afirewallis a convenient platform for several Internet functions that are TEN
security related. These include a network address translator, which maps loca
addresses, and a network management function
addresses to Internet hal auits
or logs Internet usage.
serve as the platformfor IPSec. Using the tunnel mode
4. ity can
described in Chapter 21, the firewall can be used to implement virtua
Afirewall capabil,.
private networks.
have their limitations, including the following:
Fifewalls
1. The firewall cannot protect against attacks that bypass the firewall. Internal
systems may have dial-out capability to connect to an ISP. An internal LAN
may support a modem pool that provides dial-in capability for traveling
employees and telecommuters.
internal threats, such as a dispruntl,
2. The firewall may not protect fully against external attacker
employee or anemployee who unwiltingly cooperates with an
from outside the orpani.
3. An improperly secured wireless LAN may be accessed enterprise network can.
zation. Aninternal firewall that separates portions of an
systems on different
not guard against wireless communications between local
sides of the internal firewall.
used and infected outsie
4. A laptop, PDA, or portable storage device may beinternally.
the corporate network and then attached and used
Afirewall may act as a packet filter. It can operate as a positive filter, allowing to pass
only packets that meet specific criteria,or as a negative filter, rejecting any packet thal
meets certain criteria. Depending on the type of firewall, it may examine one or more
protocol headers in each.packet, the payload of each packet, or the pattern generated
by asequence of packets.In this setion, we look at theprincipal types of firewalls
Packet Filtering Firewall
Apacket fillering firewall applies a set of rules toeach incoming and outgoing lP
packet and then forwards or discards the packet (Figure 9.1b). The firewall is typically
conligured to filter packets going in both directions (from and to the internal ner
work). Filtering rules are based on information contained in a network
packet:
Source IP address: The IP address of the system that originated the IP packet
(e.g., 192.178.1.1)
" Destination IP address: The IP
reach (e.g., 192.168.1.2)
address of the system the IP packet is trying"
" Source and
destination transport-level address: The
or UDP) port
" IP protocol
transport-level
number, which defincs applications such as SNMP or
(e.g".
field: Defines the
transport TELNE
Interface: For a protocol
the packet came firewall with three or more
firom or which interface of theports, which interfacc of the firewall
firewall the
packet destined
is
9.3 7TYPES OF FIREWALLS 277
Internal (protected) network
(e.g: enterprise network) Firewall External (untrusted) network
(e.g: Internet)
port comment
ourhost port theirhost
action
SPIGOT we dont't trust these people
block
connection toour SMTP port
OUR-GW 25
allow
Rule Set B
commnent
ourhost port theirhost port
action
default
biock
Rule Set C
comment
theirhost port
action ourhost port
25 connection to their SMTP port
allow
Rule Set D
comment
ation Src port dest port flags
their
ourpackets to
allow (our host) 25 SMTP port
ACK
their replies
allow 25
RuleSet E
Comment
action Src port dest port flags
our outgoing calls
allow lour hosts)
calls
allow ACK replics to our
tráffic to nonservcrs
allow >1024
3 IYPESOI IREWALLS 279
C. This rule set is intended tospecify that any
inside host can send mail to the outside.
A TCP packet with adestinationport of 25 is routed
tination machine. The problem with this rule is thattothetheuse
SMTP server on the des
of port 25 for SMTP
recciptis only a default; an outside machine could be configured to have some
other
application linked to port 25. As this rule is written. an attacker could gain access to
internal machines bysending packetswith a TCP source port numberof 25.
D. This rule set achieves the intended result that was not achieved in C
take advantage of a feature of TCP connections Once aconnection is set The rules
up. the
ACK Mag of a TCP segment is set toacknowledge segments sent from the other
side. Thus,thisrule set states that it allows |P packets where the source IP address
is one of a list of designated internal hosts and the destination TCPport number
is 25. It also allows incoming packets with a s0urce port number of 25 that include
the ACK lag in the TCP scgment. Note that we explicitly designate source and
destination systems to definc these rules explicitly.
E. This rule set is one approach to handling FTP connections. With FTP. two
TCP connectionsare uscd: acontrolconnection toset up the file transfer and
a data connection for the actual file transfer. The data connection uses a
different port number that is dynamically assigned for the transfer. Most
servers. and hence most attack targets, use low-numbered ports: most out
going calls tend to use a higher-numbered port, typically above 1023. Thus.
this rule set allows
"Packets that originate internally
" Reply packets to a connection initiated by an internal machine
" Packets destined for a high-numberedport onan internal machine
This scheme requires that the systems be conligured so that only the appropri
ate port numbers are in use.
Rule setEpoints out the difficulty in dealing with applications at the packet filter
ing level. Another way to deal with FTP and similar applications iseither stateful packet
filters or an application-level gateway, both described subsequently in this section.
One advantage of a packet filtering firewall is its simplicity. Also. packet filters
typically are transparent to users and are very fast. |WACKO02 lists the following
weaknesses of packet filter firewalls:
Because packet filter firewalls do not examine upper-laver data, they cannot
prevent attacks that employ application-specific vulnerabilities or functions.
For example, a packet filter firewall cannot block specific application com
mands; if a packet filter firewall allows a given application, all functions avait
abte within that application will be permitted.
Because of the limited information available to the firewall, the logging func
tionality present in packet filter firewalls is limited. Packet filter logs normally
Contain the same information used to make access control decisions (sOurce
address, destination address, and traffic type).
Most packet filter firewalls do not support advanced user authenticaton
schemes. Once again, this limitation is mostly due to the lack of upper-layer
functionality by the firewall.
280 CHAPTER 9/FIREWALL
2Application-Level Gateway
An application-level gatewa, also called an application prOAy, dets as a relay.
application-level traffic (Figure 9.ld). The user contactsthe gateway using aTCPIP
application, such as Telnet or FTP, and the gateway asksthe user for the name of the
remote host to be accessed. Whenthe userresponds and provides a valid user lD and
authentication information. the gateway contactsthe applicationon the remote host
and relaysTCP segments containingthe application data between thetWo eNdpoints.
If the gateway does nòtimplementthe proxycode for aspecific application, the ser.
viCe is not supported and cannot beforwarded acrossthe firewall)Further, the gate.
specific features of an
way can be contigured to support
considers
only
acceptable while
application
denying all other featuree thát the
administrator gateways tend to be more secure than packet filters. Rather
networkApplication-levcl
than trying to deal with the numerous possible Combinations that are toobe allowed
andforbidden at the TCP and IPlevel,the application-level gateway necd only scru-
tinize alew allowable applications. In addition, it is casy tolog and audit all incom-
ing traffic
Aprime application level.
at the disadvantage of this type of gateway is the additional processing
connections betw
overhead oneach connection. Ineffect, there are two spliced
the end users, with the gateway at the splice point, and the gateway must examine
and forward all traffic in both direction's. -
Circuit-Level Gateway
Afourth type of firewall is the circuit-level gateway or circuit-level Drory
(Figure 9.le). This can be a stand-alone system or it can be a specialized function
performed by an application-level gateway for certain applications. As with an
application gateway, acircuit-levelgateway does not permit an end-to-end TCP con
nection: rather, the gateway sets up two TCP connections, one between itself and a
TCPuser on an inner host and one between itself and aTCP user on an outside
host. Once the two connections are established, the gateway typically relays´TCP
segments from one connection to the other without examining the contents. The
securityfunction consists of determining which connections willbe allowed.
A typical use of circuit-level gateways is a siluation in which the system
administrator trusts the internal users. The gateway can be configured to support
application-level or proxy service on inbound connections and circuit-level tunc
tions foroutbound connections. In this configuration,the gateway can incur the pro
cessing overhead of examining incoming application data for forbidden functions
but does not incur that overhead on outgoing data.
An example of a circuit-level gatewayimplementation is the SOCKS package
|KOBL92): version 5of SOCKS is specified in RFC 1928.The RFC defines SOCh
in the following fashion:
BAstion Host
(eoxysenuW,
administrator as a criticalstrong
A bastion host is a system identified by the firewall
serves as a platform for an
point in the network's security. Typically, the bastion host a bastion host
application-level or circuit-level gateway. Common characteristics of
are as follows:
The bastion host hardwareplatform executes a secure version of itsoperating
system, making it ahardened system.
"Only the services that the network administrator considers essential are
installed on the bastion host. These could include proxy applications for DNS,
FTP, HTTP, andSMTP.
The bastion host may require additional authentication before a user is allowed
access to the proxy services.In addition, each proxy service may require its own
authentication before granting user access.
Each proxyis configured to support only a subset of the standardapplication's
command Set. y- ot
CHAPTER 9/ FIREWALLS AND INTRUSION
284 PREVENTION
" Each proxy is configured to allow access only to specific
SYSTEMS
means that the limited comnmand/feature set may be host
systems on the protected network. applied only tosystaems. Thiofs
Each proxy, maintains, detailed audit information by subset
connection, andthe duration of each connection. The logging
audit all
tool for discovering and terminating intruder attacks. traf ic, each
log is an
" Each proxy module is a very small software package: essential
work security. Because of its relative simplicity, it is easier to check specifically designedfor net-
Tor security laws. For example, atypical UNIX maillapplication maysuch modules
20.000 lines of code,while a mail proxy may contain fewer than 1000 contain over
" Each proxy is independent of other proxies on the bastion host. If
problem with the operation of any proxy, or if a future there is a
is discov. vuBnerability
ered, it can be uninstalled without affecting the operation of the other
applications. Also, if the user population requires support for a new serieproxy
network administrator caneasily install the required proxy on the bastion hoe
JA proxy generally performs no disk access other than to read its initial confs
uration file. Hence, the portions of the file system containing executable coe
can be made read only. This makes it difficult for an intruder to install Troin
horse sniffers or other dangerous files on the bastion host.
" Each proxy runs as a nonprivileged user in a private andsecured directory on
the bastion host.
,Host-Based Firewalls
A host-based firewall is a software module used to secure an individual host. Such
modules are available in many operating systems or can be provided as an add-on
package. Like conventional stánd-alone firewalls, host-resident firewalls filter and
restrict the flow of packets. A common Jocation for such firewalls is a server. There
are several advantages to the use of a server-based or workstation-based firewall:
Filtering rules can be tailored to the host environment. Specific corporale
Security policies for servers can be implemented, with different filters o
servers used for different application.
Protection is provided independent of
nal attacks must pass through the topology. : Thus both internal and exter-
" Used in firewall.
conjunction withofstand-alone
vides an additional layer.
the
protectio. firewalls,
Anew type the ofhost-based firewall pro
server can be addedto
worknetwork, with its own firewall, without the
firewall configuration. necessity of altering
the net-
Personal
A
on personal
Firewall
wallone sidefirewall
and thecontrols the traffic workstation
ypicfalunctly, ionalipersonal
ty Internet
the can be used orin
the
between
enterprise
a personal computer qrPersonalfire
network on the other side. intranctS
firewall
is a home environment and on corpofate
Computer.In1
software module on the personal
94/RWALLBASING 285
homecrnvironmcnt with multiple computers connected to the Internet. firewall
functionalitlycan.also be housed in arouter that connccts all of the
cable modem, or other home computers
10aDS;, Intcrnet interfacç{
Personal firewalls arc typically much less complex than
firewallsorstand-alonefirewalls." The primary role of the personaleither server-
firewall is tobased
deny
unauthorizcdremote ACCeSs to the computer. The firewall can also
activilyinan attempl to detect and block worms and other malwarémonitor outgoing
An example of a personal firewall is the capability built in to the Mac OS X
operating system. When the user enables the personal firewall in Mac 0S X. all
inbound connections are denied except for those the user explicitly permits Figure 92
showsthis simple interface. The list of inbound services that can be selectively reen-
abled, with their port numbers, includesthe following:
"Personal file sharing (548, 427)
Windows sharing (139)
"Personal Web sharing (80,427)
" Remote login-sSH (22)
" FTP access (20-21,1024-64535 from 20-21)
" Remote Apple events (3031)
" Printer sharing (631,515)
" IChat Rendezvous (5297, 5298)
ITunes Music Sharing (3869)
Servicesrewall Internet
FirewallOn
all services and
Cick Stop to allowinoming network communication to
Stop ports.