We have machines running RedHat-based distros such as CentOS or Scientific Linux. We want the systems to automatically notify us if there are any known vulnerabilities to the installed packages. FreeBSD does this with the ports-mgmt/portaudit port.
RedHat provides yum-plugin-security, which can check for vulnerabilities by their Bugzilla ID, CVE ID or advisory ID. In addition, Fedora recently started to support yum-plugin-security. I believe this was added in Fedora 16.
Scientific Linux 6 did not support yum-plugin-security as of late 2011. It does ship with /etc/cron.daily/yum-autoupdate
, which updates RPMs daily. I don't think this handles Security Updates only, however.
CentOS does not support yum-plugin-security
.
I monitor the CentOS and Scientific Linux mailinglists for updates, but this is tedious and I want something which can be automated.
For those of us who maintain CentOS and SL systems, are there any tools which can:
- Automatically (Progamatically, via cron) inform us if there are known vulnerabilities with my current RPMs.
- Optionally, automatically install the minimum upgrade required to address a security vulnerability, which would probably be
yum update-minimal --security
on the commandline?
I have considered using yum-plugin-changelog
to print out the changelog for each package, and then parse the output for certain strings. Are there any tools which do this already?
If you absolutely want to use
yum security plugin
, there is a way to do this, although a little elaborate. But once you have it setup, it's all automated.The only requirement is that you will need to have at-least one subscription to RHN. Which is a good investment IMO, but lets stick to the point.
yum security
.modifyrepo
command as shown here, to injectupdateinfo.xml
intorepomd.xml
. Before doing this, you will have to modify the perl script to change the Rpm MD5 sums inside the xml, from the RHN to Centos sums. And you will have to make sure if CentOS repos actually have all Rpms mentioned inupdateinfo.xml
, as they are behind RHN sometimes. But that's fine, you can ignore the updates CentOS hasn't caught up with, as there is little you can do about it, short of building them from SRPMs.With option 2, you can install
yum security
plugin on all clients, and it will work.Edit: This also works for Redhat RHEL 5 and 6 machines. And is simpler than using a heavy weight solution like Spacewalk or Pulp.
Scientific Linux can now list security updates from the commandline. Furthermore I can update a system to only apply security updates, which is better then the default ("Just update everything! Including bugfixes which you don't care about and which introduce regressions."
I have tested this on both Scientific Linux 6.1 and a 6.4. I'm not sure when this was officially announced, but I'll post more when I find out.
Here are some examples.
List a summary of security updates:
List by CVE:
And then I can apply the minimal set of changes required to
Or, just patch everything:
If I try this same command on a CentOS6 box, I don't get any results. I know for a fact that some of the '137 packages available' contain security fixes, because I received the errata notices yesterday via the CentOS mailinglists.
I had the same problem. I took a stab at creating some Python code to pull together Yum Updates and advisories from the steve-meier Errata site mentioned above (I filter it based on installed packages).
In case it helps, here is the source: https://github.com/wied03/centos-package-cron
Scientific Linux (at least 6.2 and 6.3; I don't have any 6.1 systems left) not only supports
yum-plugin-security
but the configuration file for foryum-autoupdate
,/etc/sysconfig/yum-autoupdate
, allows you enable only the installation of security updates.Since you have CFEngine, you could apply changes to groups of systems at time based on the security updates posted at: http://twitter.com/#!/CentOS_Announce
I'm not the biggest server security engineer out there... but I tend to find that I only care about a few packages when it comes to security. Anything that's public-facing (ssl, ssh, apache) or has a major exploit gets priority. Everything else gets evaluated quarterly. I don't want these things upgraded automatically because updated packages can potentially break other items on a production system.
You can also try generate_updateinfo project. It is a python script which processes
errata.latest.xml
file compiled by CEFS project and generatesupdateinfo.xml
file with security updates metadata. You can then inject it to your local CentOS 6 (7) update repository. It is pretty straightforward to integrate it with custom/local repositories created bycreaterepo
command:reposync
commandcreaterepo
commandupdateinfo.xml
file withgenerate_updateinfo.py
scriptmodifyrepo
commandOn CentOS you can use
instead of yum-plugin-security, or maybe you want to try this script scanning based on CentOS security news feeds: LVPS.
For Centos 6, Centos 7 and Centos 8 the easiest way is to use Steve Meier's Updateinfo: a yum repository with CentOS Errata information.
It's a ready yum repo served and updated by the author of the CEFS project.
It is a paid service but as of now it costs only a mere $3 per month for an unlimited number of servers (but using a mirror for a big fleet is recommended).
Note that it's the same thing as you can do yourself according to dsmsk80's answer. But don't you prefer to support the enthusiast who made this solution possible instead? :)
On CentOS6, you can use the yum-security plugin:
Check with:
This command returns code 0 if no security updates are available.
In combination with yum-cron, you can get an email only on available security updates by modifying file /etc/sysconfig/yum-cron: