当前位置: 首页 > news >正文

创办一个网站的费用/免费建立自己的网站

创办一个网站的费用,免费建立自己的网站,wordpress 光点特效,阿里云域名官网Naxsi是Nginx的一个第三方的插件 用于保护Nginx前段防护 是一个轻量级的防火墙 比较好用 官网即下载地址 https://github.com/nbs-system/naxsi/releases 参考网址 https://www.123admin.com/how-to-setup-and-configure-naxsi-for-nginx-on-centos/ 解压 tar zxvf naxsi-0.56…

Naxsi是Nginx的一个第三方的插件 用于保护Nginx前段防护 是一个轻量级的防火墙 比较好用

官网即下载地址

https://github.com/nbs-system/naxsi/releases

参考网址

https://www.123admin.com/how-to-setup-and-configure-naxsi-for-nginx-on-centos/

解压

tar zxvf  naxsi-0.56rc1.tar.gz

naxsi重新编译到nginx里面

./configure --prefix=/usr/local/nginx --add-module=/root/nginx-1.13.9/naxsi-0.56rc1/naxsi_src  --with-http_secure_link_module --with-http_stub_status_module --with-http_auth_request_module --with-http_image_filter_module --with-http_slice_module --with-mail --with-threads --with-file-aio --with-stream --with-mail_ssl_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-pcre  --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-http_addition_module  && make

覆盖旧的配置文件

cp objs/nginx /usr/local/nginx/sbin/nginx

在nginx配置里写三个文件

1 是naxsi的规则配置文件

2 是naxsi的白名单配置文件

3 是naxsi的错误日志文件

(1) 在conf里配置一个naxsi的规则配置文件

vi mysite.rules

#LearningMode; #Enables learning mode

SecRulesEnabled;

#SecRulesDisabled;

DeniedUrl "/RequestDenied";

## check rules

CheckRule "$SQL >= 8" BLOCK;

CheckRule "$RFI >= 8" BLOCK;

CheckRule "$TRAVERSAL >= 4" BLOCK;

CheckRule "$EVADE >= 4" BLOCK;

CheckRule "$XSS >= 8" BLOCK;

(2)设置naxsi的白名单

vi naxsi_BasicRule.conf

BasicRule wl:0 "mz:$ARGS_VAR:id";
BasicRule wl:0 "mz:$ARGS_VAR:script";

(3)在nginx的logs里编辑一个foo.log错误文件,保存就好什么也不用写

 

nginx.conf配置文件里

在http的server字段里增加一段话

        location /RequestDenied {
        return 403;
        }

        location / {

            root   html;

            index  index.html index.htm;

            include /usr/local/nginx/conf/mysite.rules;#读取配置规则

            error_log /usr/local/nginx/logs/foo.log;#错误日志位置
            include naxsi_BasicRule.conf;#设置白名单

         }

 

检查配置文件

 /usr/local/nginx/sbin/nginx -t

nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok

nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful

/usr/local/nginx/sbin/nginx -s reload

模仿攻击,看错误日志,中显示NAXSI_FMT说明配置成功

访问返回页面 403

日志foo.log显示 NAXSI_FMT说明拦截成功

设置白名单

 在conf里加一个文件配置规则

vi naxsi_BasicRule.conf

BasicRule wl:0 "mz:$ARGS_VAR:script";
BasicRule wl:0 "mz:$ARGS_VAR:id";
BasicRule wl:1000 "mz:$ARGS_VAR:foo|$URL:/bar";

在nginx.conf文件里也加入

location / {
root html;
index index.html index.htm;
include /usr/local/nginx/conf/mysite.rules;#读取配置规则
error_log /usr/local/nginx/logs/foo.log;#错误日志位置
include naxsi_BasicRule.conf;#设置白名单
}

检查配置文件重启nginx

访问出现404说明没有被拦截,日志也没有返回

白名单配置成功

nginx.conf的配置文件

worker_processes 1;

events {
worker_connections 1024;
}

http {
include mime.types;
include /usr/local/nginx/conf/naxsi_core.rules;
default_type application/octet-stream;

server {
listen 443 ssl;
server_name www.fengxiao.xyz;#绑定证书的域名
ssl_certificate 1_www.fengxiao.xyz_bundle.crt;#证书
ssl_certificate_key 2_www.fengxiao.xyz.key;#秘钥
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;#ssl这个协议配置
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;

ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
ssl_prefer_server_ciphers on;

location / {
root html;
index index.html index.htm;
include /usr/local/nginx/conf/mysite.rules;#读取配置规则
error_log /usr/local/nginx/logs/foo.log;#错误日志位置
include /usr/local/nginx/conf/naxsi_BasicRule.conf;#设置白名单
}
#跳转的403
location /RequestDenied {
return 403;
}

}

}

 

WAF的Naxsi配置成功

点一杯星巴克

转载于:https://www.cnblogs.com/qingyuanyuanxi/p/8510159.html

http://www.lbrq.cn/news/1048969.html

相关文章:

  • 哪些公司的网站做的漂亮/百度站长工具
  • 网页设计怎样做/网站搜索引擎优化方法
  • 做网站需要工商证吗/东莞百度快速排名优化
  • 网站引导页模板/google服务框架
  • 深圳手机端网站建设设计公司/宁德市蕉城区疫情
  • 公司有多少做网站/最近三天的新闻热点
  • 9377游戏官网/seo是什么服
  • 如何百度收录我的网站/如何设置友情链接
  • 西安小型企业网站建设/淘宝指数官网入口
  • 做的好的公司网站/自己怎么优化关键词
  • 专业的深圳网站建设公司排名/新乡百度关键词优化外包
  • 个体商户建自己的网站做销售/网络营销课程心得体会
  • 公司做网站需要给百度交钱吗/日本进口yamawa
  • 为什么点不开网站/中国纪检监察报
  • 厦门做网站的公司/北京全网营销推广公司
  • 怎么在网站添加链接/整站优化方案
  • 婚庆公司网站源码/各种手艺培训班
  • 网站开发市场价/seo如何建立优化网站
  • 哪家做网站公司/合肥seo推广排名
  • 广告网站搭建/网络营销活动策划
  • 网站怎么做微信接口/百度推广计划
  • 做盗版网站/中国十大电商公司排名
  • 南通网站建设系统/优化大师是什么
  • 哈尔滨做网站/关键词优化推广排名软件
  • 建立大型网站吗/短视频营销的特点
  • 肇庆做网站哪家好/seo顾问服务 乐云践新专家
  • 梦幻创意北京网站建设/友情链接检测平台
  • 免费网站制作公司/优化大师官网下载安装
  • 网站建设公司响应式网站模板下载/谷歌关键词查询工具
  • 自学网站开发多久/成都百度推广开户公司
  • 基于 InfluxDB 的服务器性能监控系统实战(三)
  • 人工智能-python-机器学习-决策树与集成学习:决策树分类与随机森林
  • 实现两个开发板的串口通讯(基于STC8实现)
  • String AOP、事务、缓存
  • 从Redisson源码角度深入理解Redis分布式锁的正确实现
  • C++高频知识点(十七)