This repo contains the binding of libModSecurity(aka ModSecurity v3) in Node.js. These bindings will allow users to utilize the exposed libmodsecurity interfaces directly from node.js.
Please head over to the project Wiki for more details.
Before you follow the following steps make sure you have npm, nodejs and swig(3.0+) installed in your system.
-
First build libModSecurity in your system. Compilation recipes
-
Open
binding.gyp
, editinclude_dirs
andlibraries
to point to the headers(include directories) and libraries folder of modsecurity. By default it's looking at:"include_dirs": ['/usr/include/modsecurity/',], "libraries": ['/usr/lib/libmodsecurity.a','other_shared_libraries']
-
Then type:
make
TheMakefile
will first generates the wrappermodsecurity_wrap.cxx
, then installs node package and finallynode-gyp
generate the node module of modsecurity. You must seeok
at the end to make sure that build was successfull. -
To test the node module, you may use :
npm test
. Further to test the simple connector you cancd
intoexample
and typenode simple_example.js
.
This is in early development phase and is highly unstable. To see some known bugs or issues you may check this.