By Kurt Seifried
I have noticed a worrying trend lately, and by lately I mean over the last five years. The state of Linux security doesn't seem to be getting much better. That's not to say we haven't made some major technological advancements: SELinux is now commonplace, and many vendors are now shipping with services disabled by default and firewalls enabled by default. But overall, I find the number of bugs and types of bugs haven't really changed much, or it's getting worse.
In 2007, Red Hat issued security advisories with a total of 371 CVE Identifiers, each of which represents at least one unique security issue, and sometimes more than one. Mandriva isn't far behind with 350. But with Debian at 444 and Gentoo at 539, you have to start wondering.
The first thing to remember is that the majority of software shipped by Linux vendors was not written by them. The majority of userspace tools on a Linux system are repackaged and perhaps tweaked by the vendor, but other than back-porting security fixes, most vendors do very little to the software. This leads to a number of problems, such as weak file permissions. A perfect example of this issue is CVE-2002-0849. Back in 2002, I found that the main iSCSI software for Linux, which was produced by Cisco, included the CHAP (Challenge Handshake Authentication Protocol) password in a world-readable file: /etc/iscsi.conf. With this password, an attacker would be able to access data on the iSCSI as the server, largely bypassing any file permissions or other security mechanisms.
So I duly reported it and Cisco fixed it and everyone moved on.
Now it's 2008, and if you look at a list of security vulnerabilities, you'll find CVE-2007-5827: "iSCSI Enterprise Target (iscsitarget) 0.4.15 uses weak permissions for /etc/ietd.conf, which allows local users to obtain passwords."
Does anyone ever learn?
If you take a quick look in your /etc directory and check for files that contain passwords, you'll find quite a few in a short amount of time (see Table 1). These were all found by simply running
grep -i password /etc/* grep -i password /etc/*/*
as a normal user. See Figure 1.
Finding this class of issue - and fixing it - should be trivial for most vendors. The functionality of the system is unlikely to be affected because most network services are started as root, read their configuration files, and then drop privileges.
Generally, all you need to do is remove the world read permission from these files and the problem is solved. A simple one-line addition to the %post install script in an RPM - for example, to run chown o-r [file name] - would be sufficient.
But vendors haven't done this and largely ignore the problem or outright refuse to fix it. So what does this have to do with the Karate Kid [1]?
Much like the Karate Kid, your average system administrator has to learn karate (system security) or else the bad guys are going to jump you in an alley and use your head and kidneys as a PiƱata (get root on your system and own it). Many administrators have unwittingly made enemies; activists, competing companies, criminals and others would happily take over your server for any number of reasons, including storage of stolen information, dump sites, customer data, etc.
Unlike the Karate Kid, most of us don't have a Mr. Miyagi to defeat the evil Cobra Kai students, not only saving us from a beating but also teaching us how to fight just like the Cobra Kai students: The bad guys fight dirty. Really dirty.
What can we learn from the Karate Kid?
If you want a secure system, you are going to have to work for it - few vendors are going to give you one out of the box.
Also, you'll probably have to work to find the time and energy to spend on training and building better systems and networks. Although this isn't always easy to do, anything else will simply maintain the status quo and prolong the pain.
INFO |
[1] The Karate Kid: http://en.wikipedia.org/wiki/The_Karate_Kid
|
THE AUTHOR |
Kurt Seifried is an Information Security Consultant specializing in Linux and networks since 1996. He is married and has four cats but no fish (because the cats are more hungry than afraid of water). He often wonders how it is that technology works on a large scale but often fails on a small scale. |