General Vision
- With this article, you will have your webserver ready to production, filtering all requests with NAXSI WAF configured on nginx.
- Get the nginx and nasxi source code
- Compile and install from source nginx and naxsi
- Unpack the tar files
- Remove old nginx files and move the naxsi directory
- Configure and compile the nginx on your linux kernel
- Copy naxsi base rules to nginx conf directory
- Edit the nginx.conf and include the naxsi base rules on http section
- Create your custom naxsi rules
- Include your custom rules on every server configuration
- Configure the nginx deamon
- Start your nginx, with naxsi compiled inside
- After some days on LearningMode, configure the nx_util to create your custom whitelist
- Look your configuration file and analyses the whitelist to understand the requests and his needs
- Turn off the naxsi LearningMode
With this article, you will have your webserver ready to production, filtering all requests with NAXSI WAF configured on nginx.
Versions: nginx 1.8.1 + naxsi 1.5.3
Tested on CentOS 7 and Ubuntu Trusty
Execute all steps on root account
Get the nginx and nasxi source code
Compile and install from source nginx and naxsi
Unpack the tar files
Remove old nginx files and move the naxsi directory
Configure and compile the nginx on your linux kernel
Copy naxsi base rules to nginx conf directory
Edit the nginx.conf and include the naxsi base rules on http section
Create your custom naxsi rules
Include your custom rules on every server configuration
Configure the nginx deamon
Start your nginx, with naxsi compiled inside
After some days on LearningMode, configure the nx_util to create your custom whitelist
ps: I used the 0.53 version, because the setup create the elasticsearch to execute the nx_util.py