An API for dynamic firewall control and its implementation for Linux Netfilter



Similar documents
An operating system independent API for firewall control: design and implementation for Linux

Efficient Transport of VoIP Firewall Control Signaling

Intro to Linux Kernel Firewall

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

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

CS Computer and Network Security: Firewalls

Netfilter. GNU/Linux Kernel version 2.4+ Setting up firewall to allow NIS and NFS traffic. January 2008

Telematics. 14th Tutorial - Proxies, Firewalls, P2P

CS Computer and Network Security: Firewalls

How To Understand A Firewall

Netfilter s connection tracking system

CSC574 - Computer and Network Security Module: Firewalls

Netfilter / IPtables

Main functions of Linux Netfilter

Worksheet 9. Linux as a router, packet filtering, traffic shaping

Chapter 7. Firewalls

CIS 433/533 - Computer and Network Security Firewalls

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

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

Linux Firewalls (Ubuntu IPTables) II

Secure use of iptables and connection tracking helpers

CSE543 - Computer and Network Security Module: Firewalls

Firewalls. Chien-Chung Shen

Load Balancing SIP Quick Reference Guide v1.3.1

Linux Firewall Wizardry. By Nemus

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

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

Firewalls. Firewall types. Packet filter. Proxy server. linux, iptables-based Windows XP s built-in router device built-ins single TCP conversation

Linux Networking: IP Packet Filter Firewalling

Linux Firewall. Linux workshop #2.

Open Source Bandwidth Management: Introduction to Linux Traffic Control

Optimisacion del ancho de banda (Introduccion al Firewall de Linux)

10.4. Multiple Connections to the Internet

Firewalls. October 23, 2015

TECHNICAL NOTES. Security Firewall IP Tables

Fault tolerant stateful firewalling with GNU/Linux. Pablo Neira Ayuso Proyecto Netfilter University of Sevilla

Advanced routing scenarios POLICY BASED ROUTING: CONCEPTS AND LINUX IMPLEMENTATION

Track 2 Workshop PacNOG 7 American Samoa. Firewalling and NAT

+ iptables. packet filtering && firewall

Common VoIP problems, How to detect, correct and avoid them. Penny Tone LLC 1

Linux: 20 Iptables Examples For New SysAdmins

Open Source Firewall

How To Set Up An Ip Firewall On Linux With Iptables (For Ubuntu) And Iptable (For Windows)

SIP: NAT and FIREWALL TRAVERSAL Amit Bir Singh Department of Electrical Engineering George Washington University

Stateful Connection Tracking & Stateful NAT

A Framework for Security Context Migration in a Firewall Secured Virtual Machine Environment

Network Security Exercise 10 How to build a wall of fire

Computer Firewalls. The term firewall was originally used with forest fires, as a means to describe the

Network security Exercise 9 How to build a wall of fire Linux Netfilter

Availability Digest. Redundant Load Balancing for High Availability July 2013

Firewalls. Pehr Söderman KTH-CSC

Netfilter Performance Testing

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

Protecting and controlling Virtual LANs by Linux router-firewall

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

Firewall Builder Architecture Overview

Bridgewalling - Using Netfilter in Bridge Mode

Linux Virtual Server Tutorial

VDSat: Nomadic Satellite-Based VoIP Infrastructure

UK Interconnect White Paper

Project 4: IP over DNS Due: 11:59 PM, Dec 14, 2015

Parallel Firewalls on General-Purpose Graphics Processing Units

TCP Session Load-balancing in Active-Active HA Cluster

Traffic Control in a Linux, Multiple Service Edge Device

Network Defense Tools

OpenFlow with Intel Voravit Tanyingyong, Markus Hidell, Peter Sjödin

Design of a SIP Outbound Edge Proxy (EPSIP)

A SET-BASED APPROACH TO PACKET CLASSIFICATION

Linux Routers and Community Networks

Lecture Objectives. Lecture 6 Mobile Networks: Nomadic Services, DHCP, NAT, and VPNs. Agenda. Nomadic Services. Agenda. Nomadic Services Functions

Comparing Session Border Controllers to Firewalls with SIP Application Layer Gateways in Enterprise Voice over IP and Unified Communications Scenarios

1:1 NAT in ZeroShell. Requirements. Overview. Network Setup

Network management and QoS provisioning - QoS in the Internet

Software Datapath Acceleration for Stateless Packet Processing

Internet infrastructure. Prof. dr. ir. André Mariën

