Firewalls. Pehr Söderman KTH-CSC Pehrs@kth.se



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

Track 2 Workshop PacNOG 7 American Samoa. Firewalling and NAT

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

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

+ iptables. packet filtering && firewall

Chapter 7. Firewalls

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

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

Lab Objectives & Turn In

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

Linux Firewall Wizardry. By Nemus

CS Computer and Network Security: Firewalls

Network Defense Tools

Introduction to Firewalls

CSC574 - Computer and Network Security Module: Firewalls

CS Computer and Network Security: Firewalls

Security Technology: Firewalls and VPNs

Firewall Firewall August, 2003

Netfilter / IPtables

How to Secure RHEL 6.2 Part 2

FIREWALLS & CBAC. philip.heimer@hh.se

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

Packet filtering with Linux

How To Understand A Firewall

Firewalls. Chapter 3

Stateful Firewalls. Hank and Foo

Firewalls and VPNs. Principles of Information Security, 5th Edition 1

A S B

How To Set Up A Network Map In Linux On A Ubuntu 2.5 (Amd64) On A Raspberry Mobi) On An Ubuntu (Amd66) On Ubuntu 4.5 On A Windows Box

Main functions of Linux Netfilter

Network Security Management

8. Firewall Design & Implementation

Firewalls. Chien-Chung Shen

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

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

CIT 480: Securing Computer Systems. Firewalls

Firewall implementation and testing

Linux: 20 Iptables Examples For New SysAdmins

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

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

FIREWALL AND NAT Lecture 7a

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

CMPT 471 Networking II

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

IMPLEMENTATION OF INTELLIGENT FIREWALL TO CHECK INTERNET HACKERS THREAT

Project 2: Firewall Design (Phase I)

Firewall Introduction Several Types of Firewall. Cisco PIX Firewall

Guardian Digital WebTool Firewall HOWTO. by Pete O Hara

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

OpenBSD in the wild...a personal journey

Firewalls. configuring a sophisticated GNU/Linux firewall involves understanding

Building Your Firewall Rulebase Lance Spitzner Last Modified: January 26, 2000

Configure a Microsoft Windows Workstation Internal IP Stateful Firewall

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

Topics NS HS12 2 CINS/F1-01

IPv6 Security from point of view firewalls

IBM. Vulnerability scanning and best practices

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

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

CIT 480: Securing Computer Systems. Firewalls

CIS 433/533 - Computer and Network Security Firewalls

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

Linux Network Security

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

How to protect your home/office network?

CSCE 465 Computer & Network Security

Cisco Configuring Commonly Used IP ACLs

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

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

Firewalls. Castle and Moat Analogy. Dr.Talal Alkharobi. Dr.Talal Alkharobi

Linux MDS Firewall Supplement

Network Security CS 192

Linux Networking: IP Packet Filter Firewalling

Solution of Exercise Sheet 5

IPv6 Security Best Practices. Eric Vyncke Distinguished System Engineer

Cisco PIX vs. Checkpoint Firewall

Cryptography and network security

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

Firewalls (IPTABLES)

Focus on Security. Keeping the bad guys out

Chapter 11 Cloud Application Development

Firewalls P+S Linux Router & Firewall 2013

Firewalls. CEN 448 Security and Internet Protocols Chapter 20 Firewalls

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

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

ipchains and iptables for Firewalling and Routing

CSE543 - Computer and Network Security Module: Firewalls

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

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

Guideline on Firewall

Overview. Firewall Security. Perimeter Security Devices. Routers

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

Polycom. RealPresence Ready Firewall Traversal Tips

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

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

Definition of firewall

Transcription:

Firewalls Pehr Söderman KTH-CSC Pehrs@kth.se 1

Definition A firewall is a network device that separates two parts of a network, enforcing a policy for all traversing traffic. 2

Fundamental requirements We can split the network in two parts The trusted part The untrusted part We can create a policy defining the safe traffic We can implement the policy And we can do it fast enough... 3

Packet filter (Stateless firewall) Works on layer 3 (Network/IP) Can be made very fast Requires a small amount of memory This functionality is built into most equipment Useful for network management Not especially powerful security equipment 4

Statefull firewalls Works on layer 4 (Transport layer) Statefull Can be very fast, as state is faster than rules Requires memory to keep state Memory demands grow quickly for large networks Statefull firewalls are the basic scrubbers of your network They will make your life much easier. 5

Application/Proxy firewalls Works on layer 7 (Application layer) Very specialized (new firewall for each application) Useful for protecting vulnerable clients and servers Typically resource intensive (both CPU and memory) May terminate the connection HTTP and SMTP are most popular 6

Personal Firewalls Statefull firewall protecting a single system Have local information Typically only found in windows environments Due to the lacking functionality of the built in firewall Makes little sense for a correctly configured system Can still protect you from shooting your own foot 7

Network Address Translation (NAT) NAT is a hack needed due to the limited IPv4 address space NAT does not offer any security advantage over a firewall NAT is equivalent to a statefull firewall only allowing outgoing connections. 8

Where do we place our firewalls? 9

Border Firewall Hinders network wide attacks Scrubbing traffic to our core Effective against DoS Can enforce network wide policy No P2P Small installations 10

