karlstad university firewall ge zhang. karlstad university a typical network topology threats...

32
Karlstad University Firewall Ge Zhang

Upload: arron-todd

Post on 14-Dec-2015

220 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Karlstad University Firewall Ge Zhang. Karlstad University A typical network topology Threats example –Back door –Port scanning –…–…

Karlstad University

Firewall

Ge Zhang

Page 2: Karlstad University Firewall Ge Zhang. Karlstad University A typical network topology Threats example –Back door –Port scanning –…–…

Karlstad University

A typical network topology

• Threats example– Back door– Port scanning– …

Page 3: Karlstad University Firewall Ge Zhang. Karlstad University A typical network topology Threats example –Back door –Port scanning –…–…

Karlstad University

Page 4: Karlstad University Firewall Ge Zhang. Karlstad University A typical network topology Threats example –Back door –Port scanning –…–…

Karlstad University

What is Firewall?A single checking point that reacts traffic to and from a

network (pass, discard, block, log)• Design goals

– All traffic from inside to outside and vice versa must pass through the firewall

Internet

Page 5: Karlstad University Firewall Ge Zhang. Karlstad University A typical network topology Threats example –Back door –Port scanning –…–…

Karlstad University

Services by a firewall

• Service control • Direction control • User Control (internal network)• Behavior control (the firewall needs to know the

application protocol)• Logging flow information• Hidden internal topology

Page 6: Karlstad University Firewall Ge Zhang. Karlstad University A typical network topology Threats example –Back door –Port scanning –…–…

Karlstad University

Capabilities and limitations

• Capabilities– Prevent unauthorized traffics– Monitoring security-related events– The platform for Network address translator (NAT) – The platform for IPSec tunnel mode (VPN)

• Limitations– Attacks the bypass the firewall (over other channels)– Internal threats (internal employees cooperate with external

attackers)– Transferring virus-infected programs

Page 7: Karlstad University Firewall Ge Zhang. Karlstad University A typical network topology Threats example –Back door –Port scanning –…–…

Karlstad University

The working flow of a Firewall

if {condition_1} then {action_1}

else if{condition_2} then {action_2}

else if{condition_3} then {action_3}

else if{condition_4} then {action_4}

else if{condition_n} then {action_n}

How to define the conditions?

Page 8: Karlstad University Firewall Ge Zhang. Karlstad University A typical network topology Threats example –Back door –Port scanning –…–…

Karlstad University

Layered TCP/IP model

Page 9: Karlstad University Firewall Ge Zhang. Karlstad University A typical network topology Threats example –Back door –Port scanning –…–…

Karlstad University

Types of firewalls

• Packet-Filtering router• Application-level gateway• Circuit-level gateway

Page 10: Karlstad University Firewall Ge Zhang. Karlstad University A typical network topology Threats example –Back door –Port scanning –…–…

Karlstad University

Packet-Filtering router (1)

External network

Internal network

Security perimeter

IP headers

TCP/UDP headers

• Packet-Filtering Firewall– Applies a set of rules– Decides forwarding or discarding the packet– Only examine the header, do not “see inside” a packet

Page 11: Karlstad University Firewall Ge Zhang. Karlstad University A typical network topology Threats example –Back door –Port scanning –…–…

Karlstad University

Packet-Filtering router (2)source destination protocol dest. port action

Ane_home Ane_work any any Allow

any SIP proxy Tcp, udp 5060, 5061 Allow

any Mail server Tcp, udp 25 Allow

any Web server tcp 80, 8080 Allow

any any any any Deny

source destination protocol dest. port action

mal1 any any any Deny

mal2 any any any Deny

mal1 any any any Deny

mal3 any any any Deny

any any any any Allow

Page 12: Karlstad University Firewall Ge Zhang. Karlstad University A typical network topology Threats example –Back door –Port scanning –…–…

Karlstad University

Requirements on rule set design

• Consistency: The rules are ordered correctly• Completeness: every packet satisfies at least one

rule in the firewall• Compactness: firewall has no redundant rules

Page 13: Karlstad University Firewall Ge Zhang. Karlstad University A typical network topology Threats example –Back door –Port scanning –…–…

Karlstad University

An example

Interface source destination protocol dest. port action

0 any Web server tcp 80 Allow

0 any Web server any any Deny

0 malicious any any any Deny

1 host any any any Allow

1 any any any any Allow

Internet

Host

Web Server0 1

Malicious

Consistencyerror

Compactnesserror

0 Not malicious host any any ???? Completenesserror

Page 14: Karlstad University Firewall Ge Zhang. Karlstad University A typical network topology Threats example –Back door –Port scanning –…–…

Karlstad University

Improvement

Interface source destination protocol dest. port action

0 malicious any any any Deny

0 any Web server tcp 80 Allow

0 any Web server any any Deny

0 any any any any Allow

1 any any any any Allow

Internet

Host

Web Server0 1

Malicious

Page 15: Karlstad University Firewall Ge Zhang. Karlstad University A typical network topology Threats example –Back door –Port scanning –…–…

Karlstad University

Efficiency of rule setsource destination protocol dest. port action

192.163.0.1 any tcp 80, 8080 Deny

192.163.0.2 any tcp 80, 8080 Deny

192.163.0.3 any tcp 80, 8080 Deny

10.1.1.2 any tcp 80, 8080 Allow

10.1.1.3 any tcp 80, 8080 Allow

source destination protocol dest. port action

192.163.0.* any tcp 80,8080 Deny

10.1.1.* any tcp 80,8080 Allow

Page 16: Karlstad University Firewall Ge Zhang. Karlstad University A typical network topology Threats example –Back door –Port scanning –…–…

Karlstad University

Stateful PF• For TCP connections

