dunhillers
Member
Добрый день,
Есть виртуальный сервер с nginx на котором крутится сайт. Нам его нужно защитить с помощью WAF. До этого с WAF не сталкивались.
По инструкции https://nemesida-waf.ru/manuals/6387#nw и https://www.youtube.com/watch?v=BPY0DxTUqgQ разворачиваем nwaf (CE) с помощью docker.
После того как завершаем развертывание фильтрующей ноды выполняем проверочный запрос curl -i http://10.205.32.121/nwaftest и получаем ошибку 502 bad gateway...
Помогите решить проблему, как подружить сайт с waf и протестировать запросы что waf отрабатывает ???
Вот наши конфиги для подключения сайта к nwaf
1.) /opt/nwaf/waf-config/conf.d/mirror.conf
upstream sites_upstream {
server 10.205.32.121;
}
server {
server_name 10.205.33.121;
listen 80;
location / {
proxy_pass http://10.205.33.121:8089
#include proxy_params;
}
}
2.)/opt/nwaf/waf-config/conf.d/web-sites.conf
proxy_cache_path /var/cache/nginx/knpk levels=1:2 keys_zone=knpk:10m max_size=2G;
server {
listen 8780 default_server;
server_name _;
client_max_body_size 0;
gzip off;
sendfile_max_chunk 512k;
sendfile on;
3.)/opt/nwaf/waf-config/nginx.conf
GNU nano 6.4 /opt/nwaf/waf-config/nginx.conf
load_module /etc/nginx/modules/ngx_http_waf_module.so;
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log notice;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
##
# Nemesida WAF
##
## Fix: request body too large
client_body_buffer_size 25M;
include /etc/nginx/nwaf/conf/global/*.conf;
include /etc/nginx/nwaf/conf/vhosts/*.conf;
include /etc/nginx/conf.d/*.conf;
}
4.)/opt/nwaf/waf-config/nwaf/conf/global/nwaf.conf
GNU nano 6.4 /opt/nwaf/waf-config/nwaf/conf/global/nwaf.conf
##
# Nemesida WAF minimal settings
# Use the web interface for managing some other settings (only for the commercial version)
##
##
# License key and signature database
##
nwaf_license_key none;
nwaf_rules /etc/nginx/nwaf/rules.bin;
##
# Nemesida WAF API and proxy settings
##
nwaf_sys_proxy none;
nwaf_api_proxy none;
nwaf_api_conf host=http://10.205.33.121:8080
##
# Nemesida WAF activation for virtual host
##
nwaf_host_enable *;
##
# MLA settings
##
nwaf_mla 127.0.0.1:5101 mla_score:2;
nwaf_mla_api 127.0.0.1:5102;
##
# RabbitMQ and AI extra global settings
##
nwaf_rmq host=127.0.0.1 user=guest password=guest;
##
# ClamAV settings
##
# nwaf_clamav 127.0.0.1:3310 FILE_ONLY;
Есть виртуальный сервер с nginx на котором крутится сайт. Нам его нужно защитить с помощью WAF. До этого с WAF не сталкивались.
По инструкции https://nemesida-waf.ru/manuals/6387#nw и https://www.youtube.com/watch?v=BPY0DxTUqgQ разворачиваем nwaf (CE) с помощью docker.
После того как завершаем развертывание фильтрующей ноды выполняем проверочный запрос curl -i http://10.205.32.121/nwaftest и получаем ошибку 502 bad gateway...
Помогите решить проблему, как подружить сайт с waf и протестировать запросы что waf отрабатывает ???
Вот наши конфиги для подключения сайта к nwaf
1.) /opt/nwaf/waf-config/conf.d/mirror.conf
upstream sites_upstream {
server 10.205.32.121;
}
server {
server_name 10.205.33.121;
listen 80;
location / {
proxy_pass http://10.205.33.121:8089
#include proxy_params;
}
}
2.)/opt/nwaf/waf-config/conf.d/web-sites.conf
proxy_cache_path /var/cache/nginx/knpk levels=1:2 keys_zone=knpk:10m max_size=2G;
server {
listen 8780 default_server;
server_name _;
client_max_body_size 0;
gzip off;
sendfile_max_chunk 512k;
sendfile on;
3.)/opt/nwaf/waf-config/nginx.conf
GNU nano 6.4 /opt/nwaf/waf-config/nginx.conf
load_module /etc/nginx/modules/ngx_http_waf_module.so;
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log notice;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
##
# Nemesida WAF
##
## Fix: request body too large
client_body_buffer_size 25M;
include /etc/nginx/nwaf/conf/global/*.conf;
include /etc/nginx/nwaf/conf/vhosts/*.conf;
include /etc/nginx/conf.d/*.conf;
}
4.)/opt/nwaf/waf-config/nwaf/conf/global/nwaf.conf
GNU nano 6.4 /opt/nwaf/waf-config/nwaf/conf/global/nwaf.conf
##
# Nemesida WAF minimal settings
# Use the web interface for managing some other settings (only for the commercial version)
##
##
# License key and signature database
##
nwaf_license_key none;
nwaf_rules /etc/nginx/nwaf/rules.bin;
##
# Nemesida WAF API and proxy settings
##
nwaf_sys_proxy none;
nwaf_api_proxy none;
nwaf_api_conf host=http://10.205.33.121:8080
##
# Nemesida WAF activation for virtual host
##
nwaf_host_enable *;
##
# MLA settings
##
nwaf_mla 127.0.0.1:5101 mla_score:2;
nwaf_mla_api 127.0.0.1:5102;
##
# RabbitMQ and AI extra global settings
##
nwaf_rmq host=127.0.0.1 user=guest password=guest;
##
# ClamAV settings
##
# nwaf_clamav 127.0.0.1:3310 FILE_ONLY;