Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Gentoo: Hardened

"How hard" is Linux kernel-side hardening?

 

 

Gentoo hardened RSS feed   Index | Next | Previous | View Threaded


veeenrg at gmail

Sep 19, 2009, 9:13 AM

Post #1 of 18 (1926 views)
Permalink
"How hard" is Linux kernel-side hardening?

Hi folks,


---Who I am:---

I'm a recent-Linux-user and I love it.

I dedicate, a part, of my spare time
to study Unix-like O.S.es for increasing
my comprehension of the IT world.


---Who I am not:---

I call myself Linux-user 'cause I'm:
-1- neither an I.T. professional,
-2- nor a seasoned "*Nix-like geek" (in the best sense of the term)


---Disclaimer:---

Since I'm not a security professional,
please forgive me if , sometime, I
express myself in a rough way.

Since I'm not mother tongue English,
please be patient when my language
is poor.


---Question:---

It's a fact OpenBSD is a secure OS so,
if we put a OBSD-box online, we have
good chance it won't compromised, so
my question is the following:

"Is it possible to obtain, approximately,
a Linux-box secure as an OBSD-box?"

I know the intensive audit of OBSD and so on,
in fact I've written "approximately" and not "exactely".

My intention is, surely, not to provocate,
but to understand the actual state-of-art
of Linux security.

SELinux is included in the vanilla,
this sounds good, but mastering
SELinux is a long run
(a lot of time to invest in it)
Another issue is that if you are running a
non-Red-Hat-derivative you won't find
any good tool for managing your own rules.
There are also pre-built policies, disciplining
most common services, but as every all-purpose
stuff it fits not very good our needs!
Writing policies with GNU/Emacs takes
too much time...this is an objective fact;
the subjective analisys is that it requires
much more time than I can spend,
considering my spare time.

AppArmor, recently included in the Ubuntu-family,
seems to be something like SELinux, but more
user-friendly. I mean both (SELinux and AppArmor)
have the intention to limitate damages coming from
a compromised service. If I'm wrong feel free to
clear my error.

Since I like increased restriction to /proc /tmp and so on,
and I appreciate randomisation goodies, this leads me to
look at RSBAC and GR-Security, in fact both have these features.

RSBAC seems to be hard on first approach,
but much more flexible than GR-Security;
on the other hand GR-Security has a good
appeal if we're looking for an easy and fast way
to lock down a desktop or a laptop, since it
is "user-friendly ;-)" to install and set up
and grants a good level of security.
If I've understood correctly GR-Security could
be the best choice for desktop and RSBAC the
best choice for server...isn't it?

What about overhead...I mean I see GRsec.
has good performances, but I heard RSBAC
is not so-light...have you experienced this
slowlyness or it was, only present, in early
releases?

Back to subject of my post:
"How hard" is Linux...hardening?

In the end, after long time tuning
do, these tools, grant us an high level security?
I mean:
Grsecurity had suffered of a return into libc exploit
that bypassed its protection. Grsecurity had also
a PaX-disabled bug in the past that expose
machines to risks.

I heard RSBAC had problem with the jail solidity etc.

Recently I've read something about a 2.6.30 bug
which makes useless, enforcement like SELinux,
AppArmor and so on...

so I'm wondering if it is possible to harden Linux
the way you can leave it online with, approximately,
the same (high) probability, it won't be compromised
as OpenBSD does.

I repeat this post is not intended to be a provocation
or something similar, but it is intended to be didactic
in the sense I've surfed the web, but there's no clear
response to this question and I'm confused about it.

I'm sure there are many skilled people, reading
this mailing list, so I'll appreciate if someone
will be patient and will enlighten me, giving some
impartial inputs on what to study in my spare time.

Thank you in advance,

Good week-end ;-)


atoth at atoth

Sep 19, 2009, 10:30 AM

Post #2 of 18 (1879 views)
Permalink
Re: "How hard" is Linux kernel-side hardening? [In reply to]

On Szo, Szeptember 19, 2009 18:13, Marco Venutti wrote:
> SELinux is included in the vanilla,
> this sounds good, but mastering
> SELinux is a long run
> (a lot of time to invest in it)
...
> AppArmor, recently included in the Ubuntu-family,
> seems to be something like SELinux, but more
> user-friendly. I mean both (SELinux and AppArmor)
> have the intention to limitate damages coming from
> a compromised service. If I'm wrong feel free to
> clear my error.

