• No results found

Background General Firewall setup Iptables Introduction Iptables commands Limit Function Explanation with icmp and syn floods Zone Alarm

N/A
N/A
Protected

Academic year: 2021

Share "Background General Firewall setup Iptables Introduction Iptables commands Limit Function Explanation with icmp and syn floods Zone Alarm"

Copied!
41
0
0

Loading.... (view fulltext now)

Full text

(1)
(2)

Overview

• Background

• General Firewall setup

• Iptables Introduction

• Iptables commands

• “Limit” Function Explanation with icmp and syn floods

(3)

What is a Firewall?

• Firewall – a

hardware, software, or combination of

(4)

Benefits

• Uninhibited internal LAN traffic

• Ability to leave internal ports open without fear of those ports being abused

(5)

Traffic Control

• Three methods used to control traffic flowing in and out of the network

! Packet Filtering ! Proxy Filtering

(6)

Firewall Configuration

(7)

What You’re Protected From

External packets allowed Security

Level

all packets

LOW

pre-defined ports (web,ssh) and established connections

MIDDLE

none

(8)

What You’re Protected From

• We allow traffic that is expected

! The firewall is responsible for inspecting

connections and packet headers

• We allow all traffic on a few specific ports

(9)

Expected Traffic

• Protects you from floods of packets

! TCP/SYN, PING/REPLY, IP SPOOFING

• Protects you from scans

! Port scans and vulnerability probes

• Blocks unwanted connections

(10)

Port Forwarding

• Biggest security hole in our firewall

• Opened ports to allow traffic to servers

! All incoming data on this specific port is

allowed in, and forwarded to server

– Hackers could exploit this open port

(11)

Demilitarized Zone (DMZ)

• Frontline of protection

• “A network added between a protected network and external network in order to provide an

additional layer of security” -SI Security

• Does not allow external networks to directly reference internal machines

(12)

Common Firewall Configurations

Firewall takes care of passing packets that pass its filtering rules between the internal network and the Internet, and vice versa.

May use IP masquerading but that's all it does.

Also known as a dual-homed host

The two "homes" refer to the two networks that the

firewall machine is part of ! one interface connected to

the outside home

! the other connected to the

inside home.

(13)

Common Firewall Configurations

• The firewall needs only two network cards.

• If you control the router you have access to a second set of packet-filtering capabilities.

• If you don't control the router, your DMZ is totally exposed to the Internet. Hardening a machine enough to live in the DMZ without getting regularly compromised can be tricky.

• The exposed DMZ configuration depends on two things:

! 1) an external router

! 2) multiple IP addresses.

• If you connect via PPP (modem dial-up), or you don't control your external router, or you want to masquerade your DMZ, or you have only 1 IP address, you'll need to do something else. There are two

straightforward solutions to this, depending on your particular problem.

(14)

Common Firewall Configurations

• One solution is to build a second router/firewall.

• Useful if you're connecting via PPP

• Exterior router/firewall (Firewall 1)

! responsible for creating the PPP connection and controls the access to our DMZ zone

• The other firewall (Firewall 2)

! is a standard dual-homed host just

like the one we spoke about at the beginning

• The other solution is to create a three-legged firewall, which is what we are going to talk about next

(15)

Common Firewall Configurations

• Need an additional network adapter in your firewall box for your DMZ.

• Firewall is configured to route packets between the outside world and the DMZ differently than between the outside world and the internal network.

• You can masquerade the machine or machines in the DMZ too, while keeping them functionally separate from protected internal machines.

• The primary disadvantage to the three-legged firewall is the additional complexity. Access to and from the DMZ and to and from the internal network is controlled by one large set of rules. It's pretty easy to get these rules wrong if you're not careful !

(16)

Lab Setup

• Firewall workstations

(17)

Iptables Introduction

• Iptables is a fourth generation firewall tool for Linux

• Requires kernel 2.3.15 or above with netfilter framework

• Iptables inserts and deletes rules from the kernel’s packet filtering table

(18)

How packets traverse the filters

Routing Decision FORWARD INPUT OUTPUT Incoming Outgoing

(19)

How packets traverse the filters

(continued)

• When a packet reaches a circle, that chain determines the fate of the packet

