Re: Exploring Gentoo Hardened

Luis Ressel <[email protected]>
Newsgroups gmane.linux.gentoo.hardened
Message-ID <[email protected]>
On Mon, 11 Aug 2014 14:17:12 -0700
Mark Knecht <[email protected]> wrote:

> Hi all,
>    Just an introduction. First post here but _longtime_ Gentoo user.
> (Early 2003 I think...) I ran Redhat before that starting in 1997.
> 
>    I'm a basic desktop end-user type. Self-employed, using KDE,
> vlc/makemkv/handbrake, and multiple Virtualbox Win 7 VMs for trading
> in the financial markets. I've converted my wife & 3 generations of my
> family (parents in the 80's and son in his 20's) to Gentoo. None of
> use native Windows anymore. I administer all the systems.

Sounds like an OSS "model family". Congrats! ;-)

>    I'm starting to look down the road to a new main machine for me in
> 6 months to 1 year. I'd like to start learning about the whole
> hardened environment - what it can and cannot do, at least easily. If
> I go this direction it's likely to try to be a fully encrypted disk
> subsystem, including initrd. I'm not overly performance driven, but
> that said I want to know where the cycles are going and don't want to
> waste them if possible.

Regarding system performance, my personal experience has been that the
various overheads involved in typical "hardened" Linuxes are
measurable, but not noticeable with most usage patterns. That said,
there's one kind of "performance" which certainly degrades:
Administration performance. You've got to have some time to debug all
these tiny little problems which arise due to badly written software
being incompatible with the system hardening etc.

I'd always recommend encrypting your HDD, even for otherwise
non-hardened systems. Performance losses aren't that bad, and the
advantages are huge. (For example, think about sending in a laptop for
a warranty repair. You don't want to wipe your hdd before, but you also
don't want the vendor to be able to read it.)

On the other hand, I've made some bad experiences with the
initramdisk's required for that. Neither dracut nor genkernel did work
satisfyingly, especially when SELinux entered the equation. I've been
told the situation has improved in the meantime, but I've already
switched to using a custom-written initramdisk. It's rock-solid, easily
understandable and only does those things I want it to do, but those
very well. (Of course, I'm willing to share the sources if someone is
interested.)

>    Anyway, thought I'd say hi and look for any pointers about what to
> read for a user such as myself. I'm going through the Gentoo Hardened
> pages and trying to understand what model to use - grsecurity or
> selinux. I'm leaning toward grsecurity but I don't have a good reason
> one way or the other as of yet.

There's much out there on the *net worth a look. Be sure to check out
the Gentoo wiki:
https://wiki.gentoo.org/index.php?title=Special%3APrefixIndex&prefix=Hardened&namespace=0
Oh, and also don't forget reading the help texts of the various
grsecurity kernel options. Most of them are well-documented.

Concerning "grsecurity vs SELinux", you're mixing up something here.
There's SELinux, an "mandatory access control" (MAC) system available
in the main-line kernels. And there's grsecurity/PaX, an extensive set
of kernel patches which is included in hardened-sources. It includes an
"RBAC" subsystem which is similar to SELinux in its purpose, but
grsecurity is much more than that. It has kernel patches for "Kernel
auditing" and "Chroot jail restrictions" to name only a few (as I
said, check out the help texts!) and it includes the PaX suite, which
dictates (among other things) that userland processes can't both write
to a memory region and execute code from there, thereby avoiding a whole
class of common exploits. All of those options are independent of your
using RBAC or SELinux (or no MAC system at all).

For starting out, I'd recommend using PaX and playing around with the
other grsecurity options, but leaving RBAC and SELinux alone, as they
add much more complexity and can be really overwhelming at the
beginning.

Later on, you can still add one of these MAC systems. (I personally do
recommend SELinux, but that's a matter of taste, and as I said, don't
worry about that now.)

>    I am interested in trying to do this in a VBox VM just as a
> learning exercise and which I understand it won't be as secure as
> doing it on bare metal I'd be very interested in hearing about others
> experience in this area.

I've never used Virtualbox, but I know hardened-sources kernels work
very well in KVM environments. That said, it's certainly a wise
decision to test substantive system changes beforehand in a virtualized
environment.


Regards,
Luis Ressel

PS: Wow, that mail I've just written somehow reminds me of Duncan.
signature.asc (application/pgp-signature, 949 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQJ8BAEBCgBmBQJT6VCCXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBMjU3MDBFQTc5QkYzMkY4NEQzMTFGNDlD
NzE4OTFBNkEwRUZCN0U5AAoJEMcYkaag77fphWMP/icFaHM0OTK+f1q05SgZIYy3
UevbYrI4XSp7M7ZW30GnRiZe77JiNCfbZTixs/BgmAzqXKWfiSx8B36je65nZq5D
6EUszw1pUnL5Naoo4aAZzHN7HA92VBUyAhNIfXFjodoic/tbBwaNLf2FGWDVgs8K
5JUcrEzkmZfOyklRy3x/m3iE5ut5ZUKbhCqOGbVJHUKYJv4bST/59D6kc/eGaaWr
YCAPVHF0F+vHkCWsFm92TwyBDYODHmX5ej/BbmL9oDfYPf/Y5o0rZsniGO6XqU9f
uoh7jy3GGih2NudIvraGKbknqVrmsxV6NSUwU45TAQps/pfRovca1nsX/BVItw4t
c3OK4rkq4OKeH9AZqUwdHq5bNW1isR3La8JHoLn5oYRmtJW3P4GYs8g6MmUmzMny
3WysTT2NhdRnkHmuL9Ntv72QxdUXoh2ubENW+4TVM1RpP3x5nIYsYLQxZWHMfk69
ycTz2pOJUXEFVU0AOMLop9jf7Q/tHSUn0AQC6WCrQ8kmn3pCPxVED06tLvHbvj8M
w3wnOZ/ifwhN9TshsYWggYVEeQ2UN9RfrjXOIBVCJbAFpplu/b/r5jqInPB3ysv4
v0UBCqdLDYCfR59e1IMaG94dvktOVUZadjUrBwV+xekcSNoMFmqPbrBSKCEwtZkj
/YvNXW/6h2nykPH94Y/n
=AWEH
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.