Some security solutions you've mentioned above use LSM included in
vanilla. However not all security solutions keen on LSM:
http://www.grsecurity.net/lsm.php
http://www.rsbac.org/documentation/why_rsbac_does_not_use_lsm

> RSBAC seems to be hard on first approach,
> but much more flexible than GR-Security;
> on the other hand GR-Security has a good
> appeal if we're looking for an easy and fast way
> to lock down a desktop or a laptop, since it
> is "user-friendly ;-)" to install and set up
> and grants a good level of security.

User-friendlyness depends on the level of security you want to implement.
I use a rather lazy grsecurity policy, but I still have to update it
approximately every two weeks - as new applications come by.

> If I've understood correctly GR-Security could
> be the best choice for desktop and RSBAC the
> best choice for server...isn't it?

I'm not deeply into RSBAC's magic, but I think the best choice is the tool
you are more experienced in.

> What about overhead...I mean I see GRsec.
> has good performances, but I heard RSBAC
> is not so-light...have you experienced this
> slowlyness or it was, only present, in early
> releases?

Running my machine PaX enabled while grsecurity policies are active have a
definite impact on my machine's performance. I guess it depends on the
architecture (if you have NX-bit) and may be on how bulky your policy is.
Mine is over 100k. Sometimes X don't like PaX & low-latency preemption
combo (X pointer freezes). If I switch off preemption, it also slows it
down a bit.

You forgot to mention SSP (stack-smashing protection). It's an application
level protection, must be compiled in. It also has a performance impact.
I prepare my presentations on my laptop, which runs an SSP-enabled
OpenOffice. However I prefer to use a non-hardened machine for the actual
performance. Flipping form one slide to another is considerably slower on
my hardened machine, but I don't want to force my audience to sleep. For
personal use I would never use an ordinary office suite. But I don't care
about the machine the organizers make me available because I transfer my
document only in one direction.

> Back to subject of my post:
> "How hard" is Linux...hardening?

It's not that easy and perhaps it depends on one's personal skills.
However I think it's addictive.
My motto is: "If you go Hardened, you cant stop it."

> In the end, after long time tuning
> do, these tools, grant us an high level security?

You'll never find perfect security.

> I mean:
> Grsecurity had suffered of a return into libc exploit
> that bypassed its protection. Grsecurity had also
> a PaX-disabled bug in the past that expose
> machines to risks.

Every software - even OBSD - has bugs.

> Recently I've read something about a 2.6.30 bug
> which makes useless, enforcement like SELinux,
> AppArmor and so on...

Watch out for 2.6.31 perf_counter 0day:
http://www.youtube.com/watch?v=ShoAOdx0K7I

> so I'm wondering if it is possible to harden Linux
> the way you can leave it online with, approximately,
> the same (high) probability, it won't be compromised
> as OpenBSD does.

Let me ask you just one thing. Please point me to an OBSD alternative of
the wide variety of Linux hardening solutions (SELinux, RSBAC, AppArmor or
grsecurity). Like TrustedBSD has FLASK/SEBSD implemented, analogous to
SELinux. Solaris has trusted extensions.

> I'm sure there are many skilled people, reading
> this mailing list, so I'll appreciate if someone
> will be patient and will enlighten me, giving some
> impartial inputs on what to study in my spare time.

I'm not a security expert.

Every system must be maintained to keep it up-to-date. If you think that
you don't have to spare time on it: that is a false sense of security.
Sacrifices must be made according to the level of security you are
targeting.

Hardened Gentoo offers several possibilities to choose between. It's fun!

Regards:
Dw.
--
dr Tóth Attila, Radiológus, 06-20-825-8057, 06-30-5962-962
Attila Toth MD, Radiologist, +36-20-825-8057, +36-30-5962-962


veeenrg at gmail

Sep 19, 2009, 1:25 PM

Post #3 of 18 (1872 views)
Permalink
Re: "How hard" is Linux kernel-side hardening? [In reply to]

--[cut]--
User-friendlyness depends on the level of security you want to implement.
I use a rather lazy grsecurity policy, but I still have to update it
approximately every two weeks - as new applications come by.
--[cut]--

I don't expect miracles, on the other hand I can dedicate,
approximately, 4 hours a week, in tuning and updating,
I know it's not so much, but I have to face this boundary.

--[cut]--
> If I've understood correctly GR-Security could
> be the best choice for desktop and RSBAC the
> best choice for server...isn't it?
--[cut]--