Extracting Performance Metrics from NetFlow in Enterprise Networks

Network Convergence and the NAT/Firewall Problems

VENKATAMOHAN, BALAJI. Automated Implementation of Stateful Firewalls in Linux. (Under the direction of Ting Yu.)

Network File System (NFS) Pradipta De

A Scalable Multi-Server Cluster VoIP System

Linux Cluster Security Neil Gorsuch NCSA, University of Illinois, Urbana, Illinois.

ETM System SIP Trunk Support Technical Discussion

OpenBSD in the wild...a personal journey

ipchains and iptables for Firewalling and Routing

Vesselin Tzvetkov, Holger Zuleger {vesselin.tzvetkov, Arcor AG&Co KG, Alfred-Herrhausen-Allee 1, Eschborn, Germany

Firewalls with IPTables. Jason Healy, Director of Networks and Systems

How To Monitor And Test An Ethernet Network On A Computer Or Network Card

About Firewall Protection

Dissertation Title: SOCKS5-based Firewall Support For UDP-based Application. Author: Fung, King Pong

Network Security Management

How to replicate the fire: HA for netfilter based firewalls

Improving Quality of Service

EarthLink Business SIP Trunking. NEC SV8100 IP PBX Customer Configuration Guide

Transcription:

An API for dynamic firewall control and its implementation for Linux Netfilter 3. Essener Workshop "Neue Herausforderungen in der Netzsicherheit" Jochen Kögel, Sebastian Kiesel, Sebastian Meier jochen.koegel@ikr.uni-stuttgart.de 4. April 2008 Universität Stuttgart Institute of Communication Networks and Computer Engineering (IKR) Prof. Dr.-Ing. Dr. h.c. mult. P. J. Kühn

Agenda Problem statement API requirements and design Implementation for Netfilter Performance evaluation: measurement results Possible improvements Conclusion and Outlook 2

Problem statement Dynamic firewall control Security at network edge: Open firewalls for legitimate connections for VoIP: SIP/SDP and RTP strict policies authorization of SIP sessions open firewall (pinhole) for media stream, parameters negotiated with SIP/SDP two firewall parts: signaling component and media component several approaches possible distributed vs. monolithic (Session Border Controller SBC) packet filter vs. RTP proxy signaling component SIP SIP Proxy RTP text media component firewall 3

Problem statement Dynamic firewall control Approach: distributed + packet filter (using firewall control protocols) server process running on firewall machines manages pinholes accepting only messages from authorized machines session stateful server (SIP B2BUA) extracts RTP-flow parameters from signaling messages authorizes calls signals pinholes to open/close several controlling instances (e.g. also Intrusion Detection Systems) firewall control API? SIP SIP Proxy RTP text SIP B2BUA API? 4

Problem statement Dynamic firewall control Design of firewall control daemon @IKR (SIMCO server) how to open pinholes? - calling command line tools? - using libraries (libiptc, nfnetlink)? daemon runs on different Operating Systems, what about packet filter dependencies? packet filter interface is very OS-specific (and even in Linux there are several) general pinhole API, not only for SIMCO server firewall control API? SIP SIP Proxy RTP text SIP B2BUA API? 5

API design Requirements from firewall control frameworks MIDCOM/SIMCO implementation of Midcom: simple middlebox control protocol (SIMCO), (RFC 4540) NAT + packet filter signaling our focus: packet filter enable (PER) and prohibit (PDR) pinholes (white list) PDR closes affected pinholes (bulk change) pinhole two "address tuples" (transport protocol, address, prefix, port, portrange) ports and address wildcarding inbound/outbound/bidirectional pinhole: five tuple with ranges/prefix, white list problem: multiple packet filters at network edge must be handled by client, independent of packet filters 1st possibility: know routing 2nd possibility: open pinholes in every packet filter 6

API design Requirements from firewall control frameworks IETF NSIS (next steps in signaling) framework for path-coupled signaling idea: signal nodes on path independent of IP routing (e.g. for QoS) generic messaging layer (General Internet Signaling Transport) Datagram/Connection Mode TCP, UDP, IPSec NSIS Signaling Level Protocols (NSLP) on top of GIST NAT/Firewall Control NAT/Firewall control NSLP (draft-ietf-nsis-nslp-natfw-18.txt) authorization possible with tokens (draft-manner-nsis-nslp-auth-03.txt) 7

API design Requirements from firewall control frameworks IETF NSIS (next steps in signaling) pinhole description based on NSIS-flow sub_ports: number of contiguous ports (0..1) typically white list approach for pinholes also traffic blocking mode with EXT messages (for whole prefix, port wildcard) pinhole as five tuple, range definitions are subset of simco white list feasible. Blocking Domain can be mapped 1 to shrinking Domain the 2white list SIP B2BUA SIP B2BUA SIP packet filter NSIS RTP packet filter 8

API design Requirements from firewall control frameworks Requirements open/close pinholes unidirectional pinhole: five tuple (incl. subnets + port ranges) bidirectional: two pinholes for TCP: direction of connection establishment independent of filter implementation (and OS) transaction semantics (typically, several rules are added at once) performance frequent rule changes (VoIP) high packet rate security no control over whole packet filter, only dedicated rule sets controlling entity must not be root, else a compromised firewall control daemon is fatal 9

API design Managing pinholes using the pinhole API features white list approach rules defined by five tuple + prefix length + port range adding rules by definition (returns ID) removing rules by ID simple transaction mechanism 1. start transaction 2. add/delete rules 3. commit 10

API design Implementation aspects The big picture SIMCO enterph NSIS NATFW IDS removeph Application/Daemon uniform interface (OS independent) unpriv. user Clientlib priv. user (root) Backend chains set+chains... BSD translation plugin according to OS/config/kernel capab. kernel chains ipset conntrack nf hipac BSD PF application design independent of operating system use of different packet filter by changing translation plugin use of different packet filters depending on rule type (optimization possible) 11

API design Implementation aspects Frontend keeps all rules/pinholes optimization possible (hook) while still being able to delete rules per ID enables differential updates failure: last known good commit rules as batch to backend socket communication: reuse of SIMCO message definition + added new control messages init add del commit current Transaction Manager rule set management optimized Optimizer last known good Control SIMCO Lite Client internal Interface (via Socket) to Backend 12

API design Implementation aspects Backend processing of frontend requests translation of pinholes to netfilter rules notify frontend about status failure recovery, e.g. frontend crash only Translation module II is packetfilter-dependent internal interface from Frontend Unix Domain Socket Adapter Simco Lite Server Translation I SIMCO >Intern Intern >Netfilter init() flush() add() insert() del() Control commit() Translation II 13

Implementation for Linux Netfilter Mapping rules to Netfilter sockets/applications PREROUTING INPUT OUTPUT POSTROUTING FORWARD IP Stack Legend Netfilter hook packet + metadata 14

Implementation for Linux Netfilter Mapping rules to Netfilter sockets/applications PREROUTING INPUT OUTPUT POSTROUTING FORWARD IP Stack Netfilter Modules Legend Netfilter hook packet + metadata Conntrack iptables/filter Ipset 15

Implementation for Linux Netfilter Mapping rules to Netfilter sockets/applications INPUT OUTPUT PREROUTING...... POSTROUTING FORWARD IP Stack Netfilter Modules Legend Netfilter hook packet + metadata Conntrack iptables/filter Ipset filter rule conditions (match) action (target) 16

Implementation for Linux Netfilter Mapping rules to Netfilter sockets/applications INPUT OUTPUT PREROUTING......... POSTROUTING FORWARD IP Stack packet/flow classification based on hashtable hashtable bitmap tree Netfilter Modules Legend Netfilter hook protocol helper Conntrack iptables/filter Ipset packet + metadata filter rule not shown: details on NAT, mangle conditions (match) action (target) 17

Implementation for Linux Netfilter Mapping rules to Netfilter sockets/applications INPUT OUTPUT PREROUTING......... POSTROUTING FORWARD IP Stack packet/flow classification based on hashtable hashtable bitmap tree Netfilter Modules Legend Netfilter hook protocol helper Conntrack iptables/filter Ipset packet + metadata filter rule not shown: details on NAT, mangle sysadmin s rules controlled by backend conditions (match) action (target) 18

Implementation for Linux Netfilter Netfilter Modules iptables linear search over lists (chains) extensible by sophisticated "matches" connection tracking (contrack) stateful packet filter hash-based connection table determines connection state and stores it to packet metadata ipset hash-, tree- and bitmap based filter modules realized as iptables march stateless nf-hipac (High Performance PAcket Classification) fast for high number of rules possible replacement for chains/tables patch for older kernels pinhole API implemented for tables/chains, since port ranges and subnets required. (conntrack and ipset work for exact match only, nf-hipac is not integrated) 19

Impementation for Linux Netfilter Managing netfilter rules Accessing iptables LibIPTC iptables A.. user space iptables command line parser add() insert() del() flush() init() commit() libiptc table as set of linked lists r1 r2 r3 r4 chain 1 r5 r6 r7 chain 2 parse table compile table kernel space netfilter core r1 r2 r3 r4 r5 r6 r7 table as blob different represenations in user and kernel space translation of complete ruleset before and after modifications 20

Performance Evaluation Measurements with libiptc backend (VoIP Scenario) Parameters 20 ms packetizing time: 100 pps/call (bidirectional), no bursts 2 pinholes per call: asymmetric RTP rate and rule set depending on number of simultaneous cals Pentium 4, 2.53 GHz Measurement Scenarios transaction delay for entering/removing rules without network traffic packet loss and delay for traffic traversing the packet filter 1. legitimate traffic only 2. additionally with "bad" traffic, that will be filtered contributes to overall packet rate check against every rule (other packets match after half of the rules) 21

Performance Evaluation Changing rules Rule entry delay without traffic 45 simultaneous calls 0 500 1000 1500 2000 2500 3000 Transaction delay 40 35 transaction delay (in ms) 30 25 20 15 10 5 0 0 1000 2000 3000 4000 5000 6000 number of rules 22

Performance Evaluation Changing rules Rule deletion delay without traffic 45 simultaneous calls 0 500 1000 1500 2000 2500 3000 Transaction delay 40 35 transaction delay (in ms) 30 25 20 15 10 5 0 0 1000 2000 3000 4000 5000 6000 number of rules 23

Performance Evaluation Throughput Delay and loss over rule size and rate 70 VoIP packets/s (simultaneous calls * 100 1/s) 1k 5k 10k 15k 20k 25k 30k 35k 40k 45k 50k 55k 60k 65k packet delay packet loss 100 60 80 50 packet delay (in ms) 40 30 60 40 packet loss (in %) 20 20 10 0 0 200 400 600 800 1000 1200 Ruleset update size (simultaneous calls * 2) 0 performance sufficient for 500 simultaneous calls 24

Performance Evaluation Throughput Throughput while discarding bad traffic rate of illegitimate packets (DoS) increased until 0.1 % loss occured 180000 160000 140000 VoIP packets/s (simultaneous calls * 100 1/s) 1k 5k 10k 15k 20k 25k 30k 35k 40k 45k 50k VoIP packet rate DoS packet rate Transaction delay 100 80 Total packets/s 120000 100000 80000 60000 60 40 Transaction delay (in ms) 40000 20 20000 0 20 100 200 300 400 500 600 700 800 900 1000 Ruleset update size (simultaneous calls * 2) 0 25

Performance Evaluation Measurement summary Rule management effort mainly depends on ruleset size reason: translation between kernel and user space representations spikes in rule entry delay due to caching effects? saltus at ~4096 rules due to paging effects? Throughput sufficient for ~500 calls (pure good traffic) for dimensioning: consider max packet rate of bad traffic! delay negligible, if not in overload - there are only very small Queues still decent performance for standard hardware e.g. enterprise with 20 Mbit/s link: 250 simultaneous calls (each 80 Kbit/s) performance sufficient, even with DoS traffic corresponds to 5000 users (0.05 Erlang) 26

Possible Improvements Changes in backend to improve performance sockets/applications INPUT OUTPUT PREROUTING......... POSTROUTING FORWARD IP Stack packet/flow classification based on hashtable hashtable bitmap tree Netfilter Modules Legend Netfilter hook protocol helper Conntrack iptables/filter Ipset packet + metadata filter rule not shown: details on NAT, mangle same API but better mapping to netfiter controlled by backend conditions (match) action (target) keep it simple: no additional protocol checks in Conntrack (like checking RTP) 27

Conclusion and Outlook Conclusion API for dynamic firewall control (phapi) designed and implemented can integrate with our SIMCO-Server (sourceforge.net/projects/simco-firewall/) pinhole api implementation (phapi): www.ikr.uni-stuttgart.de/content/firewall/ filter/chains based on linear search perform quite well interaction with Conntrack cannot be easily solved (conntrack must be disabled) Outlook interface between Conntrack and backend keep information about mapping between conntrack entry and pinhole stateful fast filtering resolves interaction issue still use iptables chains for large ranges/wildcards optimal mapping? what is large? How costly are filter rules compared to Conntrack entries? implementation for other packet filters (OpenBSD, Network Processors, FPGA,...) 28