Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSC 382: Computer SecuritySlide #1 Firewalls. CSC 382: Computer SecuritySlide #2 Firewalls 1.What is a firewall? 2.Types of Firewalls 3.Packet Filtering.

Similar presentations


Presentation on theme: "CSC 382: Computer SecuritySlide #1 Firewalls. CSC 382: Computer SecuritySlide #2 Firewalls 1.What is a firewall? 2.Types of Firewalls 3.Packet Filtering."— Presentation transcript:

1 CSC 382: Computer SecuritySlide #1 Firewalls

2 CSC 382: Computer SecuritySlide #2 Firewalls 1.What is a firewall? 2.Types of Firewalls 3.Packet Filtering 4.Proxying 5.Firewall Architectures 6.Bastion Hosts 7.Tunneling and VPNs

3 CSC 382: Computer SecuritySlide #3 What is a Firewall? A software or hardware component that restricts network communication between two computers or networks. In buildings, a firewall is a fireproof wall that restricts the spread of a fire. Network firewall prevents threats from spreading from one network to another.

4 CSC 382: Computer SecuritySlide #4 Internet Firewalls Many organizations/individuals deploy a firewall to restrict access to their network from Internet.

5 CSC 382: Computer SecuritySlide #5 What is a Firewall? (2) A mechanism to enforce security policy –Choke point that traffic has to flow through. –ACLs on a host/network level.

6 What is a Firewall? (2) Policy Decisions: –What traffic should be allowed into network? Integrity: protect integrity of internal systems. Availability: protection from DOS attacks. –What traffic should be allowed out? Confidentiality: protection from data leakage. CSC 382: Computer SecuritySlide #6

7 CSC 382: Computer SecuritySlide #7 Types of Firewalls Packet Filters –Access control based on layer 3+4 (IP + TCP/UDP) headers, such as source and dest address and port. Circuit-level Gateways –TCP (layer 4) gateway –Relay computer copies byte stream from client to server and vice versa. Application Gateways –Application protocol gateway.

8 CSC 382: Computer SecuritySlide #8 Packet Filtering Forward or drop packets based on TCP/IP header information, most often: –IP source and destination addresses –Protocol (ICMP, TCP, or UDP) –TCP/UDP source and destination ports –TCP Flags, especially SYN and ACK –ICMP message type Dual-homed hosts also make decisions based on: –Network interface the packet arrived on. –Network interface the packet will depart on.

9 CSC 382: Computer SecuritySlide #9 Filter Actions Pass –Forward acceptable packet on to destination. Drop –Drop unacceptable packets. Log –Record action taken on packet. –Use syslog to log to internal loghost.

10 CSC 382: Computer SecuritySlide #10 Where to Packet Filter? Gateway Router –Filtering at interface between networks allows control via a choke point. –Can filter spoofed IP addresses. Host –Filter packets on each individual computer. –How to manage thousands of packet filters?

11 CSC 382: Computer SecuritySlide #11 Ingress/Egress Filtering Block spoofed IP addresses Ingress Filtering Drop packets arriving on external interface whose source IP addresses claims to be from internal network. Egress Filtering Drop packets arriving on internal interface whose source IP address is not from internal network.

12 CSC 382: Computer SecuritySlide #12 Creating a Packet Filter 1.Create a security policy for a service. ex: allow only outgoing telnet service 2.Specify security policy in terms of which types of packets are allowed/forbidden. 3.Write packet filter in terms of vendor’s filtering language.

13 CSC 382: Computer SecuritySlide #13 Example: outgoing telnet TCP-based service Outbound packets –Destination port is 23 –Source port is random port >1023 –Outgoing connection established by first packet with no ACK flag set. –Following packets will have ACK flag set. Incoming packets –Source port is 23, as server runs on port 23. –Dest port is high port used for outbound packets. –All incoming packets will have ACK flag set.

14 CSC 382: Computer SecuritySlide #14 Example: outgoing telnet DirSrcDestProtoS.PortD.PortACK?Action OutIntAnyTCP>102323EitherAccept InAnyIntTCP23>1023YesAccept EitherAny EitherDeny 1.Rule allows outgoing telnet packets. 2.Rule allows response packets back in. 3.Rule denies all else, following Principle of Fail- Safe Defaults.

