How to emerge the security updates only

4 August 2007

Security updates are good

In Gentoo Linux, there is, of course, a graphical frontend to do updates (called 'Porthole'), however the command line interface is called emerge.

The object of the command can be a package name ('ebuild' in Gen-speak) for example, gedit or epiphany, or it can be a 'set'. There are two sets, system and world.

The system set is the bare basics needed for the system to be able to run and to recompile itself. The world set is everything you have installed already.

I moan often that that this is a bit blunt, a bit un-Gentoo-ish, Gentoo is all about choice after all. Sometimes, when you have a system set up and optimised for a specific function, it may well be working and you want it to change as little as possible. If it is a networked device, you only want to do the updates necessary to keep the computer secure; you do not want new features and as few disruptive changes as possible.

The great thing about computers is that there is always a way to do something. However, the way is often just hard to figure out or you have not bumped into a person that knows the answer yet. So if you moan to everyone, someone will give up and tell you. Today I moaned on IRC and igli told me the answer.

gentoolkit is a "collection of administration scripts for Gentoo", out of interest, it has a sister package called gentoolkit-dev which is a "collection of developer scripts for Gentoo". Also interesting is that many (all?) of these tools are in Python.

One of the tools in gentoolkit is called glsa-check.

Enter the Dragon

Gentoo Linux Security Announcements (GLSAs) are short reports written by the Gentoo security team, they help us keep secure and are also a respected form of information in the wider mainstream security community. (For more about the GLSAs, read my recent interview with Matt Drew of the Gentoo Linux Security Team).

As well as being published online, the GLSAs are pushed out directly to users through portage updates. glsa-check is a fabulous little tool that aims to allow you to automate the monitoring of the GLSAs, and in turn, act on them automatically.

gsla-check quick guide

The tool has lots of options, but I will stick to the basics here.

Firstly, we can test the system against the security reports:

``$ glsa-check -t all

System Message: WARNING/2 (<string>, line 52); backlink

Inline literal start-string without end-string.

This system is affected by the following GLSAs:

200707-05

200707-13

``

System Message: WARNING/2 (<string>, line 60); backlink

Inline literal start-string without end-string.

So this server has two issues, the report from the 5th July and the one from the 13th July. Let's see what they are:

``$ glsa-check -l affected

System Message: WARNING/2 (<string>, line 65); backlink

Inline literal start-string without end-string.
200707-05 [N] Webmin, Usermin: Cross-site scripting vulnerabilities (
app-admin/webmin app-admin/usermin )

200707-13 [N] Fail2ban: Denial of Service ( net-analyzer/fail2ban )``

To read the full reports we can type: glsa-check -d affected

These reports are well structured and formally written. Therefore if you work in an environment with change management and you have to write a report for every change you make, these may be dead handy to cut and paste from.

Now we want to see how the system proposes to fix them:

`` ~ $ glsa-check -p affected

Checking GLSA 200707-05

The following updates will be performed for this GLSA:

app-admin/webmin-1.350 (1.320)


Checking GLSA 200707-13

The following updates will be performed for this GLSA:

net-analyzer/fail2ban-0.8.0-r1 (0.7.9)

``

System Message: WARNING/2 (<string>, line 96); backlink

Inline literal start-string without end-string.

Webmin will be upgraded from version 1.320 to 1.350, and fail2ban will upgrade from 0.7.9 to 0.8.0-r1.

We are happy with that, so let's run the fixes:

# glsa-check -f affected

The fix element of it is still labelled as experimental, but it worked well for me. Of course, this was a verbose way of doing this for the sake of the tutorial, in normal usage, one or two of the commands will do the trick.

As well as being helpful for dedicated machines, the glsa-check command can also help tide over a system until a set update time (e.g. once a quarter). I'll keep using it and I'll let you know how I get on with it.

What do you have to say?

Show Editing Help

Europython

About

Hello, my name is Zeth, I'll be your host here.

Command Line Warriors is about taking control of your own technology, it looks at our experiences of computing; especially using GNU/Linux, the Python programming language, the command-line and issues such as techno-ethics, best practices and whatever is cool now. If you take control of your technology then you are a Warrior too!

This site is your site too which means that you can contribute and get involved. You can leave comments using the facility provided. For me, the comments and discussions are by far the best part of the site. So please do have your say!

Latest Discussions

picsus

January 5, 2009
Monique, a Leaf fan, originate this plumb persistent to believe. Now, let me regarding out that this was in no way an try to articulate one cooperate is more wisely ...
This week in the world of the Command Line; The Friday Round up!

QuickSilver

January 5, 2009
Nice! Is there anyway to implement a ServerAliveInterval for long processes? This is because my our firewall keeps closing the connection based on inactive connections. Thanks,
SFTP in Python: Really Simple SSH

Tun

January 5, 2009
Hi, Do You know, haw can i get start date for tasks evolution? If exists the similar way to your example: i.get_due() ? I would like to have sth like ...
Three Useful Python Bindings - ClamAV, Apt and Evolution

MurreiM

January 5, 2009
This is great! http://www.youtube.com/MurreiM Buy Alli Orlistat online cheap
Filing cabinets 101 - An introduction to disk partitions

sarah

January 5, 2009
I recently came across your blog and have been reading along. I thought I would leave my first comment. I don't know what to say except that I have enjoyed ...
This Week: Freedom not Time-Bombs

jnfrlast

January 4, 2009
Hi! http://www.youtube.com/jnfrlast buy cheap viagra online
Filing cabinets 101 - An introduction to disk partitions

Samuel Huckins

January 4, 2009
Great tips! I have had occasion to do a lot of MySQL instance migrations lately, so here is an improvement for Trick 1: mysqldump <DATABASE_NAME> [mysqldump_options] | gzip -c | ...
Five useful command one liners

George Glass

December 31, 2008
I don't really see the point in trying to make linux user-friendly or take over the desktop. We rule the servers the most important element of the entire game. Let ...
Give Linux a chance

bug

December 31, 2008
@Zeth: The hidden field does block some. Not perfect, but it does release some weight from the filtering system, as those are 100% false comments. Acctually, if you would have ...
On Comment Spam

Zeth

December 31, 2008
Hi Eion, Yes that is an interesting approach also. It is the only approach given by default in the stock Django comments module, though it does not stop all comment ...
On Comment Spam

Bug

December 30, 2008
Well... Sadly, and I guess you hate me for it, I use captcha. But at least it's not an image, so even if you visit using w3m [yey!] you can ...
On Comment Spam

Eion

December 30, 2008
Other than server-side processing of comments, I like to add additional <input>'s and hide them in external css. Most of the time the fields are populated by spam-bots, and if ...
On Comment Spam

Nostoc

December 27, 2008
... Mate possible because of the dull Kg8
Ruy Lopez, Berlin defence, open variation

Nostoc

December 27, 2008
My bad, I meant the picture beneath 15, after close inspection my suggestion would be on 18. Instead of 18 : Qe2, I would have taken that knight with my ...
Ruy Lopez, Berlin defence, open variation

Zeth

December 27, 2008
Nostoc, white takes the rook on 15, the rook is a better kill than a knight.
Ruy Lopez, Berlin defence, open variation

Nostoc

December 26, 2008
I'm not that good at chess, but I have a question. At 15, why doesn't white simply take black's knight in C6 with the bishop? It's an easy kill, since ...
Ruy Lopez, Berlin defence, open variation

Zeth

December 26, 2008
CorkyAgain, good question, I don't have a FreeBSD box available at the moment so I can't comment. On Linux at least watch does as I have described.
Five useful command one liners

CorkyAgain

December 25, 2008
Is the watch command you're describing a Linuxism? On my FreeBSD box, "man watch" seems to be describing something completely different.
Five useful command one liners

Binny V A

December 25, 2008
I have actually setup a site to store just short commands... http://txt.binnyva.com/
Five useful command one liners

Bassam essa

December 25, 2008
i try this line command elinks -source "http://www.e51g.com/" > resulthtml.txt its work done :) thx
Command the Web - an ELinks tutorial