I understand what you mean, but everything can be learned,
so if something, I'm not using now, has a less-long history-list
of exploitable bugs, I'll be happy to move to that solution!
At the moment I'm using Grsecurity, I believe (and hope)
it is decently affordable, in the sense of the shortest possible
history-list of serious breaches/holes, but I've not done a really
in-depth-analisys, just some googling on these topics.
My first grsec configuration, was set up on a "Gentoo Workstation"
profile then tuned for best fits my laptop needs.

--[cut]--
You forgot to mention SSP (stack-smashing protection).
--[cut]--

I didn't forget it, but I'd like to primarily focus on
RSBAC and GR-Sec. and I didn't want to be wordy,
more than I naturally am, so I had to make a selection
and I've excluded it, nothing personal, just the need
to be synthetic...in some way...
I know this exclusion is questionable...
I'm sorry if this hurt you, because you like SSP ;-)
I've mentioned SELinux, 'cause it is a well-known
it is inside the vanilla, so, in some way it is a must
including SELinux in a topic like this!
On AppArmor I've spent few words just because
it comes with Ubuntu that is one of the most spred
Linux distro.

--[cut]--
You'll never find perfect security.
--[cut]--

I totally agree with this statement! sadly :-(


--[cut]--
Every software - even OBSD - has bugs.
--[cut]--

I'd like to clear I'm not OBSD super-fan,
it is only a term of comparison,
just an example, not propaganda
(that i personally dislike).

--[cut]--
Let me ask you just one thing. Please point me to an OBSD alternative ofthe
wide variety of Linux hardening solutions (SELinux, RSBAC, AppArmor or
grsecurity).
--[cut]--

OpenBSD had neighter the hardware support,
nor the opportunity of choice that only Linux
can offer to us, that's why I love Linux and
that's why I'm looking for hardening Linux
rather using OBSD, because I prefer Linux!!

I agree Linux has a lot of hardening solutions
and different approches, I love it!

In perfect world I would have time to perfectly
master every patch and then, consciously,
could choose the one best suits my needs...

coming back to real world, I've few hours a
week and I have to find out what to study...
I'd like to focus on 1 approch, hoping this will
lead me, in the future, to get a decent level
of knowledge.

Obviously I'm aware, with few hours I'll never
be up-to-date and seriously skilled, but I think
some hours are better than zero hours and I
hope I'll be, a bit more, cultered about security.


--[cut]--
Sacrifices must be made according to the level of security you are
targeting.
--[cut]--

I have to start, not from the level of security I'd like to get,
rather from the time I can dedicate...

I mean: these are X hours I can dedicate,
inside this perentory limit I can be free...
it's sad, but it's so...anyway I've faith!

Good evening ;-)


pebenito at gentoo

Sep 19, 2009, 10:40 PM

Post #4 of 18 (1873 views)
Permalink
Re: "How hard" is Linux kernel-side hardening? [In reply to]

On Sat, 2009-09-19 at 19:30 +0200, atoth [at] atoth wrote:
> On Szo, Szeptember 19, 2009 18:13, Marco Venutti wrote:

> > If I've understood correctly GR-Security could
> > be the best choice for desktop and RSBAC the
> > best choice for server...isn't it?
>
> I'm not deeply into RSBAC's magic, but I think the best choice is the tool
> you are more experienced in.

Its pointless to say one solution is better than another in general
terms. The first thing you have to know is your security goals. If you
don't know your security goals, you can't determine if you are
succeeding by using a particular security system.

--
Chris PeBenito
<pebenito [at] gentoo>
Developer,
Hardened Gentoo Linux

Public Key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xE6AF9243
Key fingerprint = B0E6 877A 883F A57A 8E6A CB00 BC8E E42D E6AF 9243


tazok.id0 at gmail

Sep 20, 2009, 4:24 AM

Post #5 of 18 (1868 views)
Permalink
Re: "How hard" is Linux kernel-side hardening? [In reply to]

2009/9/19, Marco Venutti <veeenrg [at] gmail>:

>
> ---Question:---
>
> It's a fact OpenBSD is a secure OS so,
> if we put a OBSD-box online, we have
> good chance it won't compromised, so
> my question is the following:

It's a fact that OpenBSD is a C2 capable security system (orange
book), that is, is not a trusted OS because it lacks of MAC solutions


