Seminar - Niranjan B
Seminar - Niranjan B
Intrusion Detection
System by using eBPF in
Linux Kernel
Dept of Computer Science Niranjan B
TKM College of Engineering TKM19CS045
1
TABLE OF CONTENTS
1. Introduction
2. Motivation
3. Objectives
4. Architecture
5. Methodology
6. Experimental Results
7. Performance Evaluation
8. Conclusion
9. Reference
2
Introduction
IDS - monitors network for malicious activity or policy violations
3
Key Terms
DPDK - Data Plane Development Kit.
4
Key Terms
XDP - Express Data Path
5
Motivation
6
Objectives
7
1
Architecture
8
1 Aho Corasick
METHODOLOGY
2 Snort
3 Proposed Framework
9
METHODOLOGY 1
Aho Corasick
10
Objective
Boyer Moore
vs
Aho Corasick Boyer Moore Aho Corasick
Single Pattern Match Multiple Patterns by
O(Z * N + M ) Scanning Text only
Once. O( N + M + Z )
N - length of text
M - length of pattern
Z - number of patterns. 11
2 Phases
Pattern Matching
12
Aho Corasick
Automaton
Patterns
● his
● hers
● she
13
Algorithm
Input: List of all patterns P
Output: A trie T
14
Add fail links
15
Algorithm
Input: The trie T
Output: The state machine M with fail links
16
Algorithm
Input: The trie T
Output: The state machine M with fail links
17
Algorithm
Input: state machine M
Output: state machine M with all transitions determined
18
Algorithm
Input: state machine M
Output: state machine M with all transitions determined
0 h →1 s→7 .→0
3 s→4 h →1 .→0
5 s→6 h →1 .→0
20
Algorithm
Input: state machine M, the input string
Output: Patterns matched in the string.
21
METHODOLOGY 2
SNORT
22
Open Source IDS
Architecture
Snort
23
Modes
Operation Modes
Snort
Inline Inline Test Passive
24
Packet dropped; if rule is passed
Snort
Rule Format
25
Packet dropped; if rule didn’t pass
Snort
Rule Format
26
All Options should be evaluated to True - Logical AND
27
FPM - Fast Pattern Matching
alert tep any any —> any any (content: "he"; content: "she";)
alert tcp any any —> any any (content: "where"; content: "which";)
Snort alert tcp any any —> any any (content: "his''; fast_pattern; content: "which";)
Detection
Engine
Rule Tree Matching Engine
28
Snort
Rule Tree
29
METHODOLOGY 3
Proposed Architecture
30
Architecture
31
eBPF Program
Flowchart
32
get_start_state()
Flowchart
33
ac_match()
Flowchart
34
No Loops, to prevent backward jumps eBPF
35
eBPF maps and stacks and cannot dynamically allocate memory from
heaps.
Challenges To overcome this restriction, instead of using heaps, place the dynamic
data in eBPF maps.
36
Copying data to user space from kernel space takes time
37
CAIDA Traffic Dataset -Generate Real Life Traffic
Experimental
Results
38
ATTR - Alert Triggering Traffic Ratio (1%)
Parameters
NR - Number of Rules (6000)
39
Algorithm
Input: ATTR, NR, MPL
Output: Maximum Throughput of IDS
Maximum Throughput
41
Performance
Evaluation
Snort
42
Performance
Evaluation
Proposed
Method
43
High-performance IDS working in Kernel and User layer
44
References
1. Shie-Yuan Wang, Jen-Chieh Chang, Design and implementation of an intrusion detection system
by using Extended BPF in the Linux kernel, Journal of Network and Computer Applications,
Volume 198, 2022, 103283, ISSN 1084-8045, https://doi.org/10.1016/j.jnca.2021.103283.
2. Aho, A.V., Corasick, M.J., 1975. Efficient string matching: An aid to bibliographic search.
Commun. ACM 18 (6), 333–340. http://dx.doi.org/10.1145/360825.360855.
45
Open for Q&A
46