OpenBSD in the wild...a personal journey



Similar documents
FreeBSD Firewalls SS- E Kevin Chege ISOC

Firewalls. Pehr Söderman KTH-CSC

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

Linux: 20 Iptables Examples For New SysAdmins

Track 2 Workshop PacNOG 7 American Samoa. Firewalling and NAT

Protecting and controlling Virtual LANs by Linux router-firewall

+ iptables. packet filtering && firewall

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

Linux Routers and Community Networks

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

Linux Home Networking II Websites At Home

Main functions of Linux Netfilter

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

A host-based firewall can be used in addition to a network-based firewall to provide multiple layers of protection.

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

Netfilter / IPtables

Chapter 7. Firewalls

Linux Server Support by Applied Technology Research Center. Proxy Server Configuration

How To Understand A Firewall

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

IPv6 Firewalls. ITU/APNIC/MICT IPv6 Security Workshop 23 rd 27 th May 2016 Bangkok. Last updated 17 th May 2016

IP Firewalls. an overview of the principles

Firewall implementation and testing

CS Computer and Network Security: Firewalls

Firewalls (IPTABLES)

How to Secure RHEL 6.2 Part 2

Linux Firewalls (Ubuntu IPTables) II

CIT 480: Securing Computer Systems. Firewalls

Firewalls. Chien-Chung Shen

What is included in the ATRC server support

CIT 480: Securing Computer Systems. Firewalls

CSC574 - Computer and Network Security Module: Firewalls

CS Computer and Network Security: Firewalls

Jason Dixon DixonGroup Consulting. September 17, 2005 NYCBSDCON 2005

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

Firewalling with OpenBSD and PF

Intro to Linux Kernel Firewall

How to Turn a Unix Computer into a Router and Firewall Using IPTables

Linux Networking Basics

GregSowell.com. Mikrotik Security

Chapter 6 Configuring the SSL VPN Tunnel Client and Port Forwarding

Linux Firewall Wizardry. By Nemus

Cisco ASA, PIX, and FWSM Firewall Handbook

Firewalls P+S Linux Router & Firewall 2013

DHCP & Firewall & NAT

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

Distributed Systems. Firewalls: Defending the Network. Paul Krzyzanowski

Cisco PIX vs. Checkpoint Firewall

Definition of firewall

Firewalls. Chapter 3

Load Balancing Bloxx Web Filter. Deployment Guide

HOWTO. Bandwidth Management for ADSL with OpenBSD

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

Murus. OS X PF Manual

CSE543 - Computer and Network Security Module: Firewalls

Load Balancing Trend Micro InterScan Web Gateway

CSCI Firewalls and Packet Filtering

COURCE TITLE DURATION LPI-202 Advanced Linux Professional Institute 40 H.

TECHNICAL NOTES. Security Firewall IP Tables

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

Stateful Inspection Technology

Linux Firewall. Linux workshop #2.

Introduction to Firewalls

Enabling NAT and Routing in DGW v2.0 June 6, 2012

INTRODUCTION TO FIREWALL SECURITY

Building a Home Gateway/Firewall with Linux (aka Firewalling and NAT with iptables )

How to Create, Setup, and Configure an Ubuntu Router with a Transparent Proxy.

Configuration Example

IP Address: the per-network unique identifier used to find you on a network

Firewalls. Network Security. Firewalls Defined. Firewalls

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

Open Source Bandwidth Management: Introduction to Linux Traffic Control

Firewalls. Ola Flygt Växjö University, Sweden Firewall Design Principles

Funkwerk UTM Release Notes (english)

7. Firewall - Concept

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

Firewalls. Ahmad Almulhem March 10, 2012

Installing and Configuring Websense Content Gateway

Firewall VPN Router. Quick Installation Guide M73-APO09-380

CIS 433/533 - Computer and Network Security Firewalls

How to protect your home/office network?

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

IPv6 Network Security.

10.4. Multiple Connections to the Internet

Firewall. FortiOS Handbook v3 for FortiOS 4.0 MR3

Matthew Rossmiller 11/25/03

Linux Network Security

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

Network Security. Routing and Firewalls. Radboud University Nijmegen, The Netherlands. Autumn 2014

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

Load Balancing Web Proxies Load Balancing Web Filters Load Balancing Web Gateways. Deployment Guide

Linux Networking: IP Packet Filter Firewalling

Manuale Turtle Firewall

Packet filtering with Linux

What is a Firewall? A choke point of control and monitoring Interconnects networks with differing trust Imposes restrictions on network services

Firewalls and System Protection

