怎樣在CentOS或RHEL系統(tǒng)上檢查可用的安全更新

怎樣在CentOS或RHEL系統(tǒng)上檢查可用的安全更新,相信很多沒有經(jīng)驗(yàn)的人對此束手無策,為此本文總結(jié)了問題出現(xiàn)的原因和解決方法,通過這篇文章希望你能解決這個(gè)問題。

湞江ssl適用于網(wǎng)站、小程序/APP、API接口等需要進(jìn)行數(shù)據(jù)傳輸應(yīng)用場景,ssl證書未來市場廣闊!成為創(chuàng)新互聯(lián)的ssl證書銷售渠道,可以享受市場價(jià)格4-6折優(yōu)惠!如果有意向歡迎電話聯(lián)系或者加微信:028-86922220(備注:SSL證書合作)期待與您的合作!

當(dāng)你更新系統(tǒng)時(shí),根據(jù)你所在公司的安全策略,有時(shí)候可能只需要打上與安全相關(guān)的補(bǔ)丁。大多數(shù)情況下,這應(yīng)該是出于程序兼容性方面的考量。那該怎樣實(shí)踐呢?有沒有辦法讓 yum 只安裝安全補(bǔ)丁呢?

答案是肯定的,可以用 yum 包管理器輕松實(shí)現(xiàn)。

在這篇文章中,我們不但會(huì)提供所需的信息。而且,我們會(huì)介紹一些額外的命令,可以幫你獲取指定安全更新的詳實(shí)信息。

希望這樣可以啟發(fā)你去了解并修復(fù)你列表上的那些漏洞。一旦有安全漏洞被公布,就必須更新受影響的軟件,這樣可以降低系統(tǒng)中的安全風(fēng)險(xiǎn)。

對于 RHEL 或 CentOS 6 系統(tǒng),運(yùn)行下面的 Yum 命令 來安裝 yum 安全插件。

# yum -y install yum-plugin-security

在 RHEL 7&8 或是 CentOS 7&8 上面,這個(gè)插件已經(jīng)是 yum 的一部分了,不用單獨(dú)安裝。

要列出全部可用的補(bǔ)?。òò踩?、Bug 修復(fù)以及產(chǎn)品改進(jìn)),但不安裝它們:

# yum updateinfo list availableLoaded plugins: changelog, package_upload, product-id, search-disabled-repos,              : subscription-manager, verify, versionlockRHSA-2014:1031 Important/Sec. 389-ds-base-1.3.1.6-26.el7_0.x86_64RHSA-2015:0416 Important/Sec. 389-ds-base-1.3.3.1-13.el7.x86_64RHBA-2015:0626 bugfix         389-ds-base-1.3.3.1-15.el7_1.x86_64RHSA-2015:0895 Important/Sec. 389-ds-base-1.3.3.1-16.el7_1.x86_64RHBA-2015:1554 bugfix         389-ds-base-1.3.3.1-20.el7_1.x86_64RHBA-2015:1960 bugfix         389-ds-base-1.3.3.1-23.el7_1.x86_64RHBA-2015:2351 bugfix         389-ds-base-1.3.4.0-19.el7.x86_64RHBA-2015:2572 bugfix         389-ds-base-1.3.4.0-21.el7_2.x86_64RHSA-2016:0204 Important/Sec. 389-ds-base-1.3.4.0-26.el7_2.x86_64RHBA-2016:0550 bugfix         389-ds-base-1.3.4.0-29.el7_2.x86_64RHBA-2016:1048 bugfix         389-ds-base-1.3.4.0-30.el7_2.x86_64RHBA-2016:1298 bugfix         389-ds-base-1.3.4.0-32.el7_2.x86_64

要統(tǒng)計(jì)補(bǔ)丁的大約數(shù)量,運(yùn)行下面的命令:

# yum updateinfo list available | wc -l11269

想列出全部可用的安全補(bǔ)丁但不安裝,以下命令用來展示你系統(tǒng)里已安裝和待安裝的推薦補(bǔ)?。?/p>

# yum updateinfo list security allLoaded plugins: changelog, package_upload, product-id, search-disabled-repos,              : subscription-manager, verify, versionlock  RHSA-2014:1031 Important/Sec. 389-ds-base-1.3.1.6-26.el7_0.x86_64  RHSA-2015:0416 Important/Sec. 389-ds-base-1.3.3.1-13.el7.x86_64  RHSA-2015:0895 Important/Sec. 389-ds-base-1.3.3.1-16.el7_1.x86_64  RHSA-2016:0204 Important/Sec. 389-ds-base-1.3.4.0-26.el7_2.x86_64  RHSA-2016:2594 Moderate/Sec.  389-ds-base-1.3.5.10-11.el7.x86_64  RHSA-2017:0920 Important/Sec. 389-ds-base-1.3.5.10-20.el7_3.x86_64  RHSA-2017:2569 Moderate/Sec.  389-ds-base-1.3.6.1-19.el7_4.x86_64  RHSA-2018:0163 Important/Sec. 389-ds-base-1.3.6.1-26.el7_4.x86_64  RHSA-2018:0414 Important/Sec. 389-ds-base-1.3.6.1-28.el7_4.x86_64  RHSA-2018:1380 Important/Sec. 389-ds-base-1.3.7.5-21.el7_5.x86_64  RHSA-2018:2757 Moderate/Sec.  389-ds-base-1.3.7.5-28.el7_5.x86_64  RHSA-2018:3127 Moderate/Sec.  389-ds-base-1.3.8.4-15.el7.x86_64  RHSA-2014:1031 Important/Sec. 389-ds-base-libs-1.3.1.6-26.el7_0.x86_64

要顯示所有待安裝的安全補(bǔ)丁:

# yum updateinfo list security all | grep -v "i"   RHSA-2014:1031 Important/Sec. 389-ds-base-1.3.1.6-26.el7_0.x86_64  RHSA-2015:0416 Important/Sec. 389-ds-base-1.3.3.1-13.el7.x86_64  RHSA-2015:0895 Important/Sec. 389-ds-base-1.3.3.1-16.el7_1.x86_64  RHSA-2016:0204 Important/Sec. 389-ds-base-1.3.4.0-26.el7_2.x86_64  RHSA-2016:2594 Moderate/Sec.  389-ds-base-1.3.5.10-11.el7.x86_64  RHSA-2017:0920 Important/Sec. 389-ds-base-1.3.5.10-20.el7_3.x86_64  RHSA-2017:2569 Moderate/Sec.  389-ds-base-1.3.6.1-19.el7_4.x86_64  RHSA-2018:0163 Important/Sec. 389-ds-base-1.3.6.1-26.el7_4.x86_64  RHSA-2018:0414 Important/Sec. 389-ds-base-1.3.6.1-28.el7_4.x86_64  RHSA-2018:1380 Important/Sec. 389-ds-base-1.3.7.5-21.el7_5.x86_64  RHSA-2018:2757 Moderate/Sec.  389-ds-base-1.3.7.5-28.el7_5.x86_64

要統(tǒng)計(jì)全部安全補(bǔ)丁的大致數(shù)量,運(yùn)行下面的命令:

# yum updateinfo list security all | wc -l3522

下面根據(jù)已裝軟件列出可更新的安全補(bǔ)丁。這包括 bugzilla(bug 修復(fù))、CVE(知名漏洞數(shù)據(jù)庫)、安全更新等:

# yum updateinfo list security 或者 # yum updateinfo list sec Loaded plugins: changelog, package_upload, product-id, search-disabled-repos,              : subscription-manager, verify, versionlock RHSA-2018:3665 Important/Sec. NetworkManager-1:1.12.0-8.el7_6.x86_64RHSA-2018:3665 Important/Sec. NetworkManager-adsl-1:1.12.0-8.el7_6.x86_64RHSA-2018:3665 Important/Sec. NetworkManager-bluetooth-1:1.12.0-8.el7_6.x86_64RHSA-2018:3665 Important/Sec. NetworkManager-config-server-1:1.12.0-8.el7_6.noarchRHSA-2018:3665 Important/Sec. NetworkManager-glib-1:1.12.0-8.el7_6.x86_64RHSA-2018:3665 Important/Sec. NetworkManager-libnm-1:1.12.0-8.el7_6.x86_64RHSA-2018:3665 Important/Sec. NetworkManager-ppp-1:1.12.0-8.el7_6.x86_64RHSA-2018:3665 Important/Sec. NetworkManager-team-1:1.12.0-8.el7_6.x86_64RHSA-2018:3665 Important/Sec. NetworkManager-tui-1:1.12.0-8.el7_6.x86_64RHSA-2018:3665 Important/Sec. NetworkManager-wifi-1:1.12.0-8.el7_6.x86_64RHSA-2018:3665 Important/Sec. NetworkManager-wwan-1:1.12.0-8.el7_6.x86_64

顯示所有與安全相關(guān)的更新,并且返回一個(gè)結(jié)果來告訴你是否有可用的補(bǔ)丁:

# yum --security check-updateLoaded plugins: changelog, package_upload, product-id, search-disabled-repos, subscription-manager, verify, versionlockrhel-7-server-rpms                                                                                                                            | 2.0 kB  00:00:00--> policycoreutils-devel-2.2.5-20.el7.x86_64 from rhel-7-server-rpms excluded (updateinfo)--> smc-raghumalayalam-fonts-6.0-7.el7.noarch from rhel-7-server-rpms excluded (updateinfo)--> amanda-server-3.3.3-17.el7.x86_64 from rhel-7-server-rpms excluded (updateinfo)--> 389-ds-base-libs-1.3.4.0-26.el7_2.x86_64 from rhel-7-server-rpms excluded (updateinfo)--> 1:cups-devel-1.6.3-26.el7.i686 from rhel-7-server-rpms excluded (updateinfo)--> openwsman-client-2.6.3-3.git4391e5c.el7.i686 from rhel-7-server-rpms excluded (updateinfo)--> 1:emacs-24.3-18.el7.x86_64 from rhel-7-server-rpms excluded (updateinfo)--> augeas-libs-1.4.0-2.el7_4.2.i686 from rhel-7-server-rpms excluded (updateinfo)--> samba-winbind-modules-4.2.3-10.el7.i686 from rhel-7-server-rpms excluded (updateinfo)--> tftp-5.2-11.el7.x86_64 from rhel-7-server-rpms excluded (updateinfo)..35 package(s) needed for security, out of 115 availableNetworkManager.x86_64                        1:1.12.0-10.el7_6            rhel-7-server-rpmsNetworkManager-adsl.x86_64                   1:1.12.0-10.el7_6            rhel-7-server-rpmsNetworkManager-bluetooth.x86_64              1:1.12.0-10.el7_6            rhel-7-server-rpmsNetworkManager-config-server.noarch          1:1.12.0-10.el7_6            rhel-7-server-rpmsNetworkManager-glib.x86_64                   1:1.12.0-10.el7_6            rhel-7-server-rpmsNetworkManager-libnm.x86_64                  1:1.12.0-10.el7_6            rhel-7-server-rpmsNetworkManager-ppp.x86_64                    1:1.12.0-10.el7_6            rhel-7-server-rpms

列出所有可用的安全補(bǔ)丁,并且顯示其詳細(xì)信息:

# yum info-sec..===============================================================================  tzdata bug fix and enhancement update===============================================================================  Update ID : RHBA-2019:0689    Release : 0       Type : bugfix     Status : final     Issued : 2019-03-28 19:27:44 UTCDescription : The tzdata packages contain data files with rules for various            : time zones.            :            : The tzdata packages have been updated to version            : 2019a, which addresses recent time zone changes.            : Notably:            :            : * The Asia/Hebron and Asia/Gaza zones will start            :   DST on 2019-03-30, rather than 2019-03-23 as            :   previously predicted.            : * Metlakatla rejoined Alaska time on 2019-01-20,            :   ending its observances of Pacific standard time.            :            : (BZ#1692616, BZ#1692615, BZ#1692816)            :            : Users of tzdata are advised to upgrade to these            : updated packages.   Severity : None

如果你想要知道某個(gè)更新的具體內(nèi)容,可以運(yùn)行下面這個(gè)命令:

# yum updateinfo RHSA-2019:0163 Loaded plugins: changelog, package_upload, product-id, search-disabled-repos, subscription-manager, verify, versionlockrhel-7-server-rpms                                                                                                                            | 2.0 kB  00:00:00===============================================================================  Important: kernel security, bug fix, and enhancement update===============================================================================  Update ID : RHSA-2019:0163    Release : 0       Type : security     Status : final     Issued : 2019-01-29 15:21:23 UTC    Updated : 2019-01-29 15:23:47 UTC       Bugs : 1641548 - CVE-2018-18397 kernel: userfaultfd bypasses tmpfs file permissions            : 1641878 - CVE-2018-18559 kernel: Use-after-free due to race condition in AF_PACKET implementation       CVEs : CVE-2018-18397            : CVE-2018-18559Description : The kernel packages contain the Linux kernel, the core of any            : Linux operating system.            :            : Security Fix(es):            :            : * kernel: Use-after-free due to race condition in            :   AF_PACKET implementation (CVE-2018-18559)            :            : * kernel: userfaultfd bypasses tmpfs file            :   permissions (CVE-2018-18397)            :            : For more details about the security issue(s),            : including the impact, a CVSS score, and other            : related information, refer to the CVE page(s)            : listed in the References section.            :            : Bug Fix(es):            :            : These updated kernel packages include also            : numerous bug fixes and enhancements. Space            : precludes documenting all of the bug fixes in this            : advisory. See the descriptions in the related            : Knowledge Article:            : https://access.redhat.com/articles/3827321   Severity : Importantupdateinfo info done

跟之前類似,你可以只查詢那些通過 CVE 釋出的系統(tǒng)漏洞:

# yum updateinfo list cves Loaded plugins: changelog, package_upload, product-id, search-disabled-repos,              : subscription-manager, verify, versionlockCVE-2018-15688 Important/Sec. NetworkManager-1:1.12.0-8.el7_6.x86_64CVE-2018-15688 Important/Sec. NetworkManager-adsl-1:1.12.0-8.el7_6.x86_64CVE-2018-15688 Important/Sec. NetworkManager-bluetooth-1:1.12.0-8.el7_6.x86_64CVE-2018-15688 Important/Sec. NetworkManager-config-server-1:1.12.0-8.el7_6.noarchCVE-2018-15688 Important/Sec. NetworkManager-glib-1:1.12.0-8.el7_6.x86_64CVE-2018-15688 Important/Sec. NetworkManager-libnm-1:1.12.0-8.el7_6.x86_64CVE-2018-15688 Important/Sec. NetworkManager-ppp-1:1.12.0-8.el7_6.x86_64CVE-2018-15688 Important/Sec. NetworkManager-team-1:1.12.0-8.el7_6.x86_64

你也可以查看那些跟 bug 修復(fù)相關(guān)的更新,運(yùn)行下面的命令:

# yum updateinfo list bugfix | less Loaded plugins: changelog, package_upload, product-id, search-disabled-repos,              : subscription-manager, verify, versionlockRHBA-2018:3349 bugfix NetworkManager-1:1.12.0-7.el7_6.x86_64RHBA-2019:0519 bugfix NetworkManager-1:1.12.0-10.el7_6.x86_64RHBA-2018:3349 bugfix NetworkManager-adsl-1:1.12.0-7.el7_6.x86_64RHBA-2019:0519 bugfix NetworkManager-adsl-1:1.12.0-10.el7_6.x86_64RHBA-2018:3349 bugfix NetworkManager-bluetooth-1:1.12.0-7.el7_6.x86_64RHBA-2019:0519 bugfix NetworkManager-bluetooth-1:1.12.0-10.el7_6.x86_64RHBA-2018:3349 bugfix NetworkManager-config-server-1:1.12.0-7.el7_6.noarchRHBA-2019:0519 bugfix NetworkManager-config-server-1:1.12.0-10.el7_6.noarch

要想得到待安裝更新的摘要信息,運(yùn)行這個(gè):

# yum updateinfo summaryLoaded plugins: changelog, package_upload, product-id, search-disabled-repos, subscription-manager, verify, versionlockrhel-7-server-rpms                                                                                                                            | 2.0 kB  00:00:00Updates Information Summary: updates    13 Security notice(s)         9 Important Security notice(s)         3 Moderate Security notice(s)         1 Low Security notice(s)    35 Bugfix notice(s)     1 Enhancement notice(s)updateinfo summary done

如果只想打印出低級別的安全更新,運(yùn)行下面這個(gè)命令。類似的,你也可以只查詢重要級別和中等級別的安全更新。

# yum updateinfo list sec | grep -i "Low" RHSA-2019:0201 Low/Sec.       libgudev1-219-62.el7_6.3.x86_64RHSA-2019:0201 Low/Sec.       systemd-219-62.el7_6.3.x86_64RHSA-2019:0201 Low/Sec.       systemd-libs-219-62.el7_6.3.x86_64RHSA-2019:0201 Low/Sec.       systemd-sysv-219-62.el7_6.3.x86_64

看完上述內(nèi)容,你們掌握怎樣在CentOS或RHEL系統(tǒng)上檢查可用的安全更新的方法了嗎?如果還想學(xué)到更多技能或想了解更多相關(guān)內(nèi)容,歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,感謝各位的閱讀!

標(biāo)題名稱:怎樣在CentOS或RHEL系統(tǒng)上檢查可用的安全更新
瀏覽地址:http://muchs.cn/article0/joggio.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供App開發(fā)移動(dòng)網(wǎng)站建設(shè)、網(wǎng)站策劃商城網(wǎng)站、品牌網(wǎng)站建設(shè)、App設(shè)計(jì)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

成都做網(wǎng)站