15 CSC 382: Computer SecuritySlide #15 Example: outgoing telnet Fedora Linux /etc/sysconfig/iptables -A RH-Firewall-1-INPUT -m state --state NEW - m tcp -p tcp --dport 23 -j ACCEPT -A RH-Firewall-1-INPUT -m state --state ESTABLISHED,RELATED –m tcp –d tcp –sport 23 -j ACCEPT -A RH-Firewall-1-INPUT -j REJECT

16 CSC 382: Computer SecuritySlide #16 Limitations/Problems Must know details of TCP/UDP port usage of protocol to create filters. Applications only identified by port number –What if external host is running a different TCP protocol on port 23? Order of rules important –Difficulties when adding a new service filter to an existing ruleset.

17 CSC 382: Computer SecuritySlide #17 Example: SMTP DirSrcDestProtoS.PortD.PortACK?Action InExtIntTCPAny25EitherAccept OutIntExtTCPAny>1023EitherAccept OutIntExtTCPAny25EitherAccept InExtIntTCPAny>1023EitherAccept EitherAny EitherDeny Policy: Allow incoming and outgoing SMTP, deny all other services.

18 CSC 382: Computer SecuritySlide #18 Example: SMTP Rules 1+2 allow outgoing SMTP. Rules 3+4 allow incoming SMTP. Rule 5 denies all other protocols. Problem: –What about external user attacking an internal X server on port 23? –Rules 2 + 4 allows all connections where both ends use ports >1023

19 CSC 382: Computer SecuritySlide #19 Example: SMTP DirSrcDestProtoS.PortD.PortACK?Action InExtIntTCP>102325EitherAccept OutIntExtTCP25>1023YesAccept OutIntExtTCP>102325EitherAccept InExtIntTCP25>1023YesAccept EitherAny EitherDeny Solution: Revise rules to consider source port and ACK flag.

20 CSC 382: Computer SecuritySlide #20 Packet Filtering Summary Advantages: –One packet filter can protect an entire network –Efficient (requires little CPU) –Supported by most routers Disadvantages: –Difficult to configure correctly Must consider rule set in its entirety –Difficult to test completely –Performance penalty for complex rulesets Stateful packet filtering much more expensive –Enforces ACLs at layer 3 + 4, without knowing any application details

21 CSC 382: Computer SecuritySlide #21 Stateful Packet Filters Is there a TCP session? Saves packet data to keep state, in order to reconstruct connection at IP level –Even though UDP has no ACK flag, can construct connection by remembering outgoing packet for UDP 53 (DNS) and know that a response should come from that port to the source port of original packet.

22 Proxy-Based Firewalls Figure 2-18 on page 64 Can examine packets at application layer –Examine FTP packet stream for PASV/PORT commands to find return port for ftp data stream. CSC 382: Computer SecuritySlide #22

23 CSC 382: Computer SecuritySlide #23 Proxy Servers Proxy host relays Transport/App connections –Client makes connection to proxy. –Proxy forwards connection to server.

24 Proxy Servers Proxy provides: –Access Control Proxies specified src + dest ports / IP addrs. –Logging –Anonymity CSC 382: Computer SecuritySlide #24

25 CSC 382: Computer SecuritySlide #25 Single Host Firewall Simplest type of firewall—one host acts as a gateway between internal and external networks.

26 CSC 382: Computer SecuritySlide #26 Types of Single Host Firewall Screening Router –Organizations already have a router –Most routers have packet filtering capabilities –Advantages: cheap, simple –Disadvantages: can only do packet filtering Dual-homed Host –Server with two NICs –Advantages Configurable: packet filter, circuit proxy, app proxy –Disadvantages Lower performance than router

27 CSC 382: Computer SecuritySlide #27 Screened Subnet Isolates internal network from external networks by means of a perimeter network, called a DMZ.

28 CSC 382: Computer SecuritySlide #28 Screened Subnet Bastion hosts isolated from internal network –Compromise of a bastion host doesn’t directly compromise internal network. –Bastion hosts also can’t sniff internal traffic, since they’re on a different subnet. No single point of failure –Attacker must compromise both exterior and interior routers to gain access to internal net. Advantages: greater security Disadvantages: higher cost and complexity

