自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

在RHEL和CentOS上檢查或列出已安裝的安全更新的兩種方法

系統(tǒng) Linux
在本文中,我們將向你展示如何檢查已安裝的安全更新。我會介紹兩種方法,你可以選擇最適合你的。

[[267757]]

我們過去曾寫過兩篇關(guān)于這個主題的文章,每篇文章都是根據(jù)不同的要求發(fā)表的。如果你想在開始之前瀏覽這些文章。請通過以下鏈接:

 

這些文章與其他文章相互關(guān)聯(lián),因此,在深入研究之前,最好先閱讀這些文章。

在本文中,我們將向你展示如何檢查已安裝的安全更新。我會介紹兩種方法,你可以選擇最適合你的。

此外,我還添加了一個小的 shell 腳本,它為你提供已安裝的安全包計數(shù)。

運(yùn)行以下命令獲取系統(tǒng)上已安裝的安全更新的列表。

  1. # yum updateinfo list security installed
  2.  
  3. Loaded plugins: changelog, package_upload, product-id, search-disabled-repos,
  4. : subscription-manager, verify, versionlock
  5. RHSA-2015:2315 Moderate/Sec. ModemManager-glib-1.1.0-8.git20130913.el7.x86_64
  6. RHSA-2015:2315 Moderate/Sec. NetworkManager-1:1.0.6-27.el7.x86_64
  7. RHSA-2016:2581 Low/Sec. NetworkManager-1:1.4.0-12.el7.x86_64
  8. RHSA-2017:2299 Moderate/Sec. NetworkManager-1:1.8.0-9.el7.x86_64
  9. RHSA-2015:2315 Moderate/Sec. NetworkManager-adsl-1:1.0.6-27.el7.x86_64
  10. RHSA-2016:2581 Low/Sec. NetworkManager-adsl-1:1.4.0-12.el7.x86_64
  11. RHSA-2017:2299 Moderate/Sec. NetworkManager-adsl-1:1.8.0-9.el7.x86_64
  12. RHSA-2015:2315 Moderate/Sec. NetworkManager-bluetooth-1:1.0.6-27.el7.x86_64

要計算已安裝的安全包的數(shù)量,請運(yùn)行以下命令:

  1. # yum updateinfo list security installed | wc -l
  2. 1046

僅打印安裝包列表:

  1. # yum updateinfo list security all | grep -w "i"
  2.  
  3. i RHSA-2015:2315 Moderate/Sec. ModemManager-glib-1.1.0-8.git20130913.el7.x86_64
  4. i RHSA-2015:2315 Moderate/Sec. NetworkManager-1:1.0.6-27.el7.x86_64
  5. i RHSA-2016:2581 Low/Sec. NetworkManager-1:1.4.0-12.el7.x86_64
  6. i RHSA-2017:2299 Moderate/Sec. NetworkManager-1:1.8.0-9.el7.x86_64
  7. i RHSA-2015:2315 Moderate/Sec. NetworkManager-adsl-1:1.0.6-27.el7.x86_64
  8. i RHSA-2016:2581 Low/Sec. NetworkManager-adsl-1:1.4.0-12.el7.x86_64
  9. i RHSA-2017:2299 Moderate/Sec. NetworkManager-adsl-1:1.8.0-9.el7.x86_64
  10. i RHSA-2015:2315 Moderate/Sec. NetworkManager-bluetooth-1:1.0.6-27.el7.x86_64
  11. i RHSA-2016:2581 Low/Sec. NetworkManager-bluetooth-1:1.4.0-12.el7.x86_64
  12. i RHSA-2017:2299 Moderate/Sec. NetworkManager-bluetooth-1:1.8.0-9.el7.x86_64
  13. i RHSA-2015:2315 Moderate/Sec. NetworkManager-config-server-1:1.0.6-27.el7.x86_64
  14. i RHSA-2016:2581 Low/Sec. NetworkManager-config-server-1:1.4.0-12.el7.x86_64
  15. i RHSA-2017:2299 Moderate/Sec. NetworkManager-config-server-1:1.8.0-9.el7.noarch

要計算已安裝的安全包的數(shù)量,請運(yùn)行以下命令:

  1. # yum updateinfo list security all | grep -w "i" | wc -l
  2. 1043