Firewalls. ITS335: IT Security. Sirindhorn International Institute of Technology Thammasat University ITS335. Firewalls. Characteristics.

Firewalls. Contents. ITS335: IT Security. Firewall Characteristics. Types of Firewalls. Firewall Locations. Summary

Transcription:

OpenBSD in the wild......a personal journey Avik Sengupta Chief Technology Officer Itellix Software Solutions Pvt Ltd 2006 Avik Sengupta. Licensed under Creative Commons by-nc-nd. 1

Agenda OpenBSD Why and How...... In the context of our experiences! 2006 Avik Sengupta. Licensed under Creative Commons by-nc-nd. 2

The context Startup, circa 2002 AD No sysadmin, limited budgets BUT No Compromises in the network On Security On Functionality 2006 Avik Sengupta. Licensed under Creative Commons by-nc-nd. 3

OpenBSD Basics 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 more than 10 years! That was 7 the last time there was a session on OpenBSD in this conference :) Highly portable (i386,sparc,ppc,hppa...etc..) Free, under a BSD Licence 2006 Avik Sengupta. Licensed under Creative Commons by-nc-nd. 4

Our Network Topology 2006 Avik Sengupta. Licensed under Creative Commons by-nc-nd. 5

Internet Router Bandwidth Monitor Firewall NAT Port Redirector VPN gateway Mail Gateway Spam Check Virus Check Caching HTTP proxy Services on our OpenBSD gateway 2006 Avik Sengupta. Licensed under Creative Commons by-nc-nd. 6

Getting Started Just follow the installation instructions My second ever OBSD install went to production! And stayed there! http://www.openbsd.org/faq/faq4.html Only relatively complex issue is disk partitioning Good hardware detection But dont try bleeding edge hardware 2006 Avik Sengupta. Licensed under Creative Commons by-nc-nd. 7

OS, not a distribution Out of the box Dev Environment (gcc 3.3.5 with propolice) SSH server Ntp, dhcp, named (DNS), cvs, apache (chrooted) Advanced Networking: BGP, OSPF, RARP Gateway services: ftp_proxy, tftp_proxy, spamd Security services: Kerberos, IPSec 2006 Avik Sengupta. Licensed under Creative Commons by-nc-nd. 8

Minimal Default Install 2006 Avik Sengupta. Licensed under Creative Commons by-nc-nd. 9

Ports and Packages Packages are pre-compiled binaries, architecture specific (think RPM) Ports are customised makefiles, used to build software from source (think Gentoo) Packages are quicker, Ports are more flexible 2006 Avik Sengupta. Licensed under Creative Commons by-nc-nd. 10

Customising the install Customise daemons in rc.conf Enable NTP Install essential packages Squid - cached http proxy Postfix easier to configure compared to sendmail SpamAssasin ClamAV Anomy Sanitizer Snmpd monitor services using snmp OpenVPN SSL VPN gateway, simplest to setup 2006 Avik Sengupta. Licensed under Creative Commons by-nc-nd. 11

Packet Filter (pf) 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 2006 Avik Sengupta. Licensed under Creative Commons by-nc-nd. 12

pf Rules Our biggest reason to use OpenBSD Looked at other ruleset options Most intuitive rule syntax Easy to understand even for a non-expert Rules contain parameters that match a packet, and then block or pass it Rules can create state Represents an established connection Keyed on 4-tuple: source{ip,port} and dest{ip,port} 2006 Avik Sengupta. Licensed under Creative Commons by-nc-nd. 13

