Nginx平滑升級到最新版本

(一)簡述: ? ?

? ? 早上收到nginx最新漏洞的通知,Nginx官方發布最新的安全公告,在Nginx范圍過濾器中發現了一個安全問題(CVE-2017-7529),通過精心構造的惡意請求可能會導致整數溢出并且不正確處理范圍,從而導致敏感信息泄漏。

當使用Nginx標準模塊時,如果文件頭從緩存返回響應,允許攻擊者獲取緩存文件頭。在某些配置中,緩存文件頭可能包含后端服務器IP地址或其他敏感信息。此外,如果使用第三方模塊有潛在的可能導致拒絕服務。

影響版本

Nginx 0.5.6-1.13.2

漏洞等級

中危

Nginx 在官方公告中稱發現了一個范圍過濾器中的安全問題。通過精心構造的惡意請

求能造成整數溢出,對范圍的不當處理會導致敏感信息泄漏。

No. ? ? ? ?漏洞名稱 ? ? ? ? ? 漏洞危害

CVE-2017-7529 ?Nginx range 過濾器整形溢出漏洞 ?高危


針對 CVE–2017–7529 修復建議

針對 Nginx range 過濾器整形溢出漏洞的修復建議

1) 下面的配置可以作為暫時的解決辦法:

max_ranges 1;

2) 建議受影響用戶盡快升級至 1.13.3, 1.12.1

3) 及時安裝官方補丁。


雖然臨時可以解決,不過還是建議升級到最新的版本,官方建議升級到1.12.1。

(二)具體的升級步驟:

?(1)升級和安裝nginx第三方模塊一樣,需要查看原來安裝nginx的版本以及編譯的參數:

[root@ittestserver1?opt]#?/usr/local/nginx2/sbin/nginx?-V
nginx?version:?nginx/1.10.3
built?by?gcc?4.4.7?20120313?(Red?Hat?4.4.7-16)?(GCC)?
built?with?OpenSSL?1.1.0e??16?Feb?2017
TLS?SNI?support?enabled
configure?arguments:?--prefix=/usr/local/nginx2?--with-http_stub_status_module?--with-http_ssl_module?--with-http_realip_module?--with-http_gzip_static_module?--with-http_stub_status_module?--with-http_stub_status_module?--with-http_v2_module?--with-openssl=/tmp/install/openssl-1.1.0e?--with-http_v2_module

?(2)下載要升級的nginx版本

[root@ittestserver1?soft]#?wget?http://nginx.org/download/nginx-1.12.1.tar.gz
--2017-07-17?15:41:24--??http://nginx.org/download/nginx-1.12.1.tar.gz
正在解析主機?nginx.org...?206.251.255.63,?95.211.80.227,?2001:1af8:4060:a004:21::e3,?...
正在連接?nginx.org|206.251.255.63|:80...?已連接。
已發出?HTTP?請求,正在等待回應...?200?OK
長度:981093?(958K)?[application/octet-stream]
正在保存至:?“nginx-1.12.1.tar.gz”
90%?[=================================================>?????]?892,302??????265K/s?eta(英國中部時100%[======================================================>]?981,093??????291K/s???in?3.3s????
2017-07-17?15:41:28?(291?KB/s)?-?已保存?“nginx-1.12.1.tar.gz”?[981093/981093])

(3)解壓ningx下載的壓縮包編譯make,切記不要make install。

