Firewall Types and Placement

A computer worm called SQL Slammer began copying itself across the internet just after midnight, East Coast time, on Saturday, January 25, 2003. It was tiny: the whole program was 376 bytes, small enough to fit in a single UDP packet sent to port 1434 on Microsoft SQL Server database software. A packet is one piece of data sent across a network. A port, in this sense, is a number that tells the receiving computer which program the data is for, not a jack on a switch. UDP sends packets without setting up a connection first. Any unpatched server that received the packet was infected and began sending the same packet to random addresses as fast as it could. The number of infected machines doubled about every 8.5 seconds. Within ten minutes it had infected more than 90 percent of the vulnerable computers on the internet, and at least 75,000 were infected in all. The traffic it threw off knocked out thousands of Bank of America's ATMs, delayed Continental Airlines flights, and slowed 911 dispatch in the Seattle area. Microsoft had released a fix six months earlier.
Every Slammer packet looked the same from the outside: a UDP packet to port 1434. Say what a firewall at a company's internet connection needed in order to stop it.
A single line in its list was enough: deny any UDP from outside headed for 1434. Hardly any business needed database servers answering strangers on the internet, so blocking it cost nothing. A firewall that read only each packet's header, its addresses, its protocol, and its port number, would have dropped every copy that arrived through that connection.
A firewall sold as a box of its own, like Cisco's PIX line from the years of Slammer, is a small computer inside. It has a processor, memory, a fan, and a power supply, and it runs an operating system written for filtering traffic.
A flat dark teal box mounted in a black equipment rack, with three small lights labeled Power, Act and Network at the left of its front panel and the words Cisco PIX 515E Firewall at the right.
A Cisco PIX 515E firewall in a rack. Photo: Jakez, CC BY-SA 3.0, via Wikimedia Commons.
An open metal chassis seen from overhead: an empty card bay on the left, a green circuit board with chips, a finned heat sink and memory slots in the middle, and a fan and a boxed power supply on the right.
A PIX 515 with its cover off. Photo: Adamantios, CC BY-SA 3.0, via Wikimedia Commons.

The bus agency's segments

A city bus agency runs several networks that hold very different things. Its IT staff list them with the firewall setting each one gets.
SegmentWhat it holdsWho has to reach itFirewall setting
Trip plannerThe public website with routes and arrival timesAnyone on the internetOpen to web traffic only
OfficeStaff computers, email, the payroll systemStaff; the internet for outgoing browsingModerate
GarageMechanics' computers and diagnostic tools for the busesMechanics; outgoing to the parts supplier's websiteModerate
DispatchThe system that tracks every bus and talks to driversDispatchers, and the buses' radiosStrictest
Each segment sits behind its own firewall, so traffic between the garage and dispatch has to pass one, just like traffic from the internet. Explain why dispatch gets the strictest setting, though it holds no money and no one's personal records.
If dispatch goes down, the agency loses track of its buses and can't reach its drivers, while thousands of people are on board. The segment only has to talk to dispatchers, the buses, and a one-way feed of arrival times out to the trip planner, so its firewall can refuse nearly everything else. The trip planner is the opposite: it has to answer the whole internet, so its firewall admits web traffic and little more.

Stateful and next-generation firewalls

A rule like the one against Slammer judges each packet alone, and a packet can lie about itself. Most web traffic uses TCP, which, unlike UDP, sets up a connection before any data is sent. Say the office firewall admits any TCP packet sent from a website's port, since that is where answers from websites come from. A packet arrives from an address on the internet. It was sent from a website's port, and its header marks it as part of a conversation already under way. A stateless firewall reads the header, finds nothing against it, and passes it. A stateful firewall also keeps track of the connections the office's computers have opened. Its record holds no connection between that address and any office computer, so it drops the packet.
A next-generation firewall goes further and looks inside the traffic. Slammer's packet had a recognizable shape, so a firewall that inspects contents, as next-generation firewalls later did, can match the worm itself, even if the agency had to keep port 1434 open for its own database servers. Reading what packets carry is called deep packet inspection. Stopping an attack as it happens, instead of only reporting it, is called intrusion prevention.

The Davis-Besse plant

Slammer also reached a place it should never have touched: the Davis-Besse nuclear power plant on Lake Erie in Ohio. The plant's network had a firewall that would have stopped the worm. But a contractor's computer network was linked to the plant's business network by a dedicated line that didn't pass through that firewall. The contractor's network was on the internet, so the line was one more way in from the internet that no firewall watched. Slammer came in on the contractor's side and crossed the line. Its traffic shut down the plant's safety parameter display system, which shows operators the reactor's most important readings, for nearly five hours. The plant had been shut down for repairs since 2002, so nothing was at risk that day, but the Nuclear Regulatory Commission warned every plant in the country about the gap.
The internet. One way: the plant's firewall, which would have stopped it. The other way: the contractor's network, on the internet, then a dedicated line with no firewall, the way Slammer came in. Both reach the plant's business network, where Slammer landed. Then the safety parameter display system: down for nearly five hours.
Two ways from the internet into the plant's business network, and the one Slammer took.
An aerial photo of a power plant beside a lake, with a tall concrete cooling tower, a domed reactor building, a parking lot, and canals and marshland around it.
The Davis-Besse Nuclear Power Station on Lake Erie. Photo: U.S. Nuclear Regulatory Commission, public domain, via Wikimedia Commons.
Sources: David Moore and others, "Inside the Slammer Worm," IEEE Security and Privacy (July-August 2003) and CAIDA's analysis (2003); Microsoft Security Bulletin MS02-039 (July 24, 2002); U.S. Nuclear Regulatory Commission, Information Notice 2003-14 (August 29, 2003); Kevin Poulsen, "Slammer worm crashed Ohio nuke plant network," SecurityFocus (August 19, 2003).