或者,你可以檢查指定包修復(fù)的漏洞列表。

在此例中,我們將檢查 “openssh” 包中已修復(fù)的漏洞列表:

  1. # rpm -q --changelog openssh | grep -i CVE
  2.  
  3. - Fix for CVE-2017-15906 (#1517226)
  4. - CVE-2015-8325: privilege escalation via user's PAM environment and UseLogin=yes (#1329191)
  5. - CVE-2016-1908: possible fallback from untrusted to trusted X11 forwarding (#1298741)
  6. - CVE-2016-3115: missing sanitisation of input for X11 forwarding (#1317819)
  7. - prevents CVE-2016-0777 and CVE-2016-0778
  8. - Security fixes released with openssh-6.9 (CVE-2015-5352) (#1247864)
  9. - only query each keyboard-interactive device once (CVE-2015-5600) (#1245971)
  10. - add new option GSSAPIEnablek5users and disable using ~/.k5users by default CVE-2014-9278
  11. - prevent a server from skipping SSHFP lookup - CVE-2014-2653 (#1081338)
  12. - change default value of MaxStartups - CVE-2010-5107 (#908707)
  13. - CVE-2010-4755
  14. - merged cve-2007_3102 to audit patch
  15. - fixed audit log injection problem (CVE-2007-3102)
  16. - CVE-2006-5794 - properly detect failed key verify in monitor (#214641)
  17. - CVE-2006-4924 - prevent DoS on deattack detector (#207957)
  18. - CVE-2006-5051 - don't call cleanups from signal handler (#208459)
  19. - use fork+exec instead of system in scp - CVE-2006-0225 (#168167)

同樣,你可以通過運(yùn)行以下命令來檢查相應(yīng)的包中是否修復(fù)了指定的漏洞:

  1. # rpm -q --changelog openssh | grep -i CVE-2016-3115
  2.  
  3. - CVE-2016-3115: missing sanitisation of input for X11 forwarding (#1317819)

如何使用 Shell 腳本計算安裝的安全包?

我添加了一個小的 shell 腳本,它可以幫助你計算已安裝的安全包列表。

  1. # vi /opt/scripts/security-check.sh
  2.  
  3. #!/bin/bash
  4. echo "+-------------------------+"
  5. echo "|Security Advisories Count|"
  6. echo "+-------------------------+"
  7. for i in Important Moderate Low
  8. do
  9. sec=$(yum updateinfo list security installed | grep $i | wc -l)
  10. echo "$i: $sec"
  11. done | column -t
  12. echo "+-------------------------+"

security-check.sh 文件執(zhí)行權(quán)限。

  1. $ chmod +x security-check.sh

最后執(zhí)行腳本統(tǒng)計。

  1. # sh /opt/scripts/security-check.sh
  2.  
  3. +-------------------------+
  4. |Security Advisories Count|
  5. +-------------------------+
  6. Important: 480
  7. Moderate: 410
  8. Low: 111
  9. +-------------------------+

 

責(zé)任編輯:龐桂玉 來源: Linux中國
相關(guān)推薦

2019-06-05 10:20:09

安全更新命令Linux

2016-12-07 18:12:05

CentOSRHEL安全補(bǔ)丁

2020-09-15 09:48:41

PHP

2010-08-04 17:41:52

掛載NFS

2010-07-26 15:42:34

Perl模塊

2011-09-19 10:25:59

VimUbuntu

2009-09-25 14:04:09

Hibernate eHibernate h

2010-04-13 09:50:44

Oracle跟蹤

2010-11-24 14:36:25

修復(fù)mysql表

2011-03-30 17:04:24

MySQL添加用戶

2019-02-25 09:55:32

UbuntuDebian軟件包

2021-09-02 00:13:41

Windows 11Windows微軟

2009-08-03 17:53:11

XML數(shù)據(jù)

2010-02-06 14:35:36

ibmdwRUP迭代

2009-06-18 11:09:42

2009-08-05 13:34:18

C#日期相減

2010-09-07 11:18:10

2020-09-16 18:27:36

Linux方法IP地址

2010-11-12 11:44:37

SQL Server刪

2019-09-15 17:35:28

Wireshark解密HTTPS
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號