Core network Typically no firewalls are placed in the core Performance Stability This means your core network will most likely to be as dangerous as the Internet 11

Designing networks: DMZ 12

Dial in/vpn Where do we terminate VPN? 1: In core? 2: In internal networks? 3: In DMZ? 4: Somewhere else? What is the dangers of a modem pool on the internal network? 13

Building a firewall: Policy 1.Identify the network applications 2.Identify the vulnerabilities 3.Do a cost-benefit analysis for each application 4.Create a matrix with protection methods 5.Create a firewall ruleset from the matrix 6.Implement the ruleset 14

Identify network Applications Grab paper and pencil Write down the critical network applications in your home network Classify them as: Client (outbound) Server (Inbound) You have a few minutes 15

My network Outbound Inbound HTTP HTTP Domain (DNS) FTP Bittorrent Domain SSH Bittorrent SMTP NTP... (too many to list) Lots of high ports FreeAllegiance Server (DPlay) AFS X 16

Identify vulnerabilities For each service you make accessible you need to consider the security issues For example SMB (Service Message Block) Microsoft file sharing Lets try to identify the vulnerabilities we know... 17

Do a cost-benefit analysis What is the cost of keeping it running? In manpower In security risks What are the benefits of keeping it running? Is it critical? Can we use an alternative (safer) method? Continues with SMB 18

Create a service matrix 19

Describe the ruleset Write down a technology independent description of the rules you want to implement This way you easily spot errors in the rules And can change the hardware later For example: FTP: Allow outgoing anywhere, max 300kbps FTP: Allow incoming to ftp.example.com FTP: Block everything else 20

Implement the ruleset Write the actual implementation Frequently you can use scripts to get it right Once you have implemented the firewall you need to test it hping2 nmap Telnet Nessus netcat 21

Fundamentals of iptables iptables uses three chains of rules Input Forward Output Additional chains can be described A packet can match a rule or use the default rule 22

Designing rules Filter decides which packet to match Jump target decides what to do ACCEPT DROP REJECT LOG CHAIN iptables -A INPUT -p tcp --dport 22 -j DROP iptables -A INPUT -i lo -j ACCEPT iptables -A OUTPUT -o lo -j LOG 23

Using state To save state we need to tell the firewall when to store an entry iptables -A FORWARD -i eth0 -p tcp -m state --state NEW -j ACCEPT We can later recall this state to allow related packets through iptables -A FORWARD -p tcp -m state --state ESTABLISHED,RELATED -j ACCEPT We can also keep state for UDP (how?) 24

Logging One of the most important functions of a firewall is to log data. Iptables uses syslog: iptables -A INPUT -j LOG --log-level 7 --log-prefix "Dropped by firewall: " Frequently you want to limit the amount of data iptables -A INPUT -m limit --limit 15/minute -j LOG Logging can quickly fill harddisks and a common attack is to simply overflow the logs... 25

Anti-spoofing A very important rule is to prevent spoofing In simple configurations use the reverse path check: Does the packet source address match the interface you would route this address to? In iptables this is a kernel flag echo 1 > /proc/sys/net/ipv4/*/rp_filter You don't have to write a rule! But be careful if your routing is asymetric! 26

Scrubbing and normalization Many firewalls have built in scrubbing When using scrubbing the firewall cleans up the traffic by... Defragments packets Enforce MTU, set TTL etc... This is protects against many attacks against bad IP implementations This functionality is not present in iptables 27

How do we block? We can DROP the packet Silent and quick Gives no error message to the user Slows things down for the user Makes it harder to map the firewall We can REJECT the packet Requires a response Gives the user an error message Makes the network seem more responsive Simplifies mapping the firewall 28

Firewall issues: ICMP ICMP requires statefull tracking Some ICMP messages have security issues Today we usually allow ECHO Unreachable Source Quench Do not forget ICMP when writing your rules! How many had ICMP on their original list of services? 29

Firewall issues: Port 80 Today most of the user data goes over port 80 We can not block it... In the other end sits a complex and vulnerable application We can use HTTP proxy and try to scrub data Or we can simply ignore this issue Guess what most people do... 30

Weaknesses of a firewall Is the whole concept valid? 31

Bypassing a firewall Spoofing Fragmentation HTTP TTL DNS Source Route OOB UPNP 32

How to make you firewall useful Read the logs Test the firewall regularly Join the Internet Storm Center www.incidents.org Save packets that seem odd And track down what is going on! Update your policy and configuration regularly 33

Popular firewall implementations Dedicated CheckPoint Cisco IOS Linux: IPTables OpenBSD: PF (PacketFilter) Solaris: IPFilter Windows Windows Firewall ISA Server 34

Conclusions 35

What you should know now What is a firewall? Stateless, Statefull and Application firewalls Placement of firewalls Typical work flow creating a firewall Usage of iptables Limitations of firewalls 36

Additional reading NIST Special publication SP800-41 Guidelines on firewalls and firewall policy RFC 2979 Beyond Fear Schnier looks at what is broken in the security world Internet Storm center http://isc.sans.org/ Daily updates of the current security issues on the net 37

Questions? 38

Extra What do you want to know about: Intrusion Detection Systems Intrusion Prevention Systems? 39