Adaptive Distributed Firewall Using Intrusion Detection Lars Strand
Total Page:16
File Type:pdf, Size:1020Kb
UNIVERSITY OF OSLO Department of Informatics Adaptive distributed firewall using intrusion detection Lars Strand UniK University Graduate Center University of Oslo lars (at) unik no 1. November 2004 ABSTRACT Conventional firewalls rely on a strict outside/inside topology where the gateway(s) enforce some sort of traffic filtering. Some claims that with the evolving connectivity of the Internet, the tradi- tional firewall has been obsolete. High speed links, dynamic topology, end-to-end encryption, threat from internal users are all issues that must be addressed. Steven M. Bellovin was the first to propose a “distributed firewall” that addresses these shortcomings. In this master thesis, the design and implementation of a “distributed firewall” with an intrusion detection mechanism is presented using Python and a scriptable firewall (IPTables, IPFW, netsh). PREFACE This thesis is written as a part of my master degree in Computer Science at the University of Oslo, Department of Informatics. The thesis is written at the Norwegian Defence Research Establishment (FFI). Scripting has been one of my favourite activities since I first learned it. Combined with the art of Computer Security, which I find fascinating and non-exhaustive, it had to be an explosive combina- tion. My problem next was to find someone to supervise me. This is where Professor Hans Petter Langtangen at Simula Research Laboratory and Geir Hallingstad, researcher at FFI, stepped in. Hans Petter Langtangen is a masterful scripting guru and truly deserves the title “Hacker”. Geir Hallingstad is expert in the field of computer/network security and gave valuable input and support when designing this prototype. Huge thanks to them both. I would also like to thank Ronny Windvik, researcher at FFI, for lots constructive help during the last intensive months of writing. Also a special thanks to Camilla Rakvåg, for her patience and support during my many late hour hacking session. Lars Strand, November 1st, 2004 - Kjeller Contents 1 Introduction 1 1.1 Background . 1 1.2 Problem . 2 1.3 Purpose . 2 1.4 Limits . 2 1.5 Chapter overview . 3 2 Background 5 2.1 Security . 5 2.1.1 Defining security . 5 2.1.2 Security service - the building blocks . 5 2.1.3 Security policy . 8 2.1.4 Security mechanism . 8 2.1.5 Security architecture . 9 2.2 Threats and Attacks . 10 2.2.1 Threats . 10 2.2.2 Security Attacks . 10 2.3 Cryptography . 16 2.3.1 Encryption . 16 2.3.2 Secure Hash . 19 2.3.3 Message Authentication Code (MAC) . 19 3 Firewall technology 21 3.1 Firewall is a good thing . 21 3.1.1 Simplicity . 21 3.1.2 Buggy programs . 22 3.1.3 Older protocols/programs not designed for security . 22 i 3.1.4 New threats . 22 3.1.5 Logging . 22 3.1.6 Limit exposure . 23 3.2 Firewall limitations . 23 3.2.1 Maintenance . 23 3.2.2 End-to-end principle . 24 3.2.3 Internal traffic . 24 3.2.4 Interpreting the traffic . 25 3.2.5 Single point of failure . 25 3.3 Types of firewalls . 26 3.3.1 Packet filter . 27 3.3.2 Proxy . 29 3.3.3 Network Address Translation (NAT) . 30 3.4 Distributed firewall . 30 3.4.1 Network topology . 30 3.4.2 Distributed design . 31 3.4.3 Discussion . 31 4 Intrusion Detection 35 4.1 Why? . 35 4.2 The intruder . 36 4.3 Damage control . 36 4.4 Different types of intrusion detection . 36 4.4.1 Statistical anomaly detection . 36 4.4.2 Rule-based detection . 37 4.4.3 Network and Host based . 37 4.5 Problems and future direction . 37 5 Scenarios 39 5.1 Scenario 1: A small network . 39 5.2 Scenario 2: A medium sized network . 40 5.3 Scenario 3: A topology independent network . 42 5.4 Scenario 4: A large network . 43 6 Design and implementation 45 ii 6.1 Implementation tools . 45 6.1.1 Development platform . 45 6.1.2 Python . 46 6.1.3 Firewall . 46 6.2 Python Intrusion Detection Environment (PIDE) . 47 6.2.1 How does it work? . 47 6.2.2 Implementation issues . 47 6.2.3 Requirements . 52 6.3 Blackbox - the cryptographic abstraction class . 53 6.3.1 Third party module . 53 6.3.2 The need for padding . 53 6.3.3 The rest of the abstraction layer . 54 6.4 Master and client . 55 6.4.1 Master . 55 6.4.2 Client . 59 6.5 Auxiliary functions . 62 6.5.1 Ping . 62 7 Implementation issues 65 7.1 Discussion of message format . 65 7.1.1 Home-brewed format . 65 7.1.2 XML . 66 7.2 Intrusion detection methods . 69 7.2.1 Network intrusion detection . 69 7.2.2 Host based intrusion detection . 69 7.3 Discussion of encryption keys . 70 7.3.1 Hash output . 70 7.3.2 PBKDF2 . 70 7.4 Discussion of authentication choice . 71 7.4.1 Extensible Authentication Protocol (EAP) . 72 7.4.2 Using SSL-socket . 72 7.4.3 Authentication choice . ..