– Server ports are mostly fixed (<1024)– Client ports are dynamically used ( from 1024 to 65535)

• Stateful: tightens up the rules for TCP traffic by creating a directory of outbound TCP connections

src Src port des Des port state

192.168.1.100 1030 210.9.88.29 80 established

192.168.1.102 3331 216.32.1.122 25 established

Page 17: Karlstad University Firewall Ge Zhang. Karlstad University A typical network topology Threats example –Back door –Port scanning –…–…

Karlstad University

Pro and cons in PF

• Pro: – Simple, high efficient – Transparent to users

• Con:– Does not work with application-specific vulnerabilities– Limited log information– No user authentication– Difficulty to configure rulesets

Page 18: Karlstad University Firewall Ge Zhang. Karlstad University A typical network topology Threats example –Back door –Port scanning –…–…

Karlstad University

Attacks on a PF

• IP address spoofing: (use spoofed IP address which can be trusted)

• Fragment attacks– Tiny fragment– Overlapping fragment

Page 19: Karlstad University Firewall Ge Zhang. Karlstad University A typical network topology Threats example –Back door –Port scanning –…–…

Karlstad University

IP fragment

• A firewall only inspects the first fragmented one.

IP h. TCP/UDP h. data

IP h. IP h. IP h.

IP h. TCP/UDP h. data

Sender

recipient

intermediaries

Page 20: Karlstad University Firewall Ge Zhang. Karlstad University A typical network topology Threats example –Back door –Port scanning –…–…

Karlstad University

Tiny fragment attack

IP h. TCP/UDP h. data

IP h. IP h. IP h.

IP h. TCP/UDP h. data

Sender

recipient

intermediaries

Not enough information

Page 21: Karlstad University Firewall Ge Zhang. Karlstad University A typical network topology Threats example –Back door –Port scanning –…–…

Karlstad University

Overlapping fragment

IP h. TCP/UDP h. data

IP h. IP h. IP h.

IP h. TCP/UDP h. data

Sender

recipient

intermediaries

Offset 20 Offset 16

Rewrite the overlapped part

Offset 0

Offset 16

Page 22: Karlstad University Firewall Ge Zhang. Karlstad University A typical network topology Threats example –Back door –Port scanning –…–…

Karlstad University

Application-level Gateway (mainly for inbound requests)

HTTP

SIP Inside hostOutside host

FTP

Outside host

• Have more checking parameters (user names, message format, client software version, etc)

• Only deal with allowable applications• More useful log information• Con: high processing overhead

Page 23: Karlstad University Firewall Ge Zhang. Karlstad University A typical network topology Threats example –Back door –Port scanning –…–…

Karlstad University

Circuit level gateway (mainly for outbound requests)

• Based on connections instead of packets• Similar to stateful PF• Perform authentication• Implementations: Socks server

Inside hostOutside host

out

out

out

in

in

in

Page 24: Karlstad University Firewall Ge Zhang. Karlstad University A typical network topology Threats example –Back door –Port scanning –…–…

Karlstad University

Bastion Host

• A secure version of its operating system• A platform for an application-level gateway or

circuit-level gateway• Only support allowed applications• Only support a subset of the standard applications• Needs additional authentication

Page 25: Karlstad University Firewall Ge Zhang. Karlstad University A typical network topology Threats example –Back door –Port scanning –…–…

Karlstad University

Demilitarized Zone (DMZ)

• Demilitarized zone is a subnet that contains and exposes an organization's public services to an external network

• DNS, web server, VoIP server

• Internal network, work stations

Page 26: Karlstad University Firewall Ge Zhang. Karlstad University A typical network topology Threats example –Back door –Port scanning –…–…

Karlstad University

Setup Firewalls in a network

• Screened host firewall (single-homes bastion)

External network

PF

Bastion host

Information server (web, DNS...)

Work station

Work stationWork station

Page 27: Karlstad University Firewall Ge Zhang. Karlstad University A typical network topology Threats example –Back door –Port scanning –…–…

Karlstad University

• Sceened host firewall (dual-homed bastion host)

External network

PF

Bastion host

Information server (web, DNS...)

Work station

Work stationWork station

Page 28: Karlstad University Firewall Ge Zhang. Karlstad University A typical network topology Threats example –Back door –Port scanning –…–…

Karlstad University

• Screened subnet firewall

External network

PF

Bastion host

Information server (web, DNS...)

PF

Internal network

Page 29: Karlstad University Firewall Ge Zhang. Karlstad University A typical network topology Threats example –Back door –Port scanning –…–…

Karlstad University

Practical experiences on firewall itself

• Stealth rule: drop any packet from outside to the firewall

• Insecure firewall management: drop packets to the firewall over insecure protocols (telnet, ftp, x11)

• Limited management machines: firewalls should be managed from a small number of machines

Page 30: Karlstad University Firewall Ge Zhang. Karlstad University A typical network topology Threats example –Back door –Port scanning –…–…

Karlstad University

High-throughput firewall (1)

• Application Specific Integrated Circuit (ASIC)• e.g., netscreen 100 (100Mbps firewall)

Page 31: Karlstad University Firewall Ge Zhang. Karlstad University A typical network topology Threats example –Back door –Port scanning –…–…

Karlstad University

High-throughput firewall (2)

• Load balance

Firewall 1

Internal router

Firewall 2

Firewall n

External router...

Page 32: Karlstad University Firewall Ge Zhang. Karlstad University A typical network topology Threats example –Back door –Port scanning –…–…

Karlstad University

Key points• Types of firewall • Pros and cons of the three types• Ruleset of PF (consistency, completeness, compactness,

efficiency)• Stateful PF• Attack on PF• Bastion host• DMZ• Setup firewalls in a network