[root@ittestserver1?soft]#?tar?xf?nginx-1.12.1.tar.gz?
[root@ittestserver1?soft]#?cd?nginx-1.12.1
[root@ittestserver1?nginx-1.12.1]#?ls
auto??CHANGES??CHANGES.ru??conf??configure??contrib??html??LICENSE??man??README??src
[root@ittestserver1?nginx-1.12.1]#?./configure??--prefix=/usr/local/nginx2?\
--with-http_stub_status_module?\
--with-http_ssl_module?\
--with-http_realip_module?\
--with-http_gzip_static_module?\
--with-http_stub_status_module?\
--with-http_stub_status_module?\
--with-http_v2_module?\
--with-openssl=/tmp/install/openssl-1.1.0e?\
--with-http_v2_module
checking?for?OS+?Linux?2.6.32-358.el6.x86_64?x86_64
checking?for?C?compiler?...?found+?using?GNU?C?compiler+?gcc?version:?4.4.7?20120313?(Red?Hat?4.4.7-17)?(GCC)?
checking?for?gcc?-pipe?switch?...?found
checking?for?-Wl,-E?switch?...?found
checking?for?gcc?builtin?atomic?operations?...?found
checking?for?C99?variadic?macros?...?found
checking?for?gcc?variadic?macros?...?found
checking?for?gcc?builtin?64?bit?byteswap?...?found
checking?for?unistd.h?...?found
checking?for?inttypes.h?...?found
checking?for?limits.h?...?found
checking?for?sys/filio.h?...?not?found
checking?for?sys/param.h?...?found
checking?for?openat(),?fstatat()?...?found
checking?for?getaddrinfo()?...?found
checking?for?PCRE?library?...?found
checking?for?PCRE?JIT?support?...?found
checking?for?zlib?library?...?found
creating?objs/Makefile
Configuration?summary+?using?system?PCRE?library+?using?OpenSSL?library:?/tmp/install/openssl-1.1.0e+?using?system?zlib?librarynginx?path?prefix:?"/usr/local/nginx2"nginx?binary?file:?"/usr/local/nginx2/sbin/nginx"nginx?modules?path:?"/usr/local/nginx2/modules"nginx?configuration?prefix:?"/usr/local/nginx2/conf"nginx?configuration?file:?"/usr/local/nginx2/conf/nginx.conf"nginx?pid?file:?"/usr/local/nginx2/logs/nginx.pid"nginx?error?log?file:?"/usr/local/nginx2/logs/error.log"nginx?http?access?log?file:?"/usr/local/nginx2/logs/access.log"nginx?http?client?request?body?temporary?files:?"client_body_temp"nginx?http?proxy?temporary?files:?"proxy_temp"nginx?http?fastcgi?temporary?files:?"fastcgi_temp"nginx?http?uwsgi?temporary?files:?"uwsgi_temp"nginx?http?scgi?temporary?files:?"scgi_temp"
[root@ittestserver1?nginx-1.12.1]#?make

由于make的時間比較長,需要稍等下。

(4)make編譯完后會在安裝目錄下生成一個objs目錄且在該目錄下有一個nginx執行文件。

[root@ittestserver1?nginx-1.12.1]#?ls
auto?????CHANGES.ru??configure??html?????Makefile??objs????src
CHANGES??conf????????contrib????LICENSE??man???????README
[root@ittestserver1?nginx-1.12.1]#?ll?objs/
總用量?7124
-rw-r--r--?1?root?root???17459?7月??17?15:48?autoconf.err
-rw-r--r--?1?root?root???43530?7月??17?15:48?Makefile
-rwxr-xr-x?1?root?root?7152312?7月??17?15:51?nginx
-rw-r--r--?1?root?root????5345?7月??17?15:51?nginx.8
-rw-r--r--?1?root?root????7066?7月??17?15:48?ngx_auto_config.h
-rw-r--r--?1?root?root?????657?7月??17?15:48?ngx_auto_headers.h
-rw-r--r--?1?root?root????6242?7月??17?15:48?ngx_modules.c
-rw-r--r--?1?root?root???38232?7月??17?15:51?ngx_modules.o
drwxr-xr-x?9?root?root????4096?7月??17?15:48?src

(5)備份原來老的nginx文件

[root@ittestserver1?nginx-1.12.1]#?mv?/usr/local/nginx2/sbin/nginx?/usr/local/nginx2/sbin/nginx.bak
[root@ittestserver1?nginx-1.12.1]#?cp?objs/nginx
nginx????nginx.8??
[root@ittestserver1?nginx-1.12.1]#?cp?objs/nginx??/usr/local/nginx2/sbin/[root@ittestserver1?nginx-1.12.1]#?/usr/local/nginx2/sbin/nginx?-t
nginx:?the?configuration?file?/usr/local/nginx2/conf/nginx.conf?syntax?is?ok
nginx:?configuration?file?/usr/local/nginx2/conf/nginx.conf?test?is?successful

(6)使用make upgrade替換老的nginx進程

[root@ittestserver1 nginx-1.12.1]# make upgrade

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

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

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

kill -USR2 `cat /usr/local/nginx2/logs/nginx.pid`

sleep 1

test -f /usr/local/nginx2/logs/nginx.pid.oldbin

kill -QUIT `cat /usr/local/nginx2/logs/nginx.pid.oldbin`

