diff --git a/Makefile b/Makefile index 9576739e52f4a4cb5e5c6a8d74f145c4a2f7cb2f..c8d2597a8b450d722ada1bd674fca765ad60edb6 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ VENV_DIR ?= doc/venv PYTHON ?= python3 .PHONY: all -all: dpdk vpp traffic-gen +all: dpdk vpp snort traffic-gen .PHONY: dpdk dpdk: @@ -26,6 +26,41 @@ vpp: $(MAKE) build-release; \ ) +.PHONY: snort +snort: + @( \ + cd ./components/snort/jemalloc; \ + echo"@@@@ Installing jemalloc @@@@"; \ + $(MAKE) -j$(nproc) ; \ + $(MAKE) -j$(nproc) install ; \ + echo"@@@@ Installing gperftools @@@@"; \ + cd ../gperftools; \ + $(MAKE) -j$(nproc) ; \ + $(MAKE) -j$(nproc) install; \ + echo"@@@@ Installing ragel @@@@"; \ + cd ../ragel/ragel-6.10; \ + $(MAKE) -j$(nproc) ; \ + $(MAKE) -j$(nproc) install; \ + echo"@@@@ Installing vectorscan @@@@"; \ + cd ../../vectorscan/; \ + cmake -DBOOST_ROOT=./components/snort/boost/boost/ -DCMAKE_BUILD_TYPE=Release . ; \ + $(MAKE) -j$(nproc) ; \ + $(MAKE) -j$(nproc) install; \ + echo"@@@@ Installing libdaq @@@@"; \ + cd ./components/snort/libdaq/; \ + $(MAKE) -j$(nproc) ; \ + $(MAKE) -j$(nproc) install; \ + echo"@@@@ Installing snort3 @@@@"; \ + cd ../snort3/; \ + ./configure_cmake.sh --build-type=Release --enable-unit-tests --enable-jemalloc ; \ + cd build ; \ + $(MAKE) -j$(nproc) ; \ + $(MAKE) -j$(nproc) install; \ + echo"@@@@ Installing safeclib @@@@"; \ + cd ../../safeclib ; \ + $(MAKE) -j$(nproc) ; \ + $(MAKE) -j$(nproc) install; \ + ) .PHONY: traffic-gen traffic-gen: @( \ @@ -90,4 +125,5 @@ help: @echo " doc-spellcheck - Spellcheck the Sphinx documentation" @echo " dpdk - Build DPDK" @echo " vpp - Build VPP" + @echo " snort - Build Snort dependecy libraries" @echo " traffic-gen - Build traffic generator tools, e.g., wrk2" diff --git a/README.md b/README.md index 8f2139b089467211b632d4a0bd6761d51cc21eb0..430e09ab1d72b12449949db33aeec7f31bf9707e 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,11 @@ Please refer to the [Quickstart Guide](./doc/quickstart.rst) to get started usin * Users of this software stack must consider safety and security implications according to their own usage goals * Does not provide a native traffic generator +Note: To test with snort lightspeed rules +* As we cannot sign in to snort official website via linux arm machine [Talos_LightSPD.tar.gz] rules has to be downloaded manually from snort website(https://www.snort.org/downloads/registered/Talos_LightSPD.tar.gz) +* copy the downloaded file into usr/local and untar it (tar -xvf Talos_LightSPD.tar) will get lightspd directory +* copy ftd-aarch64.tar.gz file into /usr/local/lightspd/modules/3.1.44.0/ and extract it(tar -xvf ftd-aarch64.tar.gz) will get ftd-aarch64 directory + # Feedback and Support diff --git a/setup.sh b/setup.sh index e78e308f4456442a0f86b5fc2ebcdbb5d017406c..41edd30c226a6dc06623b6aaf7c39fcc10dd4765 100755 --- a/setup.sh +++ b/setup.sh @@ -37,3 +37,5 @@ apt-get install -y $LIST_OF_APPS echo "@@@@@@@@@@@@@@@@@@ Packages installed @@@@@@@@@@@@@@@@@@@@" echo "@ Remember to setup grub settings according to the documentation @" +./setup_snort.sh +echo "@@@@@@@@@@@@@@@@@@ Snort Packages installed @@@@@@@@@@@@@@@@@@@@" diff --git a/setup_snort.sh b/setup_snort.sh new file mode 100755 index 0000000000000000000000000000000000000000..055b2cdf230fa9f62b50d5be8a1dee908d76540c --- /dev/null +++ b/setup_snort.sh @@ -0,0 +1,112 @@ + + +#!/usr/bin/env bash + +# Copyright (c) 2022-2024, Arm Limited. +# +# SPDX-License-Identifier: Apache-2.0 + +export NPROC='nproc' +export SAFECLIB_VERSION=v3.7.1 +export JEMALLOC_VERSION=5.3.0 +export GPERFTOOLS_VERSION=2.13 +export VECTORSCAN_VERSION=5.4.10.1 +export LIBDAQ_VERSION=v3.0.14 +export SNORT_VERSION=3.1.78.0 +export ABCIP_VERSION=v2.4.0 + +set -e + +LIST_OF_APPS="sudo autoconf bc cpputest flex gdb libasan5 libdumbnet-dev libhugetlbfs-bin libhwloc-dev libluajit-5.1-dev liblzma-dev libmnl-dev libpcap-dev libssl-dev libunwind-dev uuid-dev zlib1g-dev bats wget unzip iproute2 git vim gcc-12" +REMOVE_LIST_OF_APPS="libhwloc-plugins" + +apt-get update +apt-get install -y $LIST_OF_APPS +apt-get remove -y $REMOVE_LIST_OF_APPS + +update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 100 +update-alternatives --set gcc /usr/bin/gcc-12 +update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 100 +update-alternatives --set g++ /usr/bin/g++-12 + +echo "@@@@@@@@@@@@@@@@@@ Packages installed @@@@@@@@@@@@@@@@@@@@" +echo "@@@@@@@@@@@@@@@@@@ Istalling snort and dependency packages @@@@@@" + +echo "@@@@@@@@@@@@ configuring libsafec @@@@@@@@@@@@" +cd components/snort/safeclib/ +git checkout ${SAFECLIB_VERSION} +./build-aux/autogen.sh +./configure + +echo "@@@@@@@@@@@@ configuration completed for libsafec @@@@@@@@@@@@" + +echo "@@@@@@@@@@@@ download and configure pcre @@@@@@@@@@@@" +mkdir ../pcre +cd ../pcre +wget https://sourceforge.net/projects/pcre/files/pcre/8.45/pcre-8.45.tar.gz +tar -xvf pcre-8.45.tar.gz +cd pcre-8.45/ +./configure +echo "@@@@@@@@@@@@ Download and configuration completed for pcre @@@@@@@@@@@@" + +echo "@@@@@@@@@@@@ configuring jemalloc @@@@@@@@@@@@" +cd ../../jemalloc/ +git checkout ${JEMALLOC_VERSION} +./autogen.sh +./configure +echo "@@@@@@@@@@@@ configuration completed for jemalloc @@@@@@@@@@@@" + + + +echo "@@@@@@@@@@@@ configuring gperftools @@@@@@@@@@@@" +cd ../gperftools/ +git checkout gperftools-${GPERFTOOLS_VERSION} +./autogen.sh +./configure +echo "@@@@@@@@@@@@ configuration completed for gperftools @@@@@@@@@@@@" + +echo "@@@@@@@@@@@@ download and configure ragel @@@@@@@@@@@@" +mkdir ../ragel +cd ../ragel +wget https://www.colm.net/files/ragel/ragel-6.10.tar.gz +tar -xvf ragel-6.10.tar.gz +cd ragel-6.10/ +./configure +echo "@@@@@@@@@@@@ Download and configuration completed for ragel @@@@@@@@@@@@" + +echo "@@@@@@@@@@@@ download and configure boost @@@@@@@@@@@@" +mkdir ../../boost +cd ../../boost +wget https://boostorg.jfrog.io/artifactory/main/release/1.83.0/source/boost_1_83_0.tar.gz +tar -xvf boost_1_83_0.tar.gz -C /opt/merge_to_ARM/snort_installation/dataplane-stack/components/snort/vectorscan/include --strip-components=1 boost_1_83_0/boost +mv boost_1_83_0.tar.gz boost +echo "@@@@@@@@@@@@ Download and configuration completed for boost @@@@@@@@@@@@" + +echo "@@@@@@@@@@@@ configuring vectorscan @@@@@@@@@@@@" +cd ../vectorscan/ +git checkout vectorscan/${VECTORSCAN_VERSION} + +echo "@@@@@@@@@@@@ configuration completed for vectorscan @@@@@@@@@@@@" + + +echo "@@@@@@@@@@@@ configuring Libdaq @@@@@@@@@@@@" +cd ../libdaq/ +git checkout ${LIBDAQ_VERSION} +./bootstrap +./configure + +echo "@@@@@@@@@@@@ configuration completed for Libdaq @@@@@@@@@@@@" + + +echo "@@@@@@@@@@@@ configuring Snort3 @@@@@@@@@@@@" +cd ../snort3/ +git checkout ${SNORT_VERSION} +CFLAGS="-march=native -mtune=native" CXXFLAGS="-march=native -mtune=native" +echo "@@@@@@@@@@@@ configuration completed for Snort3 @@@@@@@@@@@@" + +echo "@@@@@@@@@@@@ configuring appid @@@@@@@@@@@@" +mkdir ../appid +cd ../appid +wget https://snort.org/downloads/openappid/33380 +tar -xvf 33380 +echo "@@@@@@@@@@@@ configuration completed for appid @@@@@@@"