• The chain can say to DROP the packet or ACCEPT it.

(20)

Network Address Translation

Routing Decision PREROUTING Local Process POSTROUTING

(21)
(22)

Masquerading

• Special form of Source NAT

• Dynamically changes source address to that of the firewall

• Simple one-line rule

(23)

Creating your own rules

• Adding/Deleting rules:

! Append a new rule to an existing chain:

iptables –A <chain>

iptables -A PREROUTING -t nat -p tcp -d 1.2.3.4 --dport 80 -j \ DNAT --to 192.168.1.1:80

! Deleting a rule from an existing chain:

iptables –D <chain> <rule info>

iptables -D INPUT --dport 80 -j DROP, iptables -D INPUT 1

• Changing chains:

! Creating a new chain:

(24)

Creating your own rules (contd)

! Delete an empty chain:

iptables –X <name>

iptables –X PERMISSION

! List the rules of a chain:

iptables –L <name>

iptables –L PERMISSION

! Flush a chain (delete all rules in a chain):

iptables –F <name>

(25)

More iptables commands

• Specifying jump

! If a packet matches a specified rule, jump (-j option) to another chain:

iptables –A INPUT –j DROP • Specifying protocol

! Used to specify the protocol, tcp, udp, or icmp (case sensitive) using –p

option.

iptables –A INPUT –p icmp • Specifying inversion

(26)

Iptables commands (contd)

• Specifying interface

! Specified with the ‘-i’ (input) or ‘-o’ (output)

iptables –A INPUT –i eth0 #check packets coming in on interface eth0 • Specifying source/destination

! Can be specified in 4 ways: name (www.cnn.com), IP

(27)

State matching

• Different states are checked to analyze packets (need to have ip_conntrack

module loaded).

• The states that are checked are:

! NEW: A packet that creates a new connection.

! ESTABLISHED: A packet belonging to an existing connection (reply or

outgoing packet).

! RELATED: A packet that is related to, but not part of an existing

(28)

Port Forwarding

• Using NAT table, destination address is changed based on the port

(29)

Defending against ICMP Ping

Floods and tcp syn attack

• Using limit module specified with ‘-m limit’ packets can be restricted based on rate of matches

iptables –A INPUT –p icmp –-icmp-type echo-request \ –m limit –-limit 1/s –-limit-burst 5 –j ACCEPT

(30)

Zone Alarm

• Firewall for the Windows OS.

• Several types of alerts:

! New program alerts: Accept/deny programs to access the internet.

! Repeat program alerts: grant access permission to program that has

already requested before.

! Server program alerts: grant server permission to a program. Caution: Some Trojan horses require server access to execute.

(31)

What is a zone?

• Zone Alarm classifies computer and

networks that you communicate with into good, bad, and unknown zones.

• 3 types:

! Internet Zone: is the “unknown” zone. All computers and networks

belong to this zone until you move them to one of the other zones.

! Trusted Zone: is the “good” zone. Contains all computers you trust.

! Blocked Zone: is the “bad” zone. Contains all computers you distrust

(32)

What is a zone? (contd.)

• When another computer wants to

communicate with your computer – Zone Alarm looks at what zone it belongs to

(33)

Summary

• Firewalls filter unwanted traffic.

• Port Forwarding: big security hole.

• Network Address Translation.

• Use iptables to setup filters.

• State checking.

(34)

Acknowledgements

“Firewall Topologies”, http://www.firewall.cx/firewall_topologies.php Russell, Rusty, “Linux 2.4 Packet Filtering HOWTO”

http://www.netfilter.org/documentation/HOWTO/packet-filtering-HOWTO.html Startup script and basis for rules

Stephens , James C. http://www.sns.ias.edu/~jns/security/iptables/ Steams, William “Adaptive Firewalls with IP Tables”

http://www.ists.dartmouth.edu/IRIA/knowledge_base/adaptive_firewalls.htm Tyson, Jeff, “How Firewalls Work”

http://computer.howstuffworks.com/firewall.htm/

(35)

Hardware Firewalls

• A hardware firewall usually has 3 interfaces

! Inside – Trusted area of the internetwork.

! Outside – Untrusted area of the internetwork ! DMZ – Isolated area of the internetwork with

(36)
(37)

