Download presentation
Presentation is loading. Please wait.
Published byVirgil Ellis Modified over 9 years ago
1
© 2003 Avik Sengupta. All Rights Reserved. 1 Secure Firewalls using OpenBSD Avik Sengupta CTO Itellix Software Solutions Pvt Ltd
2
© 2003 Avik Sengupta. All Rights Reserved. 2 Agenda A gentle introduction to OpenBSD Packet Filter Features Network Architecture for PF installation Packet Filter Example and Syntax Advanced Features
3
© 2003 Avik Sengupta. All Rights Reserved. 3 OpenBSD Derived from 4.4 BSD Proactive security Extensive source code audits Integrated cryptography Minimalist default install “Only one remote hole in the default install in 7 years!” Highly portable (i386,sparc,ppc,hppa...etc..) Free, under a BSD Licence
4
© 2003 Avik Sengupta. All Rights Reserved. 4 Packet Filter (pf) Basics Introduced in 2001 in OpenBSD 3.0 Filter TCP/IP traffic and perform Network Address Translation Intercept each IP packet, passing or blocking it Stateless inspection, based on fields in each packet Statefull inspection, keeping track of connections Packet Normalisation
5
© 2003 Avik Sengupta. All Rights Reserved. 5 pf Rules Evaluated from top to bottom Rules contain parameters that match a packet Rules pass or block a packet Last matching rule wins (except 'quick') Rules can create state Represents an established connection Keyed on 4-tuple: source{ip,port} and dest{ip,port} Further state matching packets are passed without rule evaluation
6
© 2003 Avik Sengupta. All Rights Reserved. 6 Example Network Topology
7
© 2003 Avik Sengupta. All Rights Reserved. 7 Lets make a firewall -I Red="fxp0" Green="rl1" Amber="rl2" NoRouteIPs="{127.0.0.0/8, 192.168.0.0/16}” ExtIP="206.7.8.1" PrivateIPs="192.168.2.0/24" DMZIPs="192.168.1.0/24" scrub in all
8
© 2003 Avik Sengupta. All Rights Reserved. 8 Lets make a firewall -II nat on $Red from $InternalIPs to any -> $ExtIP rdr on $Red proto tcp from any to $ExtIP port 80 -> 192.68.1.2 port 80 rdr on $Green proto tcp from any to $ExtIP port 80 -> 192.68.1.2 port 80 block drop in quick on $Red from $NoRouteIPs to any block drop out quick on $Red from any to $NoRouteIPs block in on $Red all pass in on $Red from any to any port 80 flags S/SA keep state
9
© 2003 Avik Sengupta. All Rights Reserved. 9 Lets make a firewall -III block in on $Green all block out on $Green all pass in on $Green from $PrivateIPs to any port {80,21,22,25,10000} flags S/SA modulate state pass out on $Green from $DMZIPs to 192.168.2.10 port 389 keep state pass out on $Green inet proto icmp from $PrivateIPs to any keep state
10
© 2003 Avik Sengupta. All Rights Reserved. 10 Lets make a firewall -IV block in on $Amber all block out on $Amber all pass out on $Amber from any to $DMZIPs port 80 flags S/SA keep state pass in on $Amber from $DMZIPs to $PrivateIPs keep state pass out on $Amber inet proto tcp from $PrivateIPs to $DMZIPs port {ssh,10000} keep state
11
© 2003 Avik Sengupta. All Rights Reserved. 11 Managing the firewall pf is a kernel module userspace control via ioctl() on /dev/pf pfctl – userspace control/config utility display loaded rules reload rulesets statistics manipulate lists manipulate state table
12
© 2003 Avik Sengupta. All Rights Reserved. 12 Advanced PF features Queues and prioritisation Routing (eg. Using multiple uplinks) Anchors and Tables for dynamic ruleset changes Integration with application level proxies All features work with Ipv6 Logging (pcap/tcpdump compatible)
13
© 2003 Avik Sengupta. All Rights Reserved. 13 Thank You! Resources man pf; man pf.conf; man pfctl http://www.benzedrine.cx/pf.html http://www.openbsd.org/faq/pf/index.html “Building Firewalls with OpenBSD and PF” by Jacek Artymiak (July 2003) This presentation: http://www.sengupta.net/talkshttp://www.sengupta.net/talks/
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.