-
Notifications
You must be signed in to change notification settings - Fork 6
/
config
61 lines (53 loc) · 1.79 KB
/
config
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
ngx_waf_libs=""
if [ "$NGX_PLATFORM" != win32 ]; then
#echo "libmagic check ..."
ngx_feature="libmagic library"
ngx_feature_name="NGX_WAF_MAGIC"
ngx_feature_run=no
ngx_feature_incs="#include <magic.h>"
ngx_feature_path=
ngx_feature_libs="-lmagic"
ngx_feature_test="magic_t cookie = magic_open(MAGIC_MIME_TYPE);
if (cookie == NULL) return 1;
char *x = \"GIF89axxxx\";
magic_buffer(cookie, (const void*)x, 10);
magic_close(cookie);"
. auto/feature
if [ $ngx_found = yes ]; then
ngx_waf_libs="$ngx_waf_libs $ngx_feature_libs"
ngx_found=no
fi
#echo "Hyperscan check ..."
ngx_feature="Hyperscan library"
ngx_feature_name="NGX_WAF_HS"
ngx_feature_run=yes
ngx_feature_incs="#include <hs/hs.h>"
ngx_feature_path=
ngx_feature_libs="-lhs"
ngx_feature_test="if (hs_valid_platform() == HS_ARCH_ERROR) return 1;"
. auto/feature
if [ $ngx_found = yes ]; then
ngx_waf_libs="$ngx_waf_libs $ngx_feature_libs"
ngx_found=no
fi
fi
ngx_addon_name=ngx_http_waf_module
ngx_feature_libs="-lm"
_HTTP_WAF_SRCS="\
$ngx_addon_dir/ngx_http_waf_module.c \
$ngx_addon_dir/libinjection/libinjection_sqli.c \
$ngx_addon_dir/libinjection/libinjection_xss.c \
$ngx_addon_dir/libinjection/libinjection_html5.c \
"
if test -n "$ngx_module_link"; then
ngx_module_type=HTTP
ngx_module_name=$ngx_addon_name
ngx_module_srcs="$_HTTP_WAF_SRCS"
ngx_module_libs="$ngx_feature_libs $ngx_waf_libs"
. auto/module
else
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $_HTTP_WAF_SRCS"
CORE_LIBS="$CORE_LIBS $ngx_feature_libs $ngx_waf_libs"
CORE_INCS="$CORE_INCS $ngx_module_incs"
HTTP_MODULES="$HTTP_MODULES $ngx_addon_name"
fi