$IPTABLES -P INPUT DROP $IPTABLES -P OUTPUT DROP $IPTABLES -P FORWARD DROP $IPTABLES -N bad_tcp_packets $IPTABLES -N allowed $IPTABLES -N tcp_packets $IPTABLES -N udp_packets Example IPTables script $IPTABLES -A INPUT -p ALL -i $LO_IFACE -s $LO_IP -j ACCEPT $IPTABLES -A INPUT -p ALL -i $LO_IFACE -s $LAN_IP -j ACCEPT $IPTABLES -A INPUT -p ALL -i $LO_IFACE -s $INET_IP -j ACCEPT $IPTABLES -A INPUT -p UDP -i $LAN_IFACE --dport 67 --sport 68 -j ACCEPT $IPTABLES -A INPUT -p ALL -d $INET_IP -m state --state ESTABLISHED,RELATED \ -j ACCEPT $IPTABLES -N icmp_packets $IPTABLES -A INPUT -p TCP -i $INET_IFACE -j tcp_packets $IPTABLES -A bad_tcp_packets -p tcp --tcp-flags SYN,ACK SYN,ACK \ $IPTABLES -A INPUT -p UDP -i $INET_IFACE -j udp_packets -m state --state NEW -j REJECT --reject-with tcp-reset $IPTABLES -A INPUT -p ICMP -i $INET_IFACE -j icmp_packets $IPTABLES -A bad_tcp_packets -p tcp! --syn -m state --state NEW -j LOG \ $IPTABLES -A INPUT -m limit --limit 3/minute --limit-burst 3 -j LOG \ --log-prefix "New not syn:" --log-level DEBUG --log-prefix "IPT INPUT packet died: " $IPTABLES -A bad_tcp_packets -p tcp! --syn -m state --state NEW -j DROP $IPTABLES -A FORWARD -p tcp -j bad_tcp_packets $IPTABLES -A allowed -p TCP --syn -j ACCEPT $IPTABLES -A FORWARD -i $LAN_IFACE -j ACCEPT $IPTABLES -A allowed -p TCP -m state --state ESTABLISHED,RELATED -j ACCEPT $IPTABLES -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT $IPTABLES -A allowed -p TCP -j DROP $IPTABLES -A FORWARD -m limit --limit 3/minute --limit-burst 3 -j LOG \ $IPTABLES -A tcp_packets -p TCP -s 0/0 --dport 21 -j allowed --log-level DEBUG --log-prefix "IPT FORWARD packet died: " $IPTABLES -A tcp_packets -p TCP -s 0/0 --dport 22 -j allowed $IPTABLES -A OUTPUT -p tcp -j bad_tcp_packets $IPTABLES -A tcp_packets -p TCP -s 0/0 --dport 80 -j allowed $IPTABLES -A OUTPUT -p ALL -s $LO_IP -j ACCEPT $IPTABLES -A tcp_packets -p TCP -s 0/0 --dport 113 -j allowed $IPTABLES -A OUTPUT -p ALL -s $LAN_IP -j ACCEPT $IPTABLES -A icmp_packets -p ICMP -s 0/0 --icmp-type 8 -j ACCEPT $IPTABLES -A OUTPUT -p ALL -s $INET_IP -j ACCEPT $IPTABLES -A icmp_packets -p ICMP -s 0/0 --icmp-type 11 -j ACCEPT $IPTABLES -A OUTPUT -m limit --limit 3/minute --limit-burst 3 -j LOG \ IPTABLES -A INPUT -p tcp -j bad_tcp_packets --log-level DEBUG --log-prefix "IPT OUTPUT packet died: " $IPTABLES -A INPUT -p ALL -i $LAN_IFACE -s $LAN_IP_RANGE -j ACCEPT 2006 Avik Sengupta. Licensed under Creative $IPTABLES Commons by-nc-nd. -t nat -A POSTROUTING -o $INET_IFACE -j SNAT --to-source 14

Equivalent PF script set skip on $LO_IFACE nat on egress inet from $LAN_IFACE:network to any -> (egress) scrub in block log pass out inet pass in on (egress) inet proto tcp from any to (self) port { 21, 22, 80, 113 } pass in on (egress) inet proto icmp from any to (self) icmp-type echo-req pass in on $LAN_IFACE inet from $LAN_IFACE:network modulate state 2006 Avik Sengupta. Licensed under Creative Commons by-nc-nd. 15

Advanced PF features Queues and prioritisation Bandwidth reservations Routing (eg. Using multiple uplinks) Anchors and Tables for dynamic ruleset changes Integration with application level proxies Ftp, tftp, transparent squid All features work with Ipv6 Logging (pcap/tcpdump compatible) 2006 Avik Sengupta. Licensed under Creative Commons by-nc-nd. 16

Upgrades Watch for critical patches http://www.openbsd.org/errata.html Patch Strategies Pick and choose patches or Follow -stable Kernel compile from src in either case Binary upgrade supported only on consecutive release (3.9 -> 4) Can't skip a release Ocassional format and install is our preferred option Read the FAQs!! 2006 Avik Sengupta. Licensed under Creative Commons by-nc-nd. 17

Questions? Curiosity killed the cat... or did it? 2006 Avik Sengupta. Licensed under Creative Commons by-nc-nd. 18

Thank You! Resources http://www.openbsd.org/ http://www.openbsd.org/faq/index.html man pf; man pf.conf; man pfctl http://www.openbsd.org/cgi-bin/man.cgi http://www.undeadly.org/ This presentation: http://www.sengupta.net/talks/ 2006 Avik Sengupta. Licensed under Creative Commons by-nc-nd. 19

Final (two) words FAQ man 2006 Avik Sengupta. Licensed under Creative Commons by-nc-nd. 20