当前位置: 首页>>技术教程>>正文


为什么 unattended-upgrades 没有修复 heartbleed 错误?

, ,

问题描述

我已按照安装 unattended-upgrades 的说明在我的服务器(ubuntu 服务器 13.10)上安装自动安全更新。

https://help.ubuntu.com/community/AutomaticSecurityUpdates

你能帮我理解为什么今天早上我的服务器上仍然有心脏出血错误吗?

$ openssl version -a
OpenSSL 1.0.1e 11 Feb 2013
built on: Wed Jan  8 20:58:47 UTC 2014
platform: debian-amd64

其他信息:

$ cat /etc/apt/apt.conf.d/20auto-upgrades
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";

$ cat /var/log/apt/history.log
....
Start-Date: 2014-04-03  15:33:59
Commandline: apt-get install nginx
Install: libxau6:amd64 (1.0.8-1, automatic), libx11-data:amd64 (1.6.1-1ubuntu1, automatic), libxcb1:amd64 (1.9.1-3ubuntu1, automatic), libvpx1:amd64 (1.2.0-2, automatic), libgd3:amd64 (2.1.0-2, automatic), libxdmcp6:amd64 (1.1.1-1, automatic), libxslt1.1:amd64 (1.1.28-2, automatic), nginx-common:amd64 (1.4.1-3ubuntu1.3, automatic), nginx:amd64 (1.4.1-3ubuntu1.3), nginx-full:amd64 (1.4.1-3ubuntu1.3, automatic), libx11-6:amd64 (1.6.1-1ubuntu1, automatic), libxpm4:amd64 (3.5.10-1, automatic)
End-Date: 2014-04-03  15:34:02

Start-Date: 2014-04-04  10:26:38
Commandline: apt-get install unattended-upgrades
Install: unattended-upgrades:amd64 (0.79.3ubuntu8)
End-Date: 2014-04-04  10:26:40

谢谢

最佳回答

您的服务器上没有 Heartbleed 漏洞,OpenSSL 已修复此问题(无需升级)。

您在 OpenSSL 版本输出中遗漏了几行重要的行,这就是您知道它已被修补的方式,而不是版本号:

openssl version -a                                                                ✭
OpenSSL 1.0.1e 11 Feb 2013
built on: Mon Apr  7 20:33:19 UTC 2014
platform: debian-amd64
options:  bn(64,64) rc4(16x,int) des(idx,cisc,16,int) blowfish(idx) 
compiler: cc -fPIC -DOPENSSL_PIC -DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -m64 -DL_ENDIAN -DTERMIO -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -Wl,-Bsymbolic-functions -Wl,-z,relro -Wa,--noexecstack -Wall -DOPENSSL_NO_TLS1_2_CLIENT -DOPENSSL_MAX_TLS1_2_CIPHER_LENGTH=50 -DMD32_REG_T=int -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM
OPENSSLDIR: "/usr/lib/ssl"

‘build on’ 线在这里很重要,4 月 7 日或之后:你很好。否则:你有麻烦了。

更新,因为构建日期似乎并不好:

也许无人值守升级尚未运行,在我的服务器上,cron.daily 中的脚本配置为在 6:25 运行

25 6    * * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )

此外,检查 /etc/apt/apt.conf.d/10periodic 的内容并检查是否安装了安全更新:

APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Download-Upgradeable-Packages "1";
APT::Periodic::AutocleanInterval "7";
APT::Periodic::Unattended-Upgrade "1";

来源:https://help.ubuntu.com/lts/serverguide/automatic-updates.html

次佳回答

首先,您需要执行升级。 Unattended-upgrades 每天只运行一次,距离修复发布不到 1 天(2014-04-07 格林威治标准时间 20:00 左右)。有趣的是,请确保您已升级到 libssl1.0.0 版本 1.0.1e-3ubuntu1.2 或更高版本。 (准确地说,该修复出现在 1.0.1-4ubuntu5.12 版本中。)

接下来,请注意这是一个非常严重的漏洞:它可能允许攻击者通过连接到您的易受攻击的服务器来获取机密数据。如果您正在运行 SSL 服务器,那么在漏洞公布前不久,服务器内存中的任何数据都可能已泄露。这尤其包括服务器的 SSL 私钥,因此您应该生成一个新的并撤销旧的。

有关详细信息,请参阅 How to patch the Heartbleed bug (CVE-2014-0160) in OpenSSL?

第三种回答

您不能信任内部版本字符串。版本为 1.0.1e,该错误影响从 1.0.0 到 1.0.0f。这足以确定您是否还有易受攻击的 openssl 版本?不会。即使应用了一些更新,OpenSSL 内部版本也不会改变。可靠识别您的版本的唯一方法是使用 apt-cache policy 或其他工具查看包管理器版本:

➜  ~  apt-cache policy openssl
openssl:
  Installed: 1.0.1f-1
  Candidate: 1.0.1f-1
  Version table:
 *** 1.0.1f-1 0
        500 http://http.debian.net/debian/ testing/main i386 Packages
        100 /var/lib/dpkg/status
➜  ~  dpkg -l openssl
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
+++-==============-============-============-=================================
ii  openssl        1.0.1f-1     i386         Secure Sockets Layer toolkit - cr
➜  ~  

如您所见,我的 openssl 版本更好,似乎受到了影响,因为它是 1.0.1f,现在如果我检查更改日志:

➜  ~ apt-get changelog openssl
openssl (1.0.1f-1) unstable; urgency=high

  * New upstream version
    - Fix for TLS record tampering bug CVE-2013-4353
    - Drop the snapshot patch
  * update watch file to check for upstream signature and add upstream pgp key.
  * Drop conflicts against openssh since we now on a released version again.

 -- Kurt Roeckx <kurt@roeckx.be>  Mon, 06 Jan 2014 18:50:54 +0100

是的,我仍然受到影响。更新日志中没有提及 CVE-2014-0160。但是,我没有运行任何 SSL/TSL 服务,所以我可以等待。我只是不必使用此版本的 OpenSSL 生成 SSL 证书。如果我这样做了,我只需要遵循 Gilles 的建议:取消服务,撤销证书,生成新的。

参考资料

本文由Ubuntu问答整理, 博文地址: https://ubuntuqa.com/article/12764.html,未经允许,请勿转载。