A firewall is a typical border control mechanism or perimeter defense. The purpose of a firewall is to block traffic from the outside, but it could also be used to block traffic from the inside. A firewall is the front line defense mechanism against intruders. It is a system designed to prevent unauthorized access to or from a private network. Firewalls can be implemented in both hardware and software, or a combination of both.
Firewall Theory & Architectures
Once a security strategy and network security policy have been decided a means of implementation is required. The generic term “Firewall” is increasingly being used to describe the combination of hardware, software and management activities that are used to effect the policy.
What is an Internet Firewall ?
Internet firewalls are a means of protecting networks by implementing access control to and from the Internet. In practice this is achieved by controlling the means of communication between the two networks, the TCP/IP suite of protocols. [Wack95] describes a Firewall as an approach to security. He uses the term Firewall to mean the strategies and policies and the term Firewall System to refer to the hardware and software elements that implement the policy.
A Firewall System is a collection of components that is placed between two networks and possesses the following properties :
- All traffic from inside to outside, and vice-versa, must pass through it .
- Only authorised traffic, as defined by the security policy, is allowed to pass through it.
- The system itself is immune to penetration.
In other words a Firewall System is a mechanism used to protect a trusted network whilst it is connected to an untrusted network.
Typically, the two networks in question are an organisation’s internal network (trusted) and the Internet (untrusted). But there is nothing in the definition of a firewall that ties the concept to the Internet. Although the majority of firewalls are currently deployed between the Internet and internal networks, there are good reasons for using firewalls when connecting any trusted network with a less trusted network, be it internal or external.
What can a firewall do ?
A firewall can enforce security policy. The firewall is the means by which the network access security policy is implemented. Internet services considered to be insecure can be restricted and access to or from certain hosts can be restricted.
A firewall can log activity effectively.
A firewall can limit your exposure to the untrusted network by controlling/restricting access to/from it to the level defined in the security policy. This includes controlling what users use the Internet for.
A firewall can be a focus for security decisions – a choke point. All traffic to or from the Internet must pass through it. By focusing defences on this point they can reduce internal system security overhead since they allow an organisation to concentrate security efforts on a limited number of machines.
What can’t a firewall do ?
Whilst firewalls provide good protection at the lower levels of the TCP/IP model, they provide almost no protection against higher level protocols.
Notes that any data that is passed by the firewall still has the potential to cause problems which, were these to be exploited deliberately would be labelled as denial of service or data driven attacks. For example a firewall offers no protection against viruses contained in files transferred via ftp or as MIME attachment to an e-mail message.
A firewall can’t protect against malicious insiders. A firewall cannot differentiate between hosts on the same side of a network therefore any Internet Host can spoof any other Internet Host and any internal host can spoof any other internal host.
A firewall can’t protect against connections that don’t go through it (i.e. backdoors). Firewalls can restrict the access to certain facilities and users will sometimes bypass the firewall to gain access to those facilities. A good example would be a firewall that didn’t allow access to the World Wide Web. Users on that network may establish point to point connections with an Internet service provider over a normal telephone line and introduce Internet connectivity behind the firewall. This type of threat can only be addressed by management procedures which are embodied in the organisations security policies.
A firewall can’t protect against completely new threats if the security strategy is different from “deny everything unless specifically permitted.” Again this is dealt with within the security policy by basing it on just such a strategy.
1. Packet Filters
A packet filtering system selectively routes packets between internal and external hosts according to rules that reflect the organisation’s network security policy. Packet filtering may occur in a router, in a bridge, or on an individual host and operates at the network layer.
The type of router used in a packet filtering firewall is called a screening router. It is configured with rules to block or filter protocols and addresses and is installed at the external network gateway. Internal users usually have direct access to the Internet while all or most access to site systems from the Internet is blocked. However, the router could allow selective access to systems and services, depending on the policy. Inherently dangerous services such as NIS, NFS, and X Windows are usually blocked.
The screening router passes or rejects an IP packet based on information contained on the packet’s header.
The main information used is :-
IP Source and Destination Address – By filtering packets on the IP source and destination address the screening router is able to effectively block access to or from any site or host that is not trusted.
TCP or UDP source and destination port – The screening router makes use of the TCP “well known ports” to permit, deny, or re-route access to particular Internet services. For example many firewalls block all inward traffic except for email by rejecting all externally sourced packets bound for any port other than port 25, the Simple Mail Transfer Protocol port. The screening router can also route all World Wide Web traffic (port 80) to a particular host.
A screening router is also able to base routing decisions on information not found in the packet header, for example the source and destination interfaces.
A packet filtering router can implement either of the design policies discussed earlier, however it suffers a number of disadvantages:-
- There is little or no logging capability. It is often therefore difficult for an administrator to determine whether the router has been compromised or is under attack;
- Packet filtering rules are esoteric and difficult to test thoroughly, which may leave a site open to untested vulnerabilities;
- If complex filtering rules are required, the filtering rules may become unmanageable, and
- Each host directly accessible from the Internet will require its own copy of advanced authentication measures.
2. Application Level Gateways
Application level gateways are specialised application or server programs that run on a firewall host. These programs provide a safety barrier between the internal user and the Internet. Instead of connecting to the Internet directly with, say, a World Wide Web browser, the internal user connects to the application level gateway instead. The application level gateway then establishes the connection with the required world wide web server on the Internet and acts as a go-between for the session.
Application gateways operate at the application layer and can therefore provide access controls at the application protocol level and can handle store and forward as well as interactive traffic .
The main disadvantage of application level gateways is that they require special purpose code to provide each service that is relayed. However, this means that they therefore implement a policy of “deny everything unless explicitly permitted” by default, which is often advantageous from a security perspective.
Application level proxies understand the application protocol and are therefore able to control the session based on the operations being requested. For example an application level proxy is able to block FTP PUT commands whilst permitting FTP GET commands.
3. Circuit Level Gateway
Another type of application level gateway is called the circuit level gateway [Ches94]. Circuit-level proxies do not interpret the application protocols but they authenticate the user before establishing the circuits. They relay packets between the two communicating end-points but are not able to do any additional processing or filtering based on the protocol.
The advantage of circuit level gateways is that they provide services for a wide range of different protocols however they require special client software that has had system calls replaced with secure equivalents from a library such as Socks [Kobl92]. This re-introduces the problem that host based security does not scale well. As the size of the network increases the task of managing secure clients becomes increasingly time consuming and prone to error.
The packet filtering technologies that are used in screening routers provide an efficient and general way to control network traffic. They have the advantage that no changes are required to host or client applications because they operate at the transport and network layers. Application level gateways extend control of network traffic to the application layer, and have the advantage that because they can understand the application protocol they can implement a finer degree of control and provide detailed logs.
Firewalls bring these components together to provide extremely effective network based security control. To illustrate this, several “standard” Internet firewall architectures or configurations are presented.
The simplest firewall architecture utilises a dual homed host. A dual-homed host is a computer that has separate network connections to two networks. Such a host could act as a router between the two networks, however, this routing function is disabled when dual-homed hosts are used in firewall architectures.
Because the routing function is disabled the host isolates the two networks from each other whilst retaining the ability to see traffic on both networks. Systems inside the internal network can communicate with the dual homed host via one network interface, and systems on the Internet via the other, however these systems cannot communicate with each other directly.
In a dual homed host architecture the dual homed host itself is critical to the network’s security. Such hosts are often referred to as Bastion Hosts in the firewall literature .
A dual homed host can only provide services by proxying them. Where proxies are not available a screened host or screened subnet architecture provide extra options for providing new and/or untrusted services.
In this architecture, illustrated in figure 4, the primary security is provided by packet filtering and a bastion host sits on the internal network providing the required application.
The screening router’s packet filtering rules are configured such that the bastion host is the only host accessible from the Internet. Connections to the Internet may be routed through an application proxy on the bastion host, or in some cases, allowed directly through the screening router, depending on the network security policy.
The screened host architecture adds an additional layer of security to the dual homed host architecture, as an attacker has to first bypass the screening router, and then the bastion host. on the other hand argues that the screened host architecture, whilst more flexible than the dual homed host architecture, is less secure because the screening router is allowed to pass certain “trusted” services around the bastion host. Noting that the screened host architecture may, at first sight, appear to be less secure than the dual homed host architecture, states that this is misleading as the dual homed host itself may fail in some unexpected way, and that the two are therefore as secure as each other in practice.
However argument still holds – the additional flexibility afforded in the screened host architecture is provided at some cost to security.
With both the dual homed host and screened host architectures, the trusted network is vulnerable if the bastion host is compromised. The impact of the bastion host being compromised can be reduced by isolating it on a perimeter network(10). The simplest way to provide a perimeter network is to add an additional screening router to the screened host architecture. This architecture, illustrated in figure 5, is called the screened subnet architecture. The bastion host is then located on the perimeter network between the two screening routers.
An attacker that successfully compromises the bastion host now will only be able to access the perimeter net. The trusted network is still protected by the internal screening router. Whilst the attacker will be able to use packet sniffer software on the perimeter network, he will not be able to collect passwords for, or to examine sensitive files on, the trusted network unless these are passed via the DMZ, which is itself a security weakness.
Variations of these architectures
The main components of firewalls have been presented, and the main firewall architectures have been examined. There are many variations of these architectures, for example providing internal and external demilitarised zones. These are discussed at some length in the literature. and both provide considerably more detail about additional architectures, and about configuring and implementing those discussed here.
(1) An ordinary router uses each packet’s IP destination address to determine whether or not it can route the packet. A screening router looks more closely at a packet to determine whether or not is should route the packet .
(2)If the router does not filter on source port or filter on inbound as well as outbound packets, it may become difficult to implement a ” deny everything unless specifically permitted” policy.
(3) Presents an architecture for advanced packet filtering and argues screening routers alone can provide effective security.
(4) For application level gateways to be effective some form of IP level segregation between the Internet and the trusted network, such as a screening router or dual-homed host that doesn’t route packets, must have been implemented.
(5) Application level gateways are often called “proxy servers”.
(6) This is because the user connects to the host that is providing the application proxy rather than to the real host on the Internet. The real host’s address must somehow be provided to the application proxy so that it can establish the other half of the connection. In the case of an application level gateway the real address can be included in the application protocol because the application level gateway understands the application protocol. However circuit level gateways do not understand the application protocol and the real address must be provided by some other means, hence the use of modified client software that provides the destination address to the proxy application.
(7) Strictly speaking this is not true, as services could be provided if users are allowed to log in to the dual-homed host itself. However this is a significant security risk and most users find it too inconvenient .
(8) The perimeter network is often referred to as the demilitarised zone (DMZ).
Figure 2: Firewall Architecture