Cisco Firewalls – PIX 515E

• Different modes of configuration

! Unprivileged Mode ! Privileged Mode

! Configuration Mode ! Monitor Mode

• Can type unique short forms of commands in each mode

(38)

Cisco Firewalls – PIX 515E

• ASA – Adaptive Security Algorithm

• Data Flow relative to security levels

! Security Level 100 – For trusted Inside

interface and internal traffic

! Security Level 0 – For untrusted Outside

interface

! Security Level 1-99 – Can be assigned to

(39)

PIX Lab – Network Setup

• Need to get an ECE UNIX account

! Can only access firewall from ECE machines

• ssh into digiconsole.ece-int.gatech.edu

• ssh into 192.168.254.2

! Actual digital console

! Controls all routers and other hardware

(40)

Lab Network - Mini-Net

“BAD ISP” AS 64700 EarthLink “UNIVERSITY” AS 64900 Georgia Tech “ENTERPRISE” AS 64800 Cisco “GOOD ISP” AS 64600 Bellsouth.net Version 9 January 19, 2004 GTISC Mini-Net “TIER 1” AS 64515 UUNET “TIER 1” AS 64514 Abilene Abilene-rtr Cisco 2621-XM Uunet1-rtr Cisco 2621-XM Uunet2-rtr Cisco 3550 Earthlink-rtr Cisco 3550-24-EMI (L3) StorageRus-rtr 1760-K9 Joe-travel-rtr Cisco 1720 Gateway2-rtr Cisco 3550-24-EMI (L3) Admin-rtr Cisco 1760-K9 CoC1-rtr Cisco 1720 P WR OK WI C0A CT/ CH0 A CT/ CH1 WI C0ACT /CH0 A CT/ CH1 ET HACT COL Edge-fwall Cisco PIX-515E Edge1-rtr Cisco 1760-K9 Edge2-rtr Cisco 1760-K9 Gateway-rtr Cisco 1760-K9 Accounting-rtr Cisco 1720 Engineering-rtr Cisco 1720 172.16.7.0/24:107 Bellsouth-rtr Cisco 3550-24-EMI (L3) Cingular-site1-rtr Cisco 1760-K9+NAT Cingular-site2-rtr Cisco 1760-K9+NAT Cingular-hq-rtr Cisco 1760-K9+NAT Cingular-intr1-rtr Cisco 1720 Cingular-intr2-rtr Cisco 1720 Cisco Web Server

Redhat Apache http://www.cisco.com Gatech Webserver Redhat Apache http://www.gatech.edu Gatech-dns Dell Poweredge Root1-dns Dell Poweredge Earthlink-dns Dell Poweredge Bellsouth-dns Dell Poweredge NETWORK/MASK:VLAN Autonomous System

(41)

References

• Cisco Secure PIX Firewalls,David Chapman Jr. and Andy Fox. Cisco Press. 2002.

• http://www.cisco.com/univercd/cc/td/doc/

product/iaabu/pix/

References

Related documents

Since the early 1990s, the concept of ‘Better Regulation’ has been increasingly used to describe a rolling programme of regulatory reform taking place at both European Union (EU)

Skeletor, injured badly from the fall, picks up his Sword of Darkness from the ground and raises it in the air. SKELETOR

Make sure you set the same port filtering on the firewall VM as you’d have with the internal facing DMZ firewall. This will simplify the configuration when you move the VMs in the

Packet Filtering Firewalls Firewall/Router Data Link Network Internet Physical Input Filter Access Rules Data Link Network Router Internal Network Physical Output Filter

© David Morgan 2011 Firewalls Firewalls David Morgan Firewall types Firewall types  Packet filter – linux, iptables-based – Windows XP’s built-in – router device built-ins

# iptables -A INPUT -p tcp --dport 22 -j ACCEPT + Allow inbound web connection:. # iptables -A INPUT -p tcp --dport 80 -j ACCEPT + Set default policy for all other connections:

You can use the iptables command itself to stop the firewall, delete all rules and set default policy to accept: # iptables -F # iptables -X # iptables -t nat -F # iptables -t

Network Security Stateful Firewalls &amp; Edge Router Filtering – Rich Macfarlane 16 You should find that the stateful firewall allows the ICMP return traffic if the ping