29 CSC 382: Computer SecuritySlide #29 Screened Subnet External Access –Filtered: via interior + exterior routers –Proxied: use a bastion host as a proxy server Bastion Hosts –Proxy server –External web/ftp servers –External DNS server –E-mail gateway

30 CSC 382: Computer SecuritySlide #30 Screened Subnet Exterior Router –Simple filtering rules Ingress/Egress Filtering DOS prevention Simple ACLs –May be controlled by ISP Interior Router –Complex filtering rules. –Must protect internal network from bastion hosts as well as external network. Recommendation: use different hardware/software for interior and exterior routers.

31 CSC 382: Computer SecuritySlide #31 Tunneling Tunneling: Encapsulation of one network protocol in another protocol –Carrier Protocol: protocol used by network through which the information is travelling –Encapsulating Protocol: protocol (GRE, IPsec, L2TP) that is wrapped around original data –Passenger Protocol: protocol that carries original data

32 CSC 382: Computer SecuritySlide #32 ssh Tunneling SSH can tunnel TCP connections –Carrier Protocol: IP –Encapsulating Protocol: ssh –Passenger Protocol: TCP on a specific port POP-3 forwarding ssh -L 110:pop3host:110 -l user pop3host –Uses ssh to login to pop3host as user –Creates tunnel from port 110 (leftmost port #) on localhost to port 110 (rightmost post #)of pop3host –User configures mail client to use localhost as POP3 server, then proceeds as normal

33 CSC 382: Computer SecuritySlide #33 Virtual Private Network (VPN) Two or more computers or networks connected by a private tunnel through a public network (typically the Internet.) Requirements: –Confidentiality: encryption –Integrity: MACs, sequencing, timestamps Firewall Interactions –Tunnels can bypass firewall –Firewall is convenient place to add VPN features

34 CSC 382: Computer SecuritySlide #34 Firewall Limitations Cannot protect from internal attacks –May be able to limit access with internal firewalls to a segment of your network. Cannot protect you from user error –Users will still run trojan horses that make it past your AV scanner. Firewall mechanism may not precisely enforce your security policy.

35 CSC 382: Computer SecuritySlide #35 Key Points Almost everything is spoofable. Denial of service attacks are easy. Port scanning –Stealth –OS Fingerprinting Firewalls –Packet filtering –Proxying –DMZ

36 CSC 382: Computer SecuritySlide #36 References 1.Steven Bellovin, “Security Problems in the TCP/IP Protocol Suite”, Computer Communication Review, Vol. 19, No. 2, pp. 32-48, April 1989. 2.Matt Bishop, Introduction to Computer Security, Addison-Wesley, 2005. 3.William Cheswick, Steven Bellovin, and Avriel Rubin, Firewalls and Internet Security, 2 nd edition, 2003. 4.Fyodor, “The Art of Port Scanning,” http://www.insecure.org/nmap/nmap_doc.html http://www.insecure.org/nmap/nmap_doc.html 5.Fyodor, NMAP man page, http://www.insecure.org/nmap/data/nmap_manpage.html http://www.insecure.org/nmap/data/nmap_manpage.html 6.Fyodor, “Remote OS detection via TCP/IP Stack FingerPrinting,” Phrack 54, http://www.insecure.org/nmap/nmap-fingerprinting-article.html 7.Simson Garfinkel, Gene Spafford, and Alan Schwartz, Practical UNIX and Internet Security, 3 rd edition, O’Reilly & Associates, 2003. 8.Johnny Long, Google Hacking for Penetration Testers, Snygress, 2004. 9.Stuart McClure, Joel Scambray, George Kurtz, Hacking Exposed, 3 rd edition, McGraw-Hill, 2001. 10.Ed Skoudis, Counter Hack, Prentice Hall, 2002. 11.Elizabeth Zwicky, Brent Chapman, Simon Cooper, Building Internet Firewalls, 2 nd edition, O’Reilly & Associates, 2000.


Download ppt "CSC 382: Computer SecuritySlide #1 Firewalls. CSC 382: Computer SecuritySlide #2 Firewalls 1.What is a firewall? 2.Types of Firewalls 3.Packet Filtering."

Similar presentations


Ads by Google