Skip to content

Commit 5987e00

Browse files
Merge pull request #1451 from Andy17MB/Snorty3_Multithreading_AC_Edits
Copy edited. Note:
2 parents d1812e7 + 8594101 commit 5987e00

File tree

4 files changed

+36
-35
lines changed

4 files changed

+36
-35
lines changed

content/learning-paths/servers-and-cloud-computing/snort3-multithreading/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Scaling Snort3 - use multithreading for improved performance
2+
title: Scaling Snort 3 - use multithreading for improved performance
33

44
draft: true
55
cascade:

content/learning-paths/servers-and-cloud-computing/snort3-multithreading/_review.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22
review:
33
- questions:
44
question: >
5-
Which of the following is a key benefit of Snort3's multithreading support?
5+
Which of the following is a key benefit of Snort 3's multithreading support?
66
answers:
77
- It allows Snort to detect encrypted traffic.
8-
- It improves packet processing performance
9-
- It enables Snort to be run on legacy hardware
8+
- It improves packet processing performance.
9+
- It enables Snort to be run on legacy hardware.
1010
- It support multiple rule sets at the same time.
1111
correct_answer: 2
1212
explanation: >
1313
It improves packet processing performance by parallelizing tasks.
1414
1515
- questions:
1616
question: >
17-
Which parameter is used to enable multithreading in Snort3?
17+
Which parameter is used to enable multithreading in Snort 3?
1818
answers:
1919
- --max-packet-threads
2020
- --enable-threads
@@ -34,7 +34,7 @@ review:
3434
- pcap
3535
correct_answer: 3
3636
explanation: >
37-
The dump module in Snort3 is used to read capture files (such as .pcap or .pcapng files) for offline packet analysis.
37+
The dump module in Snort 3 is used to read capture files (such as .pcap or .pcapng files) for offline packet analysis.
3838
3939
4040

content/learning-paths/servers-and-cloud-computing/snort3-multithreading/build-and-install.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Install Snort3 and the required dependencies
2+
title: Installing Snort 3 and the required dependencies
33
weight: 2
44

55
### FIXED, DO NOT MODIFY
@@ -10,15 +10,15 @@ Snort is an Open Source Intrusion Prevention System (IPS). Snort uses a series o
1010

1111
Multithreading in Snort 3 refers to the ability to associate multiple threads with a single Snort instance enabling the concurrent processing of multiple packet files. This optimization frees up additional memory for further packet processing.
1212

13-
In order to enable multithreading in Snort3, specify the quantity of threads designated for processing network traffic using either the '--max-packet-threads' or '-z' option.
13+
In order to enable multithreading in Snort 3, specify the number of threads designated for processing network traffic using either the `--max-packet-threads` or `-z` option.
1414

1515
{{%notice Note%}}
1616
The instructions provided have been tested on AWS EC2 Graviton4 instance, based on Neoverse V2. The examples are easiest to use if you have at least 16 cores in the system.
1717
{{%/notice%}}
1818

1919
## Compile and build Snort3
2020

21-
To install Snort3, use a text editor to save the script below on your Arm server in a file named `install-snort.sh`.
21+
To install Snort 3, use a text editor to save the script below on your Arm server in a file named `install-snort.sh`.
2222

2323
<!-- add github link for the below file [build_snort3.sh]() -->
2424
``` bash
@@ -195,7 +195,7 @@ echo ' export LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH"'
195195

196196
The script takes 2 arguments:
197197
- the directory used to build Snort3 and its dependencies
198-
- the number of processors to use for the build
198+
- the number of processors to use for the build.
199199

200200
To build in a new directory named `build` with the number of processors in your system, run the script:
201201

@@ -205,7 +205,7 @@ bash ./install-snort.sh build `nproc`
205205

206206
You don't need to run the script as `root` but it assumes you are on Ubuntu 20.04 or 22.04 and have sudo permission.
207207

208-
When the build completes you have the snort3 directory with all compiled software, and the `snort` executable is located in `/usr/local/bin`.
208+
When the build completes you have the `snort3` directory with all compiled software, and the `snort` executable is located in `/usr/local/bin`.
209209

210210
To verify the installation is complete, run the command below and see the version printed:
211211

content/learning-paths/servers-and-cloud-computing/snort3-multithreading/usecase.md

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@ layout: learningpathall
88

99
Before testing multithreading performance, perform the following steps to configure your system:
1010

11-
1. Configure Grub settings
12-
2. Set up the Snort3 rule set
13-
3. Download the PCAP files
14-
4. Adjust Lua configurations
11+
1. Configure the Grub settings
12+
2. Set up the Snort 3 rule set
13+
3. Download the packet capture files
14+
4. Adjust the Lua configurations
15+
5. Review the Snort parameters
1516

16-
## Configure Grub settings
17+
## Configure the Grub settings
1718

1819
To enable Transparent HugePages (THP) and configure CPU isolation and affinity, append the following line to the /etc/default/grub file:
1920

@@ -71,7 +72,7 @@ The output shows the isolated processors:
7172
0-9
7273
```
7374

74-
## Set up the Snort3 rule set
75+
## Set up the Snort 3 rule set
7576

7677
Download the rule set from https://www.snort.org/ and extract it into your working directory. You should start in the `build` directory you used to build snort.
7778

