Stateful Firewalls. Hank and Foo



Similar documents
Firewall Introduction Several Types of Firewall. Cisco PIX Firewall

Firewalls. configuring a sophisticated GNU/Linux firewall involves understanding

CS5008: Internet Computing

INTRODUCTION TO FIREWALL SECURITY

FIREWALLS. Firewall: isolates organization s internal net from larger Internet, allowing some packets to pass, blocking others

Overview. Securing TCP/IP. Introduction to TCP/IP (cont d) Introduction to TCP/IP

CIT 480: Securing Computer Systems. Firewalls

Firewalls, NAT and Intrusion Detection and Prevention Systems (IDS)

Solution of Exercise Sheet 5

Network Security. Chapter 3. Cornelius Diekmann. Version: October 21, Lehrstuhl für Netzarchitekturen und Netzdienste Institut für Informatik

FIREWALL AND NAT Lecture 7a

Linux MDS Firewall Supplement

CSE331: Introduction to Networks and Security. Lecture 12 Fall 2006

CSE543 - Computer and Network Security Module: Firewalls

CIT 480: Securing Computer Systems. Firewalls

Chapter 8 Security Pt 2

We will give some overview of firewalls. Figure 1 explains the position of a firewall. Figure 1: A Firewall

Firewalls. Pehr Söderman KTH-CSC

+ iptables. packet filtering && firewall

Fig : Packet Filtering

CSC574 - Computer and Network Security Module: Firewalls

Firewalls. Chien-Chung Shen

THE FOCUS OF THIS CHAPTER IS ON STATEFUL firewalls, a type of firewall that attempts

Linux MPS Firewall Supplement

Linux firewall. Need of firewall Single connection between network Allows restricted traffic between networks Denies un authorized users

UNIVERSITY OF BOLTON CREATIVE TECHNOLOGIES COMPUTING AND NETWORK SECURITY SEMESTER TWO EXAMINATIONS 2014/2015 NETWORK SECURITY MODULE NO: CPU6004

How To Understand A Firewall

Introduction to Firewalls Open Source Security Tools for Information Technology Professionals

Firewalls (IPTABLES)

A S B

Firewalls P+S Linux Router & Firewall 2013

Internet Firewall CSIS Internet Firewall. Spring 2012 CSIS net13 1. Firewalls. Stateless Packet Filtering

Firewall Defaults, Public Server Rule, and Secondary WAN IP Address

Chapter 8 Network Security

Firewalls. Ahmad Almulhem March 10, 2012

Firewalls. Firewalls. Idea: separate local network from the Internet 2/24/15. Intranet DMZ. Trusted hosts and networks. Firewall.

Firewalls. Network Security. Firewalls Defined. Firewalls

Chapter 7. Firewalls

CS Computer and Network Security: Firewalls

Introduction to Firewalls

SOFTWARE ENGINEERING 4C03. Computer Networks & Computer Security. Network Firewall

ΕΠΛ 674: Εργαστήριο 5 Firewalls

Cisco Configuring Commonly Used IP ACLs

Firewalls. Chapter 3

Best Practices Guide: Vyatta Firewall. SOFTWARE-BASED NETWORKING & SECURITY FROM VYATTA February 2013

Network Security Management

Lecture 23: Firewalls

Internet Firewall CSIS Packet Filtering. Internet Firewall. Examples. Spring 2011 CSIS net15 1. Routers can implement packet filtering

Topics NS HS12 2 CINS/F1-01

Intro to Firewalls. Summary

Firewalls N E T W O R K ( A N D D ATA ) S E C U R I T Y / P E D R O B R A N D Ã O M A N U E L E D U A R D O C O R R E I A

Internetwork Expert s CCNA Security Bootcamp. IOS Firewall Feature Set. Firewall Design Overview

CS Computer and Network Security: Firewalls

Dos & DDoS Attack Signatures (note supplied by Steve Tonkovich of CAPTUS NETWORKS)

Guideline on Firewall

Firewalls, IDS and IPS

CS 356 Lecture 19 and 20 Firewalls and Intrusion Prevention. Spring 2013

Virtual private network. Network security protocols VPN VPN. Instead of a dedicated data link Packets securely sent over a shared network Internet VPN

Netfilter / IPtables

CIS 433/533 - Computer and Network Security Firewalls

Computer Security CS 426 Lecture 36. CS426 Fall 2010/Lecture 36 1

Firewall. IPTables and its use in a realistic scenario. José Bateira ei10133 Pedro Cunha ei05064 Pedro Grilo ei09137 FEUP MIEIC SSIN

Firewall Design Principles

Classification of Firewalls and Proxies

CYBER ATTACKS EXPLAINED: PACKET CRAFTING

Module: Firewalls. Professor Patrick McDaniel Spring CMPSC443 - Introduction to Computer and Network Security