> "Is it possible to obtain, approximately,
> a Linux-box secure as an OBSD-box?"
>
> I know the intensive audit of OBSD and so on,
> in fact I've written "approximately" and not "exactely".
>
It's possible to obtain a B1 (orange book) system under gnu/linux, so
a trusted OS.

> SELinux is included in the vanilla,
> this sounds good, but mastering
> SELinux is a long run
> (a lot of time to invest in it)
I think (maybe I'm wrong) Brad Spender published a bug that disabled
SELinux because the LSM weakness

> Another issue is that if you are running a
> non-Red-Hat-derivative you won't find
> any good tool for managing your own rules.
> There are also pre-built policies, disciplining
> most common services, but as every all-purpose
> stuff it fits not very good our needs!
> Writing policies with GNU/Emacs takes
> too much time...this is an objective fact;
> the subjective analisys is that it requires
> much more time than I can spend,
> considering my spare time.
>

Well, this is the true problem, making policies is one "do it
yourself" question, to many things to control and the problem is that
not everybody knows what to control.

> AppArmor, recently included in the Ubuntu-family,
> seems to be something like SELinux, but more
> user-friendly. I mean both (SELinux and AppArmor)
> have the intention to limitate damages coming from
> a compromised service. If I'm wrong feel free to
> clear my error.
>
Both works under LSM:
http://lists.immunitysec.com/pipermail/dailydave/2009-July/005810.html
http://grsecurity.net/~spender/cheddar_bay.tgz

> Since I like increased restriction to /proc /tmp and so on,
> and I appreciate randomisation goodies, this leads me to
> look at RSBAC and GR-Security, in fact both have these features.
>
> RSBAC seems to be hard on first approach,
> but much more flexible than GR-Security;
> on the other hand GR-Security has a good
> appeal if we're looking for an easy and fast way
> to lock down a desktop or a laptop, since it
> is "user-friendly ;-)" to install and set up
> and grants a good level of security.
> If I've understood correctly GR-Security could
> be the best choice for desktop and RSBAC the
> best choice for server...isn't it?
>
I agree with these


> What about overhead...I mean I see GRsec.
> has good performances, but I heard RSBAC
> is not so-light...have you experienced this
> slowlyness or it was, only present, in early
> releases?
>
Overhead depends of what do you control. RSBAC is light too for me,
the problem is that if you want log all READ_OPEN calls ( for example
to log all open(O_RDONLY)) calls) the overhead would be high.

> Back to subject of my post:
> "How hard" is Linux...hardening?
>
> In the end, after long time tuning
> do, these tools, grant us an high level security?
> I mean:
> Grsecurity had suffered of a return into libc exploit
> that bypassed its protection. Grsecurity had also
> a PaX-disabled bug in the past that expose
> machines to risks.
I think the main problem (I could be wrong) is that pax flags are
marked in binaries (in userspace) in grsecurity.

>
> I heard RSBAC had problem with the jail solidity etc.
>
> Recently I've read something about a 2.6.30 bug
> which makes useless, enforcement like SELinux,
> AppArmor and so on...
>
> so I'm wondering if it is possible to harden Linux
> the way you can leave it online with, approximately,
> the same (high) probability, it won't be compromised
> as OpenBSD does.

