Sharpening the Ax Before Chopping Down a Tree
I was helping to examine a server that was impacted by Heartbleed. According to the developer who was patching the server, he had updated the OpenSSL library to the following:
|
|
And the developer claimed: “According to http://heartbleed.com/. OpenSSL 1.0.1g is NOT vulnerable. Also I have restarted all services on this server.”
So, OpenSSL has been updated and the all services have been restarted, but why does the problem still persist?
I took a look at the command history he ran:
|
|
The OpenSSL library has been built from the source, which is fine, but the problem is that the Nginx server was still using the old library distributed by Ubuntu:
|
|
In effect, there were two versions of OpenSSL library installed in the system, one was built from the source, and another one was managed by dpkg
:
|
|
However, the bigger problem is the version of the operating system:
|
|
Ubuntu 13.04 is not supported anymore according to https://wiki.ubuntu.com/Releases. The developer probably issued apt-get upgrade
, but nothing to be updated, because Ubuntu stopped supporting the release. Therefore, no security update. And Ubuntu 13.04 is not listed in Ubuntu Security Notice USN-2165-1. So, the developer opted for building the library from the source. After installation from the source, the binary openssl
was overridden by the source build, and the command openssl version
showed the latest and patched version 1.0.1g
.
To fix the problem, we need to reinstall the package first:
$ sudo apt-get install --reinstall openssl
Now, this will revert control back to apt-get
and overwrite the binary /usr/bin/openssl
:
|
|
And then we must perform the distribution upgrade to the latest long term support version, in order to continue receiving updates.
The lesson I have learned from this is that if you are going the wrong direction, no matter how hard you work, you are not going to make it. Make sure to take the initial investment, and really understand the true cause of the problem before attempting to resolve the issue. And don’t blindly follow the procedure. Understand it first, and adapt to your specific situation. As Abraham Lincoln once said:
“If I have nine hours to chop down a tree, I’d spend the first six sharpening my ax.”