Enhance your CentOS security for $1 a month with autoupdates

The automatic security updates are great – the most important security patches are delivered very soon after release. You can find tons of tutorials how to enable them on CentOS with Yum Cron – but almost all of them are wrong!

The problem is the CentOS repository doesn’t contain the metadata about security updates (updateinfo.xml) – it is available only for RHEL under their subscription (Scientific Linux has these metadata too). So you are able to install yum-cron, but it doesn’t work with other configuration than “default” (= update all packages with yum upgrade). Some repositories (e.g. EPEL) do contain the security metadata, so it seems that yum-cron is working, but it is only a false sense of security because there can be hundreds of invisible security updates available.

Fortunately there are few ways to enable them properly. They are usually based on the great CEFS (CentOS Errata for Spacewalk) by Steve Maier who parses CentOS-Announce Archives and generates the feed for SpaceWalk from them. You have several options how to use them:

  1. Use SpaceWalk (obviously) – but it is a very fat system management solution.
  2. Make your own copy of Centos Updates Repo (it has around  2GB) and add updateinfo with generate_updateinfo script by VMFarms.
  3. Use the centos-package-cron to notify + update manually or pipe the output to yum.
  4. Use the security scanner e.g. Vuls (I like it!).
  5. Use a ready made repo 🙂

The ways 1 – 4 are described in the following post. If you want to run your own repo (option 2), you need to do following steps:

  • download CEFS feed
  • generate updateinfo.xml
  • sync the current CentOS updates
  • create local CentOS repository
  • add updateinfo.xml into local repository
wget -q -N -P /repo/cefs http://cefs.steve-meier.de/errata.latest.xml
python generate_updateinfo.py -s all -t all /repo/cefs/errata.latest.xml -d /repo/
reposync -g -l -d -m --repoid=updates --newest-only --download-metadata --download_path=/repo/centos
createrepo /repo/centos
modifyrepo /repo/updateinfo-7/updateinfo.xml /repo/centos/updates/repodata/

However, the quickest and easiest way is no. 5 – to use Steve’s ready made repository. If you want to use his repo, you need to follow him on Patreon for symbolic $1 per month – you will get a great value for your money! Maybe you will be unpleasantly suprised how many important updates you have missed 🙂


Discover more from Vladimir Smitka

Subscribe to get the latest posts sent to your email.

Leave a comment

About Me

My name is Vladimir Smitka and I’m a security researcher/hobbyist from the Czech Republic. I’m also the owner of Lynt, a PPC Agency. I’m also an active member of the Czech WordPress community and one of the WordCamp Prague organizers.

OPEN .GIT GLOBAL SCAN

  • 230 000 000 sites scanned 🔍
  • 390 000 sites affected 😥
  • 100 000 mail send to the developers 📧
  • 150 000+ sites fixed 
  • 100+ possitive comments 🗨️
  • 3500+ thankyou mails ❤️
  • Thousands and thousands sites with another serious issue found 😑

For my research I use affordable Virtual Private Servers from Digital Ocean (they have a great infrascruture), Linode (they have a great understanding for my work) and dedicted servers from Hetzner.

If you like my research, you can make a small donation for coffee and VPS – two basic ingredients for my future security scans.

Follow me

Our Projects

Latest Articles