The jail bug were corrected long ago, and was limited to this module
only (in rsbac petitions pass to all modules that are stacked, not
only this one, and if only one module deny the request, is denied
forever though jail don't work properly).


veeenrg at gmail

Sep 20, 2009, 7:16 AM

Post #6 of 18 (1868 views)
Permalink
Re: "How hard" is Linux kernel-side hardening? [In reply to]

Hi,

--[cut]--
The jail bug were corrected long ago, and was limited to this module
only (in rsbac petitions pass to all modules that are stacked, not
only this one, and if only one module deny the request, is denied
forever though jail don't work properly).
--[cut]--

Since I'm a recent Linux user and I'm not a security cultured,
I've chosen GR-Security, as starting point,
because of its user-friendliness, in fact you can enforce,
the bare kernel, also if you are not deeply experienced
in Linux security...
this is my case, so I appreciate this opportunity!

I've started from the "Gentoo Hardened Workstation"
profile and, then, I've done some gradm experiments...
these facts in the near past.

I consider myself illiterate, in matter of security,
but I'd like to load, a little-little-bit, my lacunas,
just for the intellectual pleasure, I feel in satisfy
my curiousity.

I'm not a professional, thus I don't have
servers to manage, just a couple of workstations,
so my needs are, probably, easier to fit...
no special high security enforcements are required;
this should also be good because gives me
the chance to start little, 'cause, in effect I've
little needs!

Today is Sunday and I can read some docs,
I'm interested in RSBAC and I'm starting to read
RSBAC handbook, but at the moment I'm
using, yet, GR-Security beacuse of the previous
concept.

I'll be glad if there's anybody willing
to indicate me any non-official-but-good how-to
and/or any sort of tip useful to get done
to "lock-down" my workstation about RSBAC,
but I'll appreciate GR-Sec.'s.
This section is intended to be a request of
a little help and does not mean:
"Is there anybody does my task, plese?"
I've specified the sense of the statement,
just to clear every possible ambiguity.


I wish you a good sunday afternoon ;-)


tazok.id0 at gmail

Sep 20, 2009, 8:14 AM

Post #7 of 18 (1869 views)
Permalink
Re: "How hard" is Linux kernel-side hardening? [In reply to]

There is not a complete reference if not a lot of tips to close little
doors instead, for example, you can implement a trusted path execution
and forbid execution to nothing more that the common binaries and
libraries (/bin /sbin /usr/bin /lib etc) to avoid exploits, you could
restrict the interpretation of scripts (in the way of "perl
myuntrusted_script.pl", forbidding people to use perl to avoid the
TPE). You could restrict the missuse of TIOCSTI call to avoid fake
instructions insertion in "an privilege user tty" by a compromised
root (I don't know if this could be done in grsecurity).

Another question that I think grsec lacks is the control of which
SETUID binary could change to which uid (for example, permit only
login to change to the uid 1000 and not 80), or forbid setuid if the
user does not authenticate itself against the kernel (with a password
in for example sshd, so remote exploits which affect priviledge parts
of sshd only could change to uid 22 and not to root or those which
affect login could be controlated)

However there is a lot of questions to control a few documentation to it.


2009/9/20, Marco Venutti <veeenrg [at] gmail>:
> Hi,
>
> --[cut]--
> The jail bug were corrected long ago, and was limited to this module
> only (in rsbac petitions pass to all modules that are stacked, not
> only this one, and if only one module deny the request, is denied
> forever though jail don't work properly).
> --[cut]--
>
> Since I'm a recent Linux user and I'm not a security cultured,
> I've chosen GR-Security, as starting point,
> because of its user-friendliness, in fact you can enforce,
> the bare kernel, also if you are not deeply experienced
> in Linux security...
> this is my case, so I appreciate this opportunity!
>
> I've started from the "Gentoo Hardened Workstation"
> profile and, then, I've done some gradm experiments...
> these facts in the near past.
>
> I consider myself illiterate, in matter of security,
> but I'd like to load, a little-little-bit, my lacunas,
> just for the intellectual pleasure, I feel in satisfy
> my curiousity.
>
> I'm not a professional, thus I don't have
> servers to manage, just a couple of workstations,
> so my needs are, probably, easier to fit...
> no special high security enforcements are required;
> this should also be good because gives me
> the chance to start little, 'cause, in effect I've
> little needs!
>
> Today is Sunday and I can read some docs,
> I'm interested in RSBAC and I'm starting to read
> RSBAC handbook, but at the moment I'm
> using, yet, GR-Security beacuse of the previous
> concept.
>
> I'll be glad if there's anybody willing
> to indicate me any non-official-but-good how-to
> and/or any sort of tip useful to get done
> to "lock-down" my workstation about RSBAC,
> but I'll appreciate GR-Sec.'s.
> This section is intended to be a request of
> a little help and does not mean:
> "Is there anybody does my task, plese?"
> I've specified the sense of the statement,
> just to clear every possible ambiguity.
>
>
> I wish you a good sunday afternoon ;-)
>


tazok.id0 at gmail

Sep 20, 2009, 1:09 PM

Post #8 of 18 (1867 views)
Permalink
Re: "How hard" is Linux kernel-side hardening? [In reply to]

>2009/9/20, Javier J. Martínez Cabezón <tazok.id0 [at] gmail>:
> Another question that I think grsec lacks is the control of which
> SETUID binary could change to which uid (for example, permit only
> login to change to the uid 1000 and not 80), or forbid setuid if the
> user does not authenticate itself against the kernel (with a password
> in for example sshd, so remote exploits which affect priviledge parts
> of sshd only could change to uid 22 and not to root or those which
> affect login could be controlated)

I was wrong here as you can see here:
http://en.wikibooks.org/wiki/Grsecurity/Appendix/Subject_Attributes
Sorry by the mistake.


p.labushev at gmail

Sep 20, 2009, 9:35 PM

Post #9 of 18 (1868 views)
Permalink
Re: "How hard" is Linux kernel-side hardening? [In reply to]

Marco Venutti пишет:

> It's a fact OpenBSD is a secure OS so,

No OS is secure, unfortunately.

> if we put a OBSD-box online, we have
> good chance it won't compromised, so
> my question is the following:

If the OpenBSD box would host something insecure (like WordPress), then
expect it will be compromised.

> "Is it possible to obtain, approximately,
> a Linux-box secure as an OBSD-box?"

In some cases you could obtain even more security. Approximately. ;)

> My intention is, surely, not to provocate,
> but to understand the actual state-of-art
> of Linux security.

The Linux Kernel project is, in fact, following the Non-Disclosure
policy these days. Quality of the code is poor: the more bugs, the more
vulnerabilities. And it seems like most of the mainline kernel
developers don't care much about security.

> SELinux is included in the vanilla,
> this sounds good, but mastering
> SELinux is a long run
> (a lot of time to invest in it)

Salesmen can sound good - it's a part of their job.

> Since I like increased restriction to /proc /tmp and so on,
> and I appreciate randomisation goodies, this leads me to
> look at RSBAC and GR-Security, in fact both have these features.

Remember that RSBAC does not work with PaX on a recent kernels. If you
really want more security with Linux, PaX is the first and the most
important thing you should consider. It aims to prevent exploits from
working, while MAC/RBAC/RSBAC fights the consequences in userspace and
does little to protect against the kernel exploits.

Another more vulnerability in the kernel disclosed every month - this is
_the_ problem. In the light of that, HIDS and HIPS are secondary.

> If I've understood correctly GR-Security could
> be the best choice for desktop and RSBAC the
> best choice for server...isn't it?

A server without PaX is barely a better choice.

> In the end, after long time tuning
> do, these tools, grant us an high level security?

These tools are only a part of the solution. But they can help very
much, of cource.

You should choose what you use and pay attention to not so obvious
supposed attack vectors and try to understand and accept the risks -
sometimes you can't do more about that.

For example, D-Bus and alike IPC-on-top-of-IPC channels are common for
desktops. So if your policy allows access to D-Bus sockets for some
dbus-enabled application, expect any such application, being
compromised, would use D-Bus to attack another such applications,
including the privileged HAL daemon, your email client, your file
manager and so on. And there's no reliable way to "tune" this kind of
IPC: it's mostly about to block all or to allow all... Or to choose
another tool that does not depend on D-Bus and alike.

Speaking of the "alike" part... Look at the X11 server: it's privileged,
it's complicated (buggy, vulnerable), it provides shared user interface
and "userspace" IPC. So an attacker could try to compromise the X11
server itself, could do keylogging, screenlogging, GUI spoofing, or
could try to attack another X11 clients by forging the user input.
There's nothing you can do about it with MAC/RBAC/RSBAC, and there's no
"Grsecurity and PaX for X11" things out there. But you can understand
the risks and do something to minimize the potential harm.

Often offline backups of important data are good for a start. If your
job relies heavily on security of your box where you watch youtube, read
email and open attachments and so on, then buy another box. :P Don't
install adobe flash and all other crap on it, don't surf irrelevant
websites, don't open email attachments, or even don't read email on that
box at all. :) And so on. Then let your job rely on security of that box. ;)

> I mean:
> Grsecurity had suffered of a return into libc exploit
> that bypassed its protection. Grsecurity had also
> a PaX-disabled bug in the past that expose
> machines to risks.
>
> I heard RSBAC had problem with the jail solidity etc.

Nothing is perfect. And remember that Grsecurity and PaX are orthogonal.
If you are interested, you should read the documentation on PaX and
Grsecurity, or even ask spender and PaX Team directly for the details.

> Recently I've read something about a 2.6.30 bug
> which makes useless, enforcement like SELinux,
> AppArmor and so on...

...and which is non-exploitable on kernels with PaX. :)

> so I'm wondering if it is possible to harden Linux
> the way you can leave it online with, approximately,
> the same (high) probability, it won't be compromised
> as OpenBSD does.

Linux and OpenBSD can't be compared directly.

OpenBSD kernel is less buggy and, if it can be said so, less vulnerable
by quantity (while, of cource, OpenBSD guys would say "It's by quality!"
:). In short: it's harder to find vulnerabilities in OpenBSD.

Linux kernel with PaX and Grsecurity is still more buggy (because of the
Linux part :), but got strong kernel protection that works against the
whole classes of kernel exploits. So it is less vulnerable by quality
(but still is more buggy). In short: it's harder to exploit
vulnerabilities in Linux kernel with Grsecurity and PaX.

OpenBSD got weakier overall userspace protection: less random bits in
ASLR, no mprotect() restrictions, no protection against bruteforcing the
prefork model's ASLR/SSP, no IPC restrictions, no capabilities
revocation, no reliable HIDS and HIPS (don't take abandoned systrace
seriously), no MAC or RBAC. Maybe something else significant - ask
spender and PaX Team, they know better.

Hardened Gentoo with hardened kernels have stronger overall userspace
protection and get security updates more quickly than OpenBSD ports
system... While there are some problems with keeping hardened-sources up
to date in Portage. ;) So you better use kernel patches from here:
http://www.grsecurity.net/~spender/

Also, there's no documentation for all these OpenBSD exploit mitigation
techiques. And there were issues with W^X that OpenBSD developers
prefered to fix with no word about its impact on security:

http://www.cr0.org/misc/obsdretf.asm - PoC exploit by Julien Tinnes
http://marc.info/?l=openbsd-cvs&m=113710599901750 - commit of the fix

Not kind of way one may expect from supposedly well-documented system
that supposedly stands for Full-Disclosure.

Also, you could read this:

http://www.coresecurity.com/content/open-bsd-advisorie

...and see that OpenBSD developers expressed not that much of interest
in digging even obviously security-related bugs in their kernel. Kind of
controversional to what they say about code audit.

> I'm sure there are many skilled people, reading
> this mailing list, so I'll appreciate if someone
> will be patient and will enlighten me, giving some
> impartial inputs on what to study in my spare time.

Well, I'm not the skilled one. The men behind Hardened Gentoo,
Grsecurity and PaX seem to keep silence, so I decided to reply. You may
be interested in contacting them directly and/or search google for
conversations between PaX Team or spender and linux kernel developers -
it's very interesting and informative.


natanael.copa at gmail

Sep 21, 2009, 5:03 AM

Post #10 of 18 (1858 views)
Permalink
Re: "How hard" is Linux kernel-side hardening? [In reply to]

On Sat, 2009-09-19 at 22:25 +0200, Marco Venutti wrote:


> --[cut]--
> You forgot to mention SSP (stack-smashing protection).
> --[cut]--
>
> I didn't forget it, but I'd like to primarily focus on
> RSBAC and GR-Sec.

I think thats wrong focus. What makes grsecurity (and gentoo hardened)
interesting is PaX, not the RSBAC. Same is to be said about the
corresponding functionallity in OpenBSD.

Vanilla kernel (and SElinux etc) don't have PaX.

I can recommend you to read up on what PaX does for you. Basicly, PaX
prevent you to exploit vulnerabilities. selinux will only limit what
your successful exploit is allowed to do.

My biggest worries when it comes to PaX (for the moment) is that you
cannot run paravirtualization with PaX.

-nc


veeenrg at gmail

Sep 21, 2009, 7:45 AM

Post #11 of 18 (1857 views)
Permalink
Re: "How hard" is Linux kernel-side hardening? [In reply to]

Hi,

--[cut]--
There is not a complete reference if not a lot of tips
--[cut]--



I appreciate every good tip ;-)


veeenrg at gmail

Sep 21, 2009, 7:46 AM

Post #12 of 18 (1857 views)
Permalink
Re: "How hard" is Linux kernel-side hardening? [In reply to]

--[cut]--
I was wrong here as you can see here:
http://en.wikibooks.org/wiki/Grsecurity/Appendix/Subject_Attributes
Sorry by the mistake.
--[cut]--


Don't worry!


tazok.id0 at gmail

Sep 21, 2009, 7:46 AM

Post #13 of 18 (1860 views)
Permalink
Re: "How hard" is Linux kernel-side hardening? [In reply to]

> Remember that RSBAC does not work with PaX on a recent kernels. If you
> really want more security with Linux, PaX is the first and the most
> important thing you should consider. It aims to prevent exploits from
> working, while MAC/RBAC/RSBAC fights the consequences in userspace and
> does little to protect against the kernel exploits.

RSBAC with PaX works with new kernels, you can patch it yourself or
you can download one kernel that is already patched from
http://enhanced.rsbac.org/2.6/2.6.31/.

> A server without PaX is barely a better choice.

The same as before, PaX runs with rsbac in new kernels


veeenrg at gmail

Sep 21, 2009, 8:10 AM

Post #14 of 18 (1856 views)
Permalink
Re: "How hard" is Linux kernel-side hardening? [In reply to]

--[cut]--
Remember that RSBAC does not work with PaX on a recent kernels.
--[cut]--

Thank you, 'cause this point
(the presence of a usable PaX)
is important to me!

--[cut]--
While there are some problems with keeping hardened-sources up
to date in Portage. ;) So you better use kernel patches from here:
http://www.grsecurity.net/~spender/ <http://www.grsecurity.net/%7Espender/>
--[cut]--

I see the GR-Security, provided in Hardened Gentoo,
is not the bare patch, but an "itself-patched" version,
so I'm wondering if these improvements become
part of the (following releases of the) official patch,
or not; I'm asking this just because, if improvements
are not included in the official patch, maybe it's better,
for me, to use the gentoo-hardened-kernel-source,
not-so-up-to-date, but improved!
What do you think about this?


veeenrg at gmail

Sep 21, 2009, 8:15 AM

Post #15 of 18 (1853 views)
Permalink
Re: "How hard" is Linux kernel-side hardening? [In reply to]

--[cut]--
My biggest worries when it comes to PaX (for the moment) is that you
cannot run paravirtualization with PaX.
--[cut]--


I believe, now I'm writing,
you can run paravirtualization
pretty well, if you choose KVM,
with no PaX issue.

I think soon, other virtualization approches,
will be available under PaX protection.


aoz.syn at gmail

Sep 21, 2009, 8:46 AM

Post #16 of 18 (1853 views)
Permalink
Re: "How hard" is Linux kernel-side hardening? [In reply to]

On Mon, Sep 21, 2009 at 09:10, Marco Venutti <veeenrg [at] gmail> wrote:
> I see the GR-Security, provided in Hardened Gentoo,
> is not the bare patch, but an "itself-patched" version,
> so I'm wondering if these improvements become
> part of the (following releases of the) official patch,

The Gentoo patches for the hardened kernel are largely cosmetic,
changing configure-time portions to fit the Gentoo world-view. For
the 2.6.29 kernel, they:

- Remove 'grsec' from the kernel's version text
- Reduce the compile-time warnings produced by grsecurity
- Allow PaX to be enabled without enabling grsecurity
- Set different (Gentoo-appropriate) default GIDs for the logging &
restriction portions
- Add Gentoo's profiles (server, workstation, etc.) for grsecuriity
- Add the source IP to SELinux AVC messages (the only functional change)
- Completely remove the ability to enable COMPAT_VDSO

> or not; I'm asking this just because, if improvements
> are not included in the official patch, maybe it's better,
> for me, to use the gentoo-hardened-kernel-source,
> not-so-up-to-date, but improved!

Gentoo's hardened-sources is probably the way you want to go,
regardless. It incorporates the latest version of grsecurity for the
given kernel version, and despite of being "behind" the kernel curve,
it's highly stable.


p.labushev at gmail

Sep 21, 2009, 7:27 PM

Post #17 of 18 (1844 views)
Permalink
Re: "How hard" is Linux kernel-side hardening? [In reply to]

Javier J. Martínez Cabezón пишет:

> RSBAC with PaX works with new kernels, you can patch it yourself or
> you can download one kernel that is already patched from
> http://enhanced.rsbac.org/2.6/2.6.31/.

I'm sorry for that wrong assumption. Last time I checked there were no
recent kernel pathes with PaX in http://enhanced.rsbac.org/2.6/. The
fact RSBAC is working with PaX makes it really interesting, thanks.

Are there any plans to support RSBAC+PaX kernels?


franxisco1988 at gmail

Sep 22, 2009, 2:08 AM

Post #18 of 18 (1842 views)
Permalink
Re: "How hard" is Linux kernel-side hardening? [In reply to]

2009/9/22 Pavel Labushev <p.labushev [at] gmail>:
> Are there any plans to support RSBAC+PaX kernels?
AFAIK the RSBAC is unmaintained to the date. So I doubt it.

Gentoo hardened RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.