ΕΠΛ 475: Εργαστήριο 9 Firewalls Τοίχοι πυρασφάλειας. University of Cyprus Department of Computer Science

Firewall Examples. Using a firewall to control traffic in networks

Protecting and controlling Virtual LANs by Linux router-firewall

Securing Networks with PIX and ASA

Chapter 15. Firewalls, IDS and IPS

co Characterizing and Tracing Packet Floods Using Cisco R

CIT 380: Securing Computer Systems

How to protect your home/office network?

PROTECTING INFORMATION SYSTEMS WITH FIREWALLS: REVISED GUIDELINES ON FIREWALL TECHNOLOGIES AND POLICIES

My FreeScan Vulnerabilities Report

Network and Services Discovery

Firewalls. Basic Firewall Concept. Why firewalls? Firewall goals. Two Separable Topics. Firewall Design & Architecture Issues

ECE 578 Term Paper Network Security through IP packet Filtering

Distributed Systems. Firewalls: Defending the Network. Paul Krzyzanowski

CSCE 465 Computer & Network Security

Firewalls and System Protection

A Stateful Inspection of FireWall-1

Security Technology White Paper

Firewalls. Test your Firewall knowledge. Test your Firewall knowledge (cont) (March 4, 2015)

Networking for Caribbean Development

Cryptography and Network Security Prof. D. Mukhopadhyay Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

Securizarea Calculatoarelor și a Rețelelor 13. Implementarea tehnologiei firewall CBAC pentru protejarea rețelei

Linux Networking: IP Packet Filter Firewalling

Network Security 2. Module 2 Configure Network Intrusion Detection and Prevention

1. Firewall Configuration

GregSowell.com. Mikrotik Security

Chapter 5. Figure 5-1: Border Firewall. Firewalls. Figure 5-1: Border Firewall. Figure 5-1: Border Firewall. Figure 5-1: Border Firewall

Guide to Network Defense and Countermeasures Third Edition. Chapter 2 TCP/IP

Security threats and network. Software firewall. Hardware firewall. Firewalls

Linux Firewall Wizardry. By Nemus

Transcription:

Stateful Firewalls Hank and Foo 1

Types of firewalls Packet filter (stateless) Proxy firewalls Stateful inspection Deep packet inspection 2

Packet filter (Access Control Lists) Treats each packet in isolation Operates at network layer (layer 3) of the OSI model Filters based on header information in packet (e.g. src/dst IP address, port) Advantage is speed, application independence, scalability Easy to trick spoofing, fragmenting, etc 3

Proxy firewalls Client doesn t actually communicate directly with server Proxy receives request from client and makes a request to server and returns information to client It can filter the request from client and filter information returned to client Considered application layer filter Slower than packet filter, but more secure Another disadvantage: application specific 4

Stateful inspection Deals with the state of connections State here is vaguely defined as the condition of the connection, which varies greatly depending on application/protocol used Stores the states of legitimate connections in a state table (state information usually stored as hash to make matching faster) Filters packets by matching to valid states in the state table Usually takes more time during setup of a new connection (application layer inspection performed usually only at setup), compared to after 5

Possible state information Src/dst IP address, ports Protocol, flags, sequence, acknowledge numbers ICMP code and type numbers Secondary connection information communicated in application layer headers Application layer specific command sequences (GET, PUT, OPTIONS, etc) 6

How it works Spends most of the time examining packet information in transport layer (layer 4) and lower Can examine application layer information (layer 7), usually during new connection setup If new packet is permitted based on firewall rules/security policy, a new entry is added in the state table After new connection is setup, because later packets match an entry in the state table, there is no need for application layer inspection 7

Advantages More secure than basic packet filtering Faster than proxy firewalls Performs application layer filtering to a certain degree (e.g. FTP session) E.g. iptables classifies each packet as either NEW, ESTABLISHED, RELATED, INVALID For FTP protocol, a control connection is first established When data is transferred, separate connection is established, and iptables will knowingly classify the first packet as RELATED instead of NEW 8

Disadvantages Possibly less secure than proxy firewalls (does not perform true content filtering) 1. Abbreviated application-level inspection (e.g. application-level inspection of initializing packet only allows for malicious application-level behavior in subsequent packets) 2. Lack full application support (e.g. monitors FTP session for port command, but lets other non-ftp traffic pass through FTP port) Slower than basic packet filtering Vulnerable to new attacks (e.g. SYN flood overflows state table so no new connection can be made) 9

TCP Connection-oriented protocol 1. Beginning/end of a session is well defined 2. State of connections tracked with flags Therefore considered a stateful protocol The connection can be in 1 of 11 states, as defined in RFC 793 10

Establishing TCP connection Obtained from Inside Network Perimeter Security: Stateful Firewalls 11

