-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
snort3_demo: build so_rule 3_13 using cmake. The result is more portable
- Loading branch information
Showing
6 changed files
with
89 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
build/ | ||
install/ | ||
sid_3_13.h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
cmake_minimum_required ( VERSION 3.4.3 ) | ||
project (sorule_id_3_13 C CXX) | ||
|
||
set (CMAKE_CXX_STANDARD 14) | ||
set (CMAKE_CXX_STANDARD_REQUIRED ON) | ||
set (CMAKE_CXX_EXTENSIONS OFF) | ||
|
||
include ( FindPkgConfig ) | ||
pkg_search_module ( SNORT3 REQUIRED snort>=3 ) | ||
|
||
add_library ( | ||
so_rule | ||
MODULE | ||
sid_3_13.cc | ||
sid_3_13.h | ||
) | ||
|
||
target_compile_options ( | ||
so_rule | ||
PRIVATE | ||
-fno-rtti | ||
) | ||
|
||
set_target_properties ( | ||
so_rule | ||
PROPERTIES | ||
PREFIX "" | ||
) | ||
|
||
target_include_directories ( | ||
so_rule PUBLIC | ||
${SNORT3_INCLUDE_DIRS} | ||
) | ||
|
||
install ( | ||
TARGETS so_rule | ||
LIBRARY | ||
DESTINATION "${CMAKE_SOURCE_DIR}/install" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
.PHONY: build sid_3-13.h install clean | ||
|
||
build: sid_3_13.h | ||
cmake -B build/ -G Ninja . | ||
cmake --build build/ | ||
|
||
sid_3_13.h: sid_3_13.txt | ||
snort --rule-to-text < sid_3_13.txt > sid_3_13.h | ||
|
||
install: | ||
cmake --install build/ | ||
|
||
clean: | ||
rm sid_3_13.h | ||
rm -rf build/ | ||
rm -rf install/ |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
alert http | ||
( | ||
msg:"Too much Cheez Whiz is bad mkay."; | ||
flow:to_server,established; | ||
http_uri; content:"crazy"; | ||
http_uri:query; content:"withThe=CheezWhiz"; | ||
http_uri:query; content:"cans="; | ||
service:http; | ||
reference:url,http://www.kraftbrands.com/cheezwhiz/; | ||
classtype:misc-activity; | ||
gid:3; | ||
sid:13; | ||
rev:1; | ||
soid:3_13_1; | ||
so:cans 7; | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters