Weekly Edition Return to the Security pageSponsored link Serve your customers, not your servers, with VERIO Linux VPS. Full-access test-drive here. |
Security hardening for DebianMaking the programs in a distribution more resistant to exploits—a process known as hardening—is a fairly common way to reduce the attack surface for the distribution. Many distributions have made an effort in this area, with some adding in an overall security architecture, like AppArmor for SUSE or SELinux for Red Hat and Fedora distributions. Debian is currently looking at enabling some hardening features, potentially throughout a large swath of packages that it distributes. The features being considered and the concerns raised provide an interesting look at the tradeoffs. A posting to debian-devel-announce regarding hardening features for Lenny started the conversation. Those packages that are most susceptible—network services, packages that parse files from untrusted sources, or those that have been the subject of a security alert—should enable a set of security tools that will help deflect attacks against them. Various attacks rely upon certain characteristics of Linux binaries that allow them to be exploited. By altering the way the binaries are built, those particular threats can be mitigated. The experimental hardening-wrapper package makes enabling the various toolchain differences as easy as setting DEB_BUILD_HARDENING=1 in the environment. This will change gcc, g++, and ld to use the desired flags when building packages. Each hardening feature can also be disabled separately by setting DEB_BUILD_HARDENING_xyzzy=0 (where xyzzy is the name of a hardening feature) if they cause build or performance problems for a particular package. The specific features enabled are described in the original posting as well as with more detail on the Debian wiki entry for Hardening. They are:
Many other distributions have already been down this path: Gentoo has a page describing their hardened toolchain, Mark Cox of Red Hat has a detailed look at the evolution of security features in Red Hat and Fedora releases, OpenSUSE has a page about its security features, and so on. There is a price to be paid in binary size, execution speed, and cache behavior for these techniques, but for most environments, where resources are not massively constrained, the cost is worth it. It makes new attacks against those systems more difficult to design, which will make users and administrators sleep a little better at night. (Log in to post comments)
Security hardening for Debian Posted Feb 7, 2008 5:37 UTC (Thu) by jimparis (subscriber, #38647) [Link] For format string attacks, why isn't there a simple option to just disable "%n" processing entirely? So few applications actually need it. You'd still be vulnerable to information disclosure if you process an untrusted format string, but an actual exploit capable of running external code should be nigh impossible without %n.
Security hardening for Debian Posted Feb 7, 2008 12:45 UTC (Thu) by nix (subscriber, #2304) [Link] That's pretty much how -D_FORTIFY_SOURCE=2 differs from -D_FORTIFY_SOURCE. (Debian is using the former.)
Security hardening for Debian Posted Feb 7, 2008 21:19 UTC (Thu) by jengelh (subscriber, #33263) [Link] -D_FORTIFY_SOURCE, not -D_FORTIFY_SOURCE_. (It takes a value, so is -D_FORTIFY_SOURCE=2 actually, for example.) openSUSE uses FORTIFY_SOURCE for all packages for quite some time now, I am somehow always amazed how some popular distros lag behind simple features. I also remember finding a buffer "overflow" (now corrected) in btrfs 0.10 - but only with -D_FORTIFY_SOURCE=2 (it just did not fire without fortification, and you do not immediately think of running valgrind on everything you get to execute), so this macro is really useful.
Security hardening for Debian Posted Feb 7, 2008 21:52 UTC (Thu) by nix (subscriber, #2304) [Link] Likewise me, a bug in GNU locate (probably nonexploitable) which only triggers if compiled with -fstack-protector-all... (that has quite a hefty performance hit, like PIE, so I only enable it for Internet-facing services, and for everything in my firewall VMs.)
|
Copyright © 2008, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds
Powered by Rackspace Managed Hosting.