@@ -95,9 +96,9 @@ Copy the `lua` folder from the `snort3` source directory into the rules director
9596
cp -r snort3/lua/ Test/snortrules/
9697
```
9798

98-
## Download the packet capture (PCAP) files
99+
## Download the packet capture files
99100

100-
You can use any PCAP files that are relevant to your test scenario.
101+
You can use any packet capture (PCAP) files that are relevant to your test scenario.
101102

102103
One place to get PCAP files is:
103104
https://www.netresec.com/?page=MACCDC
@@ -112,21 +113,21 @@ mkdir Test/Pcap
112113
cp maccdc2010_00000_20100310205651.pcap Test/Pcap/
113114
```
114115

115-
## Adjust Lua configurations
116+
## Adjust the Lua configurations
116117

117118
There are two modifications to the Lau configurations:
118-
- Pin each Snort thread to a unique core, ensuring that the cores match those isolated in the GRUB configuration
119-
- Enable the desired ruleset and enabling profiling
119+
- pin each Snort thread to a unique core, ensuring that the cores match those isolated in the GRUB configuration
120+
- enable the desired ruleset and enabling profiling.
120121

121122
### Pin snort threads to unique cpu core
122123

123-
Navigate to the `Test/snortrules/lua` directory.
124+
Navigate to the `Test/snortrules/lua` directory:
124125

125126
```bash
126127
cd Test/snortrules/lua
127128
````
128129

129-
Use an editor to create a file named `common.lua` with the contents below.
130+
Use an editor to create a file named `common.lua` with the contents below:
130131

131132
```bash
132133
-------------------------------------------------------------------------------
@@ -151,7 +152,7 @@ search_engine = { }
151152
snort_whitelist_append("threads")
152153
```
153154
154-
Include the above file in `snort.lua` by editing the file and adding the line below to the end of the file.
155+
Include the above file in `snort.lua` by editing the file and adding the line below to the end of the file:
155156
156157
``` bash
157158
include('common.lua')
@@ -176,25 +177,25 @@ Continue to edit `snort.lua` and comment out the `profiler` and `latency` lines
176177
177178
### Modify the IPS policy
178179
179-
Snort3 allows you to fine-tune setups with the `--tweaks` parameter. This feature allows you to use one of Snort's policy files to enhance the detection engine for improved performance or increased security.
180+
Snort 3 allows you to fine-tune setups with the `--tweaks` parameter. This feature allows you to use one of Snort's policy files to enhance the detection engine for improved performance or increased security.
180181
181-
Snort3 includes four preset policy files: max_detect, security, balanced, and connectivity.
182+
Snort 3 includes four preset policy files: `max_detect`, `security`, `balanced`, and `connectivity`.
182183
183-
The max_detect policy favors maximum security, whereas the connectivity policy focuses on performance and uptime, which may come at the expense of security.
184+
The `max_detect` policy favors maximum security, whereas the `connectivity` policy focuses on performance and uptime, which may come at the expense of security.
184185
185186
### Specify the data acquisition module
186187
187-
Snort supports DAQ modules which serves as an abstraction layer for interfacing with data source such as network interface.
188+
Snort supports data acquisition (DAQ) modules which serve as an abstraction layer for interfacing with a data source such as a network interface.
188189
189-
To see list of DAQ modules supported by snort use `--daq-list` command.
190+
To see list of DAQ modules supported by Snort use `--daq-list` command.
190191
191192
Return to the `build` directory:
192193
193194
```bash
194195
cd $HOME/build
195196
```
196197
197-
Run using the command:
198+
Run Snort with the command:
198199
199200
``` bash
200201
snort --daq-dir ./snort3/dependencies/libdaq/install/lib/daq --daq-list
@@ -250,15 +251,15 @@ trace(v1): inline unpriv wrapper
250251
251252
For testing, you can use `--daq dump` to analyze PCAP files.
252253
253-
## Spawn Snort3 process with multithreading
254+
## How do I spawn a Snort 3 process with multithreading?
254255
255-
To run Snort3 with multithreading start from the `Test` directory.
256+
To run Snort 3 with multithreading start from the `Test` directory.
256257
257258
```bash
258259
cd $HOME/build/Test
259260
```
260261
261-
The following example shows how to use multiple Snort threads to analyze PCAP files.
262+
The following example shows how to use multiple Snort threads to analyze PCAP files:
262263
263264
``` bash
264265
MPSE=hyperscan POLICY=./snortrules/lua/snort.lua TCMALLOC_MEMFS_MALLOC_PATH=/dev/hugepages/test snort -c ./snortrules/lua/snort.lua --lua detection.allow_missing_so_rules=true --pcap-filter maccdc2010_00000_20100310205651.pcap --pcap-loop 10 --snaplen 0 --max-packet-threads 10 --daq dump --daq-dir /usr/local/lib/daq --daq-var output=none -H --pcap-dir Pcap -Q --warn-conf-strict --tweaks security
@@ -290,7 +291,7 @@ The output is similar to:
290291
22:52:28 9 97.50 0.00 2.50 0.00 0.00 0.00 0.00 0.00 0.00 0.00
291292
```
292293
293-
## Test Snort3 multi-threading to process single pcap file
294+
## How do I test Snort 3 multithreading to process a single pcap file?
294295
295296
The example usage demonstrates how multithreading increases the number of packets processed per second.
296297

0 commit comments

Comments
 (0)