業務用エアコン関連の技術情報、エラーコード、環境問題対策に関する別サイト「エアコンの安全な修理・適切なフロン回収」

Ubuntu Server24.04 : SNORT3 Install

Snort3

1.Install the required packages

2. Install the DAQ library

Download and install the DAQ library

3. Install Gperftools

A profiler tool used to improve the performance of specific applications or services by optimizing memory handling across multiple instances.

4. Installing SNORT3

①Downloading and Extracting SNORT3

➁Configuration

If you see the message "ERROR! Libpcre2 library not found." as described above, install the libpcre2-dev package.

➂Install

④Update shared libraries

⑤Check the version

⑥Testing Default Settings

If normal, it will be displayed as follows:

5. Identify and configure network interfaces

①Verify the network interface

Network interface name: ens33

➁Set the network interface to promiscuous mode

Confirm settings

➂Large Receive Offload (LRO) and Generic Receive Offload (GRO) set to off state

Check the current status

Set the off-road status of LRO and GRO to off.

6. Create a systemd service for the network interface

Content of snort3-nic.service

Reload the systemd daemon to apply changes.

Start and enable the snort3-nic.service.

Check the status of snort3-nic.service

7. Adding Snort Rules

7.1 Add Community Ruleset

Create a folder for Snort rules and download the community rule set from the Snort website.

➁ Edit the main configuration file

➂ Testing changes to the main configuration

7.2 Add custom rules

①Snort rulesCreate files in the directory

➁SnortEdit Main Configuration

➂ Testing changes to the main configuration

8. OpenAppID Installation

Installing the OpenAppID extension enables Snort to detect network threats at the application layer.

①Download OpenAppID and extract it.

➁Copy the extracted folder (odp) to the following directory:

➂Edit the main configuration file and define the location of the OpenAppID folder.

④ Testing changes to the main configuration

9. Create a systemd service for Snort

9.1 Confirmation of all setups

Using local.rules to run Snort on a network interface

Send a ping command to the Ubuntu server's IP address from another PC on the same network.
The following alert log appears in the host server's console window:

9.2 Create a systemd service for Snort

①Create a user (snort) for the Snort service

➁Creating the Log Folder and Setting Permissions

➂Create SNORT systemd service file

Content of snort3.service

④Reload and enable the Snort service

⑤Start the Snort service and check its status.

10. Snort JSON Logging Configuration

①Edit the Snort configuration file

➁Restart Snort

➂Confirming Settings
Execute the ping command from another PC on the same network to the Ubuntu host server.
The log is recorded and saved in the Snort alert_json.txt file. Check the log file.

11.Automatic Rule File Updates

Install oinkmaster to automatically update the rule files Snort references for detecting unauthorized access.

11.1 Oinkmaster Installation

Delete the following files and directories

11.2 Obtaining the Oink Code

To download Snort rule files (Sourcefire VRT Certified Rules), you need an "Oink Code," so obtain an "Oink Code."
First, access the SNORT official website and register as a user. After signing in with your registered account and password, display the "Oinkcode" and copy it.

11.3 Oinkmaster Settings
Edit the Oinkmaster configuration file
Paste the acquired Oinkcode

11.4 Download (Run Oinkmaster)

It will be displayed as follows:

11.5 Oinkmaster Scheduled Automatic Execution Settings

Oinkmaster Scheduled Automated Script Creation

Script execution permissions

Copied title and URL