# Suricata启用Hyperscan支持以及Prelude-siem安装方法
## 0x01 安装 Hyperscan
### 1、Hyperscan 安装要求:
* GCC 版本大于等于 4.8.1,使用 yum 源安装即可
* CMake 版本大于等于 2.8.11,使用 yum 源安装即可
* Ragel 版本大于等于 6.9,使用 yum 源安装即可
* Python 版本为 2.7,使用系统默认的
* Boost 版本大于等于 1.57,Boost 不需要安装,只需要头文件
* Pcap 版本大于等于 0.8,使用 yum 源安装即可
* pcre 版本为 8.41,需要自行编译安装
![hyperscandependency.png](https://lyxw.github.io/images/suricata/hyperscandependency.png)
### 2、安装编译 pcre 所需的依赖包
```
yum install -y wget gcc gcc-c++ epel-release
```
### 3、编译安装 pcre
下载 pcre-8.41,选择合适的参数编译安装 pcre。本次编译选择开启 `utf、pcre16、pcre32、unicode、pcre-jit` 支持,选用 `--libdir=/usr/lib64 --includedir=/usr/include` 参数,其他路径可能需要写入 PATH;若选用默认编译安装路径,在编译 hyperscan 时会提示 PCRE not found,生成的 hyperscan 中不包含 PCRE 预处理功能。
PCRE 预处理功能简介:
![pcrewithhyperscan.png](https://lyxw.github.io/images/suricata/pcrewithhyperscan.png)
```
wget https://ftp.pcre.org/pub/pcre/pcre-8.41.tar.gz
tar zxvf pcre-8.41.tar.gz
cd pcre-8.41
./configure --enable-utf --enable-jit --enable-pcre16 --enable-pcre32 --enable-unicode-properties --libdir=/usr/lib64 --includedir=/usr/include
make
make install
```
### 4、安装编译 Hyperscan 所需依赖包
```
yum install -y cmake libpcap-devel ragel-devel sqlite-devel
```
### 5、下载 Hyperscan 源码
下载 Hyperscan 源码,解压后给 hyperscan 文件夹赋予 `755` 权限即可
```
wget https://github.com/intel/hyperscan/archive/v5.0.0.tar.gz
tar zxvf hyperscan-5.0.0.tar.gz
chmod -R 755 hyperscan-5.0.0
```
### 6、下载 boost-1.66 源码
下载 boost-1.66 源码,解压并链接到 `/hyperscan/include/` 目录下
```
wget http://downloads.sourceforge.net/project/boost/boost/1.66.0/boost_1_66_0.tar.gz
tar zxvf boost_1_66_0.tar.gz
ln -s /boost_1_66_0/boost /hyperscan/include/boost
```
### 7、编译安装 Hyperscan
创建 Hyperscan 编译目录