Tearing down TCP connection Obtained from Inside Network Perimeter Security: Stateful Firewalls 12

Obtained from Inside Network Perimeter Security: Stateful Firewalls 13

UDP Connectionless transport protocol have no defined state Pseudo-stateful tracking UDP has no sequence numbers or flags So IP addresses and port numbers used Ephemeral ports are somewhat random, differ for different connections from same IP No set method for connection teardown, so timeout value used to remove entries in state table 14

UDP Cannot correct communication issues by itself, relies entirely on ICMP for error handling Therefore ICMP also important when tracking UDP states E.g. Host 2 may send a ICMP source quench message to host 1 to slow down transmission, firewall must know that this ICMP message is related to the UDP session 15

ICMP Like UDP, not stateful protocol ICMP sometimes used in a request/reply format (e.g. ping echo request, echo reply) This can be tracked For one-way ICMP messages (like error messages) that are precipitated by messages from other protocols, it is more difficult 16

HTTP HTTP uses TCP in a simple manner, easy to track the state Can also do track application-level commands like GET 17

FTP Uses the TCP protocol in a nonstandard way Stateful firewall with no knowledge of FTP will not pass FTP traffic Because control and data connections are separate TCP sessions 18

FTP The port number used by the server initializing the data channel is actually sent to it in an FTP port command from the client, which is why applicationlevel inspection is needed here Obtained from Inside Network Perimeter Security: Stateful Firewalls 19

Examples of stateful firewalls Check Point Firewall-1 Check Point Software Technologies Ltd (they coined the term stateful inspection and patented it) Cisco PIX Cisco Systems Inc iptables (and netfilter) Included in all modern linux distributions Stateful inspection is implemented differently by different vendors 20

iptables Admins create rules specifying what protocols or specific traffic types should be tracked Basic state table entry contains The protocol being used for the connection The source and destination IP addresses The source and destination ports A listing with source and destination IP addresses and ports reversed (to represent response traffic) The time remaining before the rule is removed The TCP state of the connection (for TCP only) The connection-tracking state of the connection 21

Sample state table entry tcp 6 93 SYN_SENT src=192.168.1.34 dst=172.16.2.23 sport=1054 dport=21 [UNREPLIED] src=172.16.2.23 dst=192.168.1.34 sport=21 dport=1054 use=1 [protocol name] [protocol number] [timeout] [state] [src ip] [dst ip] [src port] [dst port (initial connection tagged UNREPLIED)] [return src ip] [return dst ip] tcp 6 41294 ESTABLISHED src=192.168.1.34 dst=172.16.2.23 sport=1054 dport=21 src=172.16.2.23 dst=192.168.1.34 sport=21 dport=1054 [ASSURED] use=1 After connection established, timeout increased greatly 22

Basic rules iptables -A OUTPUT -p tcp -m state --state NEW,ESTABLISHED -j ACCEPT -A: append to existing rules OUTPUT: for output traffic -p tcp: for tcp protocol -m state: use state module -j ACCEPT: parameter to accept such traffic All NEW and ESTABLISHED traffic allowed out, which means no outbound traffic disallowed by this rule 23

Basic rules iptables A INPUT -p tcp -m state --state ESTABLISHED -j ACCEPT Only return traffic allowed into network For UDP, just change previous rules to p udp Same for ICMP (-p icmp), but also add RELATED New modules can be added when new protocols used 24

Deep packet inspection Basically stateful inspection but with visibility into the application layer Not just keeps track of connection information, but looks at the data too (i.e. content filtering) Simply a stateful firewall with limited IDS capabilities built in (NOTHING NOVEL) 25

Firewall clustering for scalability Two general ways to use multiple firewalls 1. Single shared state table, possibly with a dedicated and fast communication channel between firewalls 2. Guarantee packets from the same connection reach the same firewall (using load balancers) 26

References http://dmiessler.com/study/firewalls http://www.wikipedia.org http://www.quepublishing.com/articles/artic le.asp?p=373431&seqnum=1 Sample chapter from book Inside Network Perimeter Security: Stateful Firewalls 27

Packet filtering/classification Given packet P with k fields, and N rules, find rules that P matches to. Many different ways to do this, one way is through bit vectors. Presented here is Aggregated Bit Vector Scheme, which builds on the Lucent Bit Vector Scheme which is Nk/w memory accesses, where w is the size of a word in memory 28

29

References Baboescu and Varghese, Aggregated Bit Vector Search Algorithms for Packet Filter Lookups, http://citeseer.ist.psu.edu/cache/papers/cs/ 27575/http:zSzzSzwwwcse.ucsd.eduzSz~baboescuzSzresearchz Szlookup.pdf/aggregated-bit-vectorsearch.pdf 30