Difference between revisions of "Nginx"

From Atomicorp Wiki
Jump to: navigation, search
m (Does ASL work with Nginx?)
Line 1: Line 1:
 
== Does ASL work with Nginx?  ==
 
== Does ASL work with Nginx?  ==
  
Yes.  Nginx is protected through the ASL T-WAF module.
+
Yes.  Nginx is protected through the ASL T-WAF module.  
  
 
Note: Do not use the embedded modsecurity module for nginx.  The opensource modsecurity module for nginx, although advertised as "stable" by the modsecurity.org website, is very unstable and unreliable and should not be used at this time.  Please see the github website for details on bugs in the nginx modsecurity module:
 
Note: Do not use the embedded modsecurity module for nginx.  The opensource modsecurity module for nginx, although advertised as "stable" by the modsecurity.org website, is very unstable and unreliable and should not be used at this time.  Please see the github website for details on bugs in the nginx modsecurity module:
  
 
https://github.com/SpiderLabs/ModSecurity/issues
 
https://github.com/SpiderLabs/ModSecurity/issues
 +
 +
 +
Libmodsecurity 3.0 is currently in an "Alpha" state, and is not feature complete. Instructions
  
 
== How to install the T-WAF ==
 
== How to install the T-WAF ==
Line 34: Line 37:
  
 
Note:  Nginx does not support the WAF in embedded mode.
 
Note:  Nginx does not support the WAF in embedded mode.
 +
 +
 +
 +
== NGINX for Libmodsecurity 3.0 ==
 +
 +
Note: This requires nginx-plus from nginx.com, libmodsecurity 3.0 is not feature complete at this time.
 +
 +
1) Install nginx-plus-module-modsecurity from the nginx-plus repo
 +
 +
 +
  yum intsall nginx-plus-module-modsecurity
 +
 +
 +
2) enable modsecurity in /etc/nginx/nginx.conf
 +
 +
  load_module modules/ngx_http_modsecurity_module.so;
 +
 +
3) extract the archive and copy the contents to the rule and config directories:
 +
 +
  mkdir -p /etc/httpd/modsecurity.d/
 +
 +
  cp rules/* /etc/httpd/modsecurity.d/
 +
 +
  cp conf/tortix_waf.conf /etc/httpd/modsecurity.d/
 +
 +
4) Configure rule classes to activate in 00_mod_security.conf, and copy to nginx
 +
 +
  cp conf/00_mod_security.conf /etc/nginx/conf.d/
 +
 +
 
 +
 +
5) Restart nginx
 +
 +
  service nginx restart

Revision as of 11:47, 11 August 2017

Contents

Does ASL work with Nginx?

Yes. Nginx is protected through the ASL T-WAF module.

Note: Do not use the embedded modsecurity module for nginx. The opensource modsecurity module for nginx, although advertised as "stable" by the modsecurity.org website, is very unstable and unreliable and should not be used at this time. Please see the github website for details on bugs in the nginx modsecurity module:

https://github.com/SpiderLabs/ModSecurity/issues


Libmodsecurity 3.0 is currently in an "Alpha" state, and is not feature complete. Instructions

How to install the T-WAF

As root, run this command:

yum install asl-waf-module

How to configure the T-WAF for nginx

Step 1) Log into ASL.

Step 2) Click on the "Configuration" tab.

Step 3) Click on the "WAF" tab and select "WAF configuration".

Step 4) Click the "Add" button.

Step 5) Select "Local Web Server" from the "Add protection for" drop down.

Step 6) Select the port that Nginx runs on. Normally this is port 80.

Optional Step 7) Check the SSL box (if you want to protect the SSL service(s) provided by Nginx)

Enter the file system path to your SSL certificate, and SSL key in the "Path to SSL Certificate" and "Path to SSL Key file" boxes.

Step 8) Click Save

Note: Nginx does not support the WAF in embedded mode.


NGINX for Libmodsecurity 3.0

Note: This requires nginx-plus from nginx.com, libmodsecurity 3.0 is not feature complete at this time.

1) Install nginx-plus-module-modsecurity from the nginx-plus repo


 yum intsall nginx-plus-module-modsecurity


2) enable modsecurity in /etc/nginx/nginx.conf

 load_module modules/ngx_http_modsecurity_module.so;

3) extract the archive and copy the contents to the rule and config directories:

 mkdir -p /etc/httpd/modsecurity.d/
 cp rules/* /etc/httpd/modsecurity.d/
 cp conf/tortix_waf.conf /etc/httpd/modsecurity.d/

4) Configure rule classes to activate in 00_mod_security.conf, and copy to nginx

 cp conf/00_mod_security.conf /etc/nginx/conf.d/


5) Restart nginx

 service nginx restart
Personal tools