Role of Firewall, IPS & IDS Model IDS Model: Navneet Scientist 'B' Cert-In, Dit
Role of Firewall, IPS & IDS Model IDS Model: Navneet Scientist 'B' Cert-In, Dit
&
IDS Model
NAVNEET
Scientist `B`
CERT-In, DIT
1
Firewall
• Filtering
• Inspection
• Detection
• Logging
• Alerting
• Allow Address Reuse
3
Securing DMZ
• Single/ Dual
Firewalls is
used in
creating DMZ
4
Types of Firewall
5
Network layer firewall
• Not allowing packets to pass through the
firewall unless they match the established filter
rule set.
• Firewall administrator may define the rules
• Filtering rules is based on source and
destination address and ports.
• Operates very fast.
• Network layer firewalls generally fall into two
sub-categories, stateful and non-stateful.
6
Stateful Firewall
7
• Stateful Firewall Operation
– For TCP, record two IP addresses and port
numbers in state table as OK (open)
– By default, permit connections from internal
clients (on trusted network) to external servers (on
untrusted network)
• This default behavior can be changed with an ACL
Note: Outgoing
Stateful
Internal Connections
Firewall External
Client PC Allowed By
60.55.33.12 Default Webserver
123.80.5.34
Connection Table
Internal Internal External External
Type Status
IP Port IP Port
11
Port-Switching Applications with Stateful
Firewalls
2.
To Establish
1. Connection 3.
TCP SYN Segment TCP SYN Segment
From: 60.55.33.12:62600 From: 60.55.33.12:62600
To: 123.80.5.34:21 To: 123.80.5.34:21
Internal Stateful
Client PC Firewall External
60.55.33.12 FTP Server
123.80.5.34
State Table
6. Stateful 4.
Internal
TCP SYN/ACK Segment Firewall TCP SYN/ACK SegmentExternal
Client PC
From: 123.80.5.34:21 From: 123.80.5.34:21 FTP
60.55.33.12
To: 60.55.33.12:62600 5. To: 60.55.33.12:62600 Server
Use Ports 20 To Allow, Use Ports 20 123.80.5.34
and 55336 for Establish and 55336 for
Data Transfers Second Data Transfers
Connection
14
Network-based application firewall Proxy Firewall
S: Host A: port:1024
D: Proxy:port:8080
S: Proxy: port:3000
D: Server:port:80
Host A
Proxy
Fire
WALL Server x
Host B
S: Proxy: port:3001
D: Server:port:80
S: Host B: port:1027
D: Proxy:port:8080
15
Web Application Firewall
16
Web Application Risks
• Potential damage:
– Defacement
– Client attacks
– DoS/DDoS
– Data manipulation / retrieval / deletion
Attack techniques:
– SQL / Command injection
– Cross-site scripting (XSS)
– Cookie poisoning
– Session hijacking
– More….
17
Unified Threat Management (UTM)
18
Free Firewall software packages
• IP Tables
– comes with most linux distributions
• SELinux (Security Enabled Linux – NSA)
– comes with some Linux distributions
• Fedora, Red Hat
• IPCop – specialized Linux distribution
19
Intrusion Detection/Prevention
System
• Intrusion
– A set of actions aimed to compromise the security goals,
namely
• Integrity, confidentiality, or availability of a computing
and networking resource
• Intrusion detection
– The process of identifying and responding to intrusion
activities
• Intrusion prevention
– Extension of ID with exercises of access control to protect
computers from exploitation
20
Components of Intrusion Detection System
Audit Records
system activities are
observable
Audit Data
Preprocessor
Activity Data
24
Network IDSs
Event Engine
tcpdump filters Filtered packet stream
libpcap
Packet stream
Network
Firewall Versus Network IDS
• Firewall
– Active filtering
– Fail-close
• Network IDS
– Passive monitoring
– Fail-open
IDS
FW
Requirements of Network IDS
• Misuse detection
– Catch the intrusions in terms of the characteristics
of known attacks or system vulnerabilities.
• Anomaly detection
– Detect any action that significantly deviates from
the normal behavior.
Misuse Detection
Method
Statistical method
Machine Learning techniques
Time-Based inductive Machine
Instance Based Learning
Neural Network
…
Data mining approaches
Anomaly Detection Disadvantages
Advantage Disadvantage
37
38
39
40
Iptables commands
Where rule checked the match part of the rule The target
part of the
rule
42
• Allow ssh login to firewall host from outside
43
Stateful Inspection with Linux Netfilter
44
DNAT/SNAT Example
• INBOUND
iptables –t nat –A PREROUTING –p tcp –dport 80 –j DNAT --to-dest
192.168.0.20
• OUTBOUND
iptables –t nat –A OUTPUT –p tcp –dport 80 –j DNAT – -to-dest
192.168.0.200:3128
MASQUERADE
iptables –t nat –A POSTRUTING –o eth0 –j MASQUERADE
SNAT:
iptables –t nat -A POSTROUTING –j SNAT –to-source 1.2.3.45
45
References
• http://searchnetworking.techtarget.com/tutorial
/Introduction-to-firewalls-Types-of-firewalls
• http://en.wikipedia.org/wiki/Application_firew
all
• http://security.hsr.ch/lectures/IntSec1-
Firewalls.pdf
• http://www.csh.rit.edu/~mattw/proj/nf/
46
Question &Answer
47