设为首页 收藏本站
查看: 1285|回复: 0

[经验分享] 关于centos7和centos6中平滑升级nginx到新版本v1.12.1修复nginx最新漏洞CVE-2017

[复制链接]

尚未签到

发表于 2017-12-23 22:21:54 | 显示全部楼层 |阅读模式
  关于centos7和centos6中平滑升级nginx到新版本v1.12.1修复CVE-2017-7529漏洞的解决方案
  漏洞描述
  2017年7月11日,Nginx官方发布最新的安全公告,在Nginx范围过滤器中发现了一个安全问题(CVE-2017-7529),通过精心构造的恶意请求可能会导致整数溢出并且不正确处理范围,从而导致敏感信息泄漏。
  当使用Nginx标准模块时,如果文件头从缓存返回响应,允许攻击者获取缓存文件头。在某些配置中,缓存文件头可能包含后端服务器IP地址或其他敏感信息。
  此外,如果使用第三方模块有潜在的可能导致拒绝服务。
  影响版本
  Nginx 0.5.6-1.13.2
  漏洞等级
  中危
  受影响网站:
  安全指数分析中国互联网共有713651个网站受到影响。
  修复建议
  1、升级Nginx到最新无漏洞版本,当前1.13.3,1.12.1版本中已修复了这个问题。
  2、临时方案:配置 max_ranges 1;
  3、使用百度云加速WAF防火墙进行防御。
  4、添加网站至安全指数,及时了解网站组件突发/0day漏洞。
  1.添加nginx官方yum源
  # vim /etc/yum.repos.d/nginx.repo
  centos7:
  

[nginx]  
name
=nginx repo  
baseurl
=http://nginx.org/packages/centos/7/$basearch/  
gpgcheck=0
  
enabled=1
  

  centos6:
  

[nginx]  
name
=nginx repo  
baseurl
=http://nginx.org/packages/centos/6/$basearch/  
gpgcheck=0
  
enabled=1
  

  看到有最新的1.12.1版本在yum列表中了
  

# yum list |grep nginx  
nginx.x86_64
1:1.10.2-1.el7 @epel  
nginx
-all-modules.noarch 1:1.10.2-1.el7 @epel  
nginx
-filesystem.noarch 1:1.10.2-1.el7 @epel  
nginx
-mod-http-geoip.x86_64 1:1.10.2-1.el7 @epel  
nginx
-mod-http-image-filter.x86_64 1:1.10.2-1.el7 @epel  
nginx
-mod-http-perl.x86_64 1:1.10.2-1.el7 @epel  
nginx
-mod-http-xslt-filter.x86_64 1:1.10.2-1.el7 @epel  
nginx
-mod-mail.x86_64 1:1.10.2-1.el7 @epel  
nginx
-mod-stream.x86_64 1:1.10.2-1.el7 @epel  
collectd
-nginx.x86_64 5.7.1-2.el7 epel  
munin
-nginx.noarch 2.0.33-1.el7 epel  
nextcloud
-nginx.noarch 10.0.4-2.el7 epel  
nginx.x86_64
1:1.12.1-1.el7.ngx nginx  
nginx
-debug.x86_64 1:1.8.0-1.el7.ngx nginx  
nginx
-debuginfo.x86_64 1:1.12.1-1.el7.ngx nginx  
nginx
-module-geoip.x86_64 1:1.12.1-1.el7.ngx nginx  
nginx
-module-geoip-debuginfo.x86_64 1:1.12.1-1.el7.ngx nginx  
nginx
-module-image-filter.x86_64 1:1.12.1-1.el7.ngx nginx  
nginx
-module-image-filter-debuginfo.x86_64  

1:1.12.1-1.el7.ngx nginx  
nginx
-module-njs.x86_64 1:1.12.1.0.1.10-1.el7.ngx nginx  
nginx
-module-njs-debuginfo.x86_64 1:1.12.1.0.1.10-1.el7.ngx nginx  
nginx
-module-perl.x86_64 1:1.12.1-1.el7.ngx nginx  
nginx
-module-perl-debuginfo.x86_64 1:1.12.1-1.el7.ngx nginx  
nginx
-module-xslt.x86_64 1:1.12.1-1.el7.ngx nginx  
nginx
-module-xslt-debuginfo.x86_64 1:1.12.1-1.el7.ngx nginx  
nginx
-nr-agent.noarch 2.0.0-12.el7.ngx nginx  
owncloud
-nginx.noarch 9.1.5-1.el7 epel  
pcp
-pmda-nginx.x86_64 3.11.3-4.el7 base  
python2
-certbot-nginx.noarch 0.14.1-1.el7 epel  

  2.平滑升级nginx
  

# yum update nginx -y  

  可以看到已经成功升级到v1.12.1了
  

# nginx -v  
nginx version: nginx
/1.12.1  

  升级以后发现nginx语法检测无法通过
  

# nginx -t  
nginx: [emerg] module
"/usr/lib64/nginx/modules/ngx_http_perl_module.so" version 1010002 instead of 1012001 in /usr/share/nginx/modules/mod-http-image-filter.conf:2  
nginx: configuration
file /etc/nginx/nginx.conf test failed  

  解决办法:
  vim /etc/nginx/nginx.conf
  将这行注释掉
  

#include /usr/share/nginx/modules/*.conf;  

  分析:是因为modules指向了新的路径/usr/lib64/nginx/modules
  

[iyunv@test11_ckmusic_test nginx]# ll  
total
40  
drwxr
-xr-x 2 root root 114 Jul 13 10:47 conf.d  
drwxr
-xr-x 2 root root 6 Oct 31 2016 default.d  

-rw-r--r-- 1 root root 1007 Jul 11 21:50 fastcgi_params  

-rw-r--r-- 1 root root 2837 Jul 11 21:50 koi-utf  

-rw-r--r-- 1 root root 2223 Jul 11 21:50 koi-win  

-rw-r--r-- 1 root root 3957 Jul 11 21:50 mime.types  
lrwxrwxrwx
1 root root 29 Jul 13 10:47 modules -> ../../usr/lib64/nginx/modules  

-rw-r--r-- 1 root root 1178 Jul 13 11:12 nginx.conf  

-rw-r--r-- 1 root root 1979 Jun 19 09:47 nginx.conf.bak  

-rw-r--r-- 1 root root 643 Jul 11 21:47 nginx.conf.rpmnew  

-rw-r--r-- 1 root root 636 Jul 11 21:50 scgi_params  

-rw-r--r-- 1 root root 664 Jul 11 21:50 uwsgi_params  

-rw-r--r-- 1 root root 3610 Jul 11 21:50 win-utf  

  3.平滑重启
  

# systemctl>  

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-427342-1-1.html 上篇帖子: 【转载】ffmpeg,rtmpdump和nginx rtmp实现录屏,直播和录制 下篇帖子: Logstash收集nginx日志之使用grok过滤插件解析日志
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表