(7)執行/usr/local/nginx2/sbin/nginx -V查看nginx最新的版本及編譯的參數

[root@ittestserver1?nginx-1.12.1]#?/usr/local/nginx2/sbin/nginx?-V
nginx?version:?nginx/1.12.1
built?by?gcc?4.4.7?20120313?(Red?Hat?4.4.7-17)?(GCC)?
built?with?OpenSSL?1.1.0e??16?Feb?2017
TLS?SNI?support?enabled
configure?arguments:?--prefix=/usr/local/nginx2?--with-http_stub_status_module?--with-http_ssl_module?--with-http_realip_module?--with-http_gzip_static_module?--with-http_stub_status_module?--with-http_stub_status_module?--with-http_v2_module?--with-openssl=/tmp/install/openssl-1.1.0e?--with-http_v2_module

至此升級完成。



本文轉自 lqbyz 51CTO博客,原文鏈接:http://blog.51cto.com/liqingbiao/1948430

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/393204.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/393204.shtml
英文地址,請注明出處:http://en.pswp.cn/news/393204.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

如何使用TypeScript從Microsoft Word生成GitHub markdown文件

by Manish Bansal通過Manish Bansal What? Why would one want to generate an MD file from a Microsoft word document? If that’s the first thought you had after reading this title, then let me give you a strong use case.什么? 為什么要從Microsoft …

Android Studio 導入 Android 系統模塊并編譯和調試

FAQ: AS導入系統模塊源碼,并且能夠編譯調試,正常查看java doc ???? Android AOSP基礎(五)Android Studio調試系統源碼的三種方式http://liuwangshu.cn/framework/aosp/5-debug-aosp.html Android AOSP基礎(四&…

2014年ENVI/IDL遙感應用與開發培訓班-11月重慶站 開始報名了

主辦單位: 中國遙感應用協會 Esri中國信息技術有限公司 內容簡單介紹: 依據中國遙感應用協會欒恩杰理事長推動國內遙感技術和應用的指示精神,2014年中國遙感應用協會組織培訓交流部與Esri中國信息技術有限公司將共同在多個城市舉辦以"傳…

Python自動化運維:Django之View視圖和Template

views詳解 http請求中產生兩個核心對象: http請求:HttpRequest對象 http響應:HttpResponse對象 (1) HttpRequest對象 當請求一個頁面時,Django 創建一個 HttpRequest對象包含原數據的請求。然后 Django 加載…

leetcode491. 遞增子序列(回溯算法)

給定一個整型數組, 你的任務是找到所有該數組的遞增子序列&#xff0c;遞增子序列的長度至少是2。 示例: 輸入: [4, 6, 7, 7] 輸出: [[4, 6], [4, 7], [4, 6, 7], [4, 6, 7, 7], [6, 7], [6, 7, 7], [7,7], [4,7,7]] 代碼 class Solution {List<List<Integer>>…

java重入鎖,再探JAVA重入鎖

之前的文章中簡單的為大家介紹了重入鎖JAVA并發之多線程基礎(2)。這里面也是簡單的為大家介紹了重入鎖的幾種性質&#xff0c;這里我們就去探索下里面是如何實現的。我們知道在使用的時候&#xff0c;必須鎖先有定義&#xff0c;然后我們再拿著當前的鎖進行加鎖操作&#xff0c…

azure服務器_如何使用Azure Functions和SendGrid構建無服務器報表服務器

azure服務器It’s 2018 and I just wrote a title that contains the words “Serverless server”. Life has no meaning.那是2018年&#xff0c;我剛剛寫了一個標題&#xff0c;其中包含“無服務器服務器”一詞。 生活沒有意義。 Despite that utterly contradictory headli…

【GoWeb開發實戰】Cookie

cookie Web開發中一個很重要的議題就是如何做好用戶的整個瀏覽過程的控制&#xff0c;因為HTTP協議是無狀態的&#xff0c;所以用戶的每一次請求都是無狀態的&#xff0c;我們不知道在整個Web操作過程中哪些連接與該用戶有關&#xff0c;我們應該如何來解決這個問題呢&#xff…

PhotoKit 照片庫的管理-獲取圖像

PHAsset部分屬性解析 1、HDR 和全景照片 mediaSubtypes 屬性驗證資源庫中的圖像在捕捉時是否開啟了 HDR&#xff0c;拍攝時是否使用了相機應用的全景模式。 2、收藏和隱藏資源 要驗證一個資源是否被用戶標記為收藏或被隱藏&#xff0c;只要檢查 PHAsset 實例的 favorite 和 hid…

cmail服務器安裝后無法登錄的解決辦法

安裝cmailserver 5.4.6軟件安裝、注冊都非常順利&#xff0c;webmail頁面也都正常打開&#xff0c;但是一點“登錄”就提示錯誤&#xff1a; Microsoft VBScript 運行時錯誤 錯誤 800a01ad ActiveX 部件不能創建對象: CMailCOM.POP3.1 /mail/login.asp&#xff0c;行 42 點“…

matlab對人工智能,MATLAB與人工智能深度學習和機器學習.PDF

MATLAB與人工智能深度學習和機器學習MATLAB 與人工智能&#xff1a;深度學習有多遠&#xff1f;© 2017 The MathWorks, Inc.1機器學習8機器學習無處不在? 圖像識別 [TBD]? 語音識別? 股票預測? 醫療診斷? 數據分析? 機器人? 更多……9什么是機器學習&#xff1f;機…

leetcode1471. 數組中的 k 個最強值(排序)

給你一個整數數組 arr 和一個整數 k 。 設 m 為數組的中位數&#xff0c;只要滿足下述兩個前提之一&#xff0c;就可以判定 arr[i] 的值比 arr[j] 的值更強&#xff1a; |arr[i] - m| > |arr[j] - m| |arr[i] - m| |arr[j] - m|&#xff0c;且 arr[i] > arr[j] 請返回…

Spring中WebApplicationInitializer的理解

現在JavaConfig配置方式在逐步取代xml配置方式。而WebApplicationInitializer可以看做是Web.xml的替代&#xff0c;它是一個接口。通過實現WebApplicationInitializer&#xff0c;在其中可以添加servlet&#xff0c;listener等&#xff0c;在加載Web項目的時候會加載這個接口實…

使用fetch封裝請求_關于如何使用Fetch API執行HTTP請求的實用ES6指南

使用fetch封裝請求In this guide, I’ll show you how to use the Fetch API (ES6) to perform HTTP requests to an REST API with some practical examples you’ll most likely encounter.在本指南中&#xff0c;我將向您展示如何使用Fetch API(ES6 )來執行對REST API的 HTT…

hadoop集群中客戶端修改、刪除文件失敗

這是因為hadoop集群在啟動時自動進入安全模式 查看安全模式狀態&#xff1a;hadoop fs –safemode get 進入安全模式狀態&#xff1a;hadoop fs –safemode enter 退出安全模式狀態&#xff1a;hadoop fs –safemode leave轉載于:https://www.cnblogs.com/lishengnan/p/a123.ht…

OpenStack nova-network 支持多vlan技術實現片段代碼

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748

Rest API

什么是接口測試 接口測試又稱 API 測試 Application Programming Interface 接口測試是測試系統組件間接口的一種測試。重點關注數據傳遞。 接口測試一般會用于多系統間交互開發&#xff0c;或者擁有多個子系統的應用系統開發的測試。 為什么要做接口測試 很多系統關聯都是基于…

php循環checkbox,php循環刪除checkbox | 學步園

一、首先要了解sql語句$SQLdelete from user where id in (1,2,4);表單大概是&#xff1a;form action methodpost input nameID_Dele[] typecheckbox idID_Dele[] value1input nameID_Dele[] typecheckbox idID_Dele[] value2input nameID_Dele[] type首先要了解sql語句$SQL&q…

leetcode1451. 重新排列句子中的單詞(排序)

「句子」是一個用空格分隔單詞的字符串。給你一個滿足下述格式的句子 text : 句子的首字母大寫 text 中的每個單詞都用單個空格分隔。 請你重新排列 text 中的單詞&#xff0c;使所有單詞按其長度的升序排列。如果兩個單詞的長度相同&#xff0c;則保留其在原句子中的相對順序…

Java+Oracle實現事務——JDBC事務

J2EE支持JDBC事務、JTA事務和容器事務事務&#xff0c;這里說一下怎樣實現JDBC事務。 JDBC事務是由Connection對象所控制的&#xff0c;它提供了兩種事務模式&#xff1a;自己主動提交和手動提交&#xff0c;默認是自己主動提交。 自己主動提交就是&#xff1a;在JDBC中。在一個…