560 likes | 774 Views
Security of Information Systems Network Defense. Dr. Igor Santos. Contents. Firewall s Types of firewall Packet filtering vs . Application filtering ' Stateless ' vs. ‘ Stateful ' Netfilter / IPTables IDS NIDS HIDS VPN. Firewalls. Firewalls.
E N D
Security of InformationSystemsNetwork Defense Dr. Igor Santos
Contents • Firewalls • Types of firewall • Packetfiltering vs. Applicationfiltering • 'Stateless' vs. ‘Stateful' • Netfilter/IPTables • IDS • NIDS • HIDS • VPN
Firewalls • A system that filterstraffic between networks it, at least two of them • It can be a physical device or a software running on an operating system • A device with two or more network interfaces where filtering rules are established and with them decides whether a connection can be established or not
Firewalls • A firewall system contains a set of default rules for: • Authorizethe connection (allow) • Block the connection (deny) • Reject the connection request without informing to the sender (deny / ignore)
Firewalls • Typesregardingfunctionality • Network layer packet filtering • It works at the network layer (layer 3) • Often also allow filtering at the transport level (level 4) or data link layer (Layer 2) • Application Layer • It works at the application level (level 7) • Application Proxy firewall • Eg HTTP Traffic - filtered by URL → PROXY
Firewalls HTTP URL ApplicationLayer Firewall Protocol+Port IP Packetfiltering Firewall MAC
Firewalls • Software Firewalls • Software that runs over a general-puropose software • Advantages • Highly customizable Settings • Inexpensive flexible and omnipresent hardware • Disadvantages • Difficult to fortify • Several require specific hardware
Firewalls • Hardware firewall • It consists of a black box or 'appliance' • Advantages • It offers more security (Depending on the reliability of the manufacturer) • Disadvantages • More expensive • Less flexible / customizable
Firewalls • Scheme of typical firewall between local network and internet
Firewalls • Scheme firewall between LAN and internet with DMZ zone for exposed servers
Firewalls • Scheme of a firewall between LAN and internet with DMZ zone for exposed servers created with double firewall (perimeter)
Firewalls • ‘Stateless’ firewalls • Analyzes network traffic and filters packets based on source and destination addresses and other static values (network layer - level 3) • Doesn’t process patterns or data streams • Uses simple rules
Firewalls • It does not understand the concept of TCP connection • It does not take into account the possibility of receiving a package that claims to be something that has not been asked • Eg: ACK from source port 80 to port 22 • Examples of 'stateless’ firewall rules : • Allow IP packets with network source 10.0.0 / 8 • Allow UDP packets with destination port 53
Firewalls • ‘Statefull’ firewalls • It does understand the concept of TCP connection • The conditions of the rules can be specified in terms of connections, not only in terms of packets • For example: • Allow related packets through established connections from the internal network • Allow incoming connections to port 80 (http)
Firewalls • Security Policies • Deny • The default is to deny all except those communications that expressly authorized • Accept • They accept and reject all explicitly forbidden communications • Deny is the safest • However, it requires a precise and restrictive communication
Firewalls • Netfilter/IPTables • ‘Statefull' packetfiltering firewall • Netfilteris the part in the kernel and is responsible for packet filtering • Iptables is the user tool to manage Netfilter • Firewalls created this way, are just shell scripts with many calls to the iptables command
Firewalls • iptables: Usage • iptables receives a packet, analyzes their headers and sends it to one of their treatment chaing • Once the package is in a chain, the rules and policies of that chain are checked and once one is satisfied, the associated action is executed (typically ACCEPT, REJECT or DROP) • The order in which rules are written is very important • If the package does not meet the first rule, the next is checked
Firewalls • The changes performed in iptables are not permantly stored in any file • The rules must be written in a shell script and run it at startup
Firewalls • Threeimportantchains • INPUT: incoming packets whose destination address our firewall and are not modified by • cortafuegos y no son modificados por NAT • OUTPUT: output packets • FORWARD: packetswith no source nor destination the firewall itself, but pass through the firewall, and can be modified or not (eg doing NAT: Network Address Translation)
Firewalls • Very simplified diagram of what happens when a packet arrives to iptables
Firewalls • Example • A TCP packetarrivedtothe80 portforour machine • iptablessendsthispakecttotheINPUT chain, becauseitisan input packetforour machine • In the INPUT chain, thereis no defined rule fortheportnumber 80, so thepolicy of INPUT isapplied, whichisDROP (discard)
Firewalls • Set the default policy (ACCEPT or DROP) for one chain (INPUT, OUTPUT, FORWARD) • iptables-P INPUT DROP • iptables -P OUTPUT ACCEPT
Firewalls • Parameters to add rules to a chain • -A: adds a rule to a chain (at the end) • -s: IP of the source machine of a packet • -d:I P of the destiny machine of a packet • -i: interface through which the packet arrives • -o:interface through which the packet is sent
Firewalls • -p: IP protocol of the packet (tcp, udp, icmp) • --sport: origin port of paquete • --dport: destination port of paquete • -j: determines that to do with packets that match a rule • ACCEPT • DROP • REJECT • -L: displays the current firewall rules
Firewalls - Examples • Allow access to our web server • iptables-A INPUT -p TCP --dport 80 -j ACCEPT • Allow access to our FTP server • iptables-A INPUT -p TCP --dport 21 -j ACCEPT • Add a rule to deny all the output packets directed to the IP 80.90.1.30 • iptables-A OUTPUT -d 80.90.1.30 -j DROP
Firewalls - Examples • Add a rule so our machine cannot be pinged • iptables-A INPUT -p icmp -j DROP • Allow the machine with IP 192.168.1.2 connect with our machine through SSH • iptables -A INPUT -s 192.168.1.2 -p TCP --dport 22 -j ACCEPT • iptables -A OUTPUT -d 192.168.1.2 -p TCP --sport 22 -j ACCEPT
Firewalls - Examples • Tutorial • http://www.frozentux.net/iptables-tutorial/iptables-tutorial.html
IntrusionDetectionSystem - IDS • IDS: Intrusion Detection System • Program used to detect the unauthorized accessesto a computer or a network • It is based in network traffic analysis • They usually have a database of patterns or signatures of known attacks • Itneitherprotectsorfilters, onlydetects
IntrusionDetectionSystem - IDS • 2types: • Network Intrusion Detection System (NIDS) • Host-Based Intrusion Detection System (HIDS)
Network Intrusion Detection System • NIDS • Use packet sniffers (sensors) to capture network traffic • The content of each packet is analyzed for malicious patterns • The sensors are usually located at critical points in the network that have to be monitored: • The DMZ • Network Endpoints
Network Intrusion Detection System PRE-PROCESSOR PRE-PROCESSOR Notify e-mail Opmitized packet for the engine Rule Engine SNIFFER Read the traffic Network Traffic Alert detected Store in DB orplaintext Filter attacker IP in the firewall (IPS) Search for a pattern A pattern matches RULES
Network Intrusion Detection System • Ejemplo NIDS:Snort • Example NIDS: Snort • It works as a network sniffer • Detects attacks on the basis of a set of rules • Save the alerts in a database mysql • http://www.snort.org
Network Intrusion Detection System • Managing and viewingalerts • ACID - AnalysisConsoleforIntrusionDatabases
Host-Based Intrusion Detection System • HIDS • The sensor consists of a software agent that monitors all the activity on the host on which it is installed • Search local information sources on the host, such as system logs • User Sessions • Privileged user activities • Changes to the file system • ...
Host-Based Intrusion Detection System • Ejemplo HIDS: OSSEC • Free, open source host-basedintrusiondetectionsystem (HIDS) • Performs log analysis, integritychecking, Windows registrymonitorizacón, rootkitdetection, real-time alerts, ... • Availablefor Linux, OpenBSD, FreeBSD, Mac OS X, Solaris and Windows • http://www.ossec.net
Intrusion Detection System - IDS • Problemas IDS • False positives and false negatives • Its effectiveness depends largely on its configuration • They are not easy to implement • Falsos positivos y falsos negativos
Otherapproaches • Otros enfoques • IPS (Intrusion Prevention System): besides detection, it takes action • Event Correlator: safety knowledge inferred from IDS, IPS, firewalls, AV, etc..
VPN • VPN: Virtual Private Network • Technology that allows to implement a local area network (LAN) within a wide area network (Internet, for example) securely • It requires • Encapsulated traffic (IP over TCP, for example) • Traffic Encryption • Traffic compression
VPN • Advantages • Comfortable for end users • Cheaper than a dedicated node • High level of scalability (eg going from 2-10 nodes) • Security
VPN • disadvantages • Overload on the client side (encapsulation, encryption, data compression) • Less reliable than a dedicated node • More complex credential management (certificates) • The VPN server can easily suffer DoS attacks (by overloading cryptograpy)
VPN • VPN types • Remoteaccess VPN (“roadwarriors”) • Remote and disperse clients connected to a corporate LAN through a VPN server • Point topoint VPN • Two or more nodes remotely interconnected to the Internet through encrypted tunnels • VPN over LAN • Implements a secure LAN within a LAN which is considered unsafe (eg Academic Management network within the University network)
VPN • Typical protocolos • PPTP: Point-to-Point TunnelingProtocol • L2F: Layer-2 Forwarding (CISCO) • L2TP: Layer-2 TunnelingProtocol • IPSec: Internet Protocol Security • SSL/TLS: Secure Sockets Layer/TransportLayer Security • SSH: Secure Shell • The de facto standard is IPSec, although the others are used to be more straightforward to implement
Proxy SockswithSSH • EncryptedTunnelswithSSH • SSH (Secure Shell) • Encryptseveryconnection • Allowsport-forwarding • It is possible to create encrypted tunnels for insecure protocols • Example: HTTP • HTTP traffic is encapsulated into SSH protocol • All HTTP traffic is encrypted
Proxy Sockswith SSH • Tools • putty (windows) • http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html • ssh (Unix) • aptitudeinstallssh