From: Sven Vermeulen <sven.vermeulen@siphos.be>
To: selinux@tycho.nsa.gov
Subject: Re: policy for PowerDNS
Date: Wed, 5 Dec 2012 20:24:26 +0100 [thread overview]
Message-ID: <20121205192426.GA6594@siphos.be> (raw)
In-Reply-To: <50BF355A.3090708@redhat.com>
On Wed, Dec 05, 2012 at 06:51:54AM -0500, Daniel J Walsh wrote:
> > If named by default doesn't require this access, doesn't it make sense to
> > keep it restricted? Remote code execution vulnerabilities might be
> > mitigated if the policy prohibits execution of common binaries
> >
> > Reading /usr however seems less problematic (I'm even surprised it doesn't
> > require this already).
>
> Perhaps but if you have enough control over a process to execute random
> binaries, one would guess you have enough control to call other syscalls
> implemented in those binaries.
I can follow your reasoning, but I disagree.
Remote command execution can be done either in a very simple way (for
instance, user input that is not correctly sanitized and that is directly
used for spawning specific commands) or through memory manipulation.
Let's say it is memory manipulation, then there are imho two ways this can
lead to a remote command execution: data memory or execution memory.
Either the memory is data (non-executable) and is used by the application
for its flows, logic and what else. In this case, you won't have the
ability to invoke syscalls yourself (through the exploit) but you can
manipulate the application, which underlyingly might use the data to
spawn commands.
Or the memory is code (executable). In this case, if you can manipulate
this, then you indeed have control over the application completely and can
invoke system calls yourself.
The majority of Remote Code Execution vulnerabilities, imho, plays in the
data memory, not in the executable memory. For one, because executable
memory shouldn't be writeable in the first place (you can use PaX or other
constraints for that). It is also harder to manipulate this code to the
extend that you can do useful things with it.
But if we're talking about data memory manipulation/corruption, then the
syscalls don't play a role, and SELinux can reduce the impact of such
vulnerabilities if you can downplay what the domain is allowed to do. Such
as executing generic binaries.
Of course, an even better way to handle this is to chroot the named daemon
itself so that there are no binaries to execute beyond those that are
already needed. I do believe that chrooting named is still a very useful
approach even if you use SELinux [1], but there are people that think
differently.
Wkr,
Sven Vermeulen
[1] http://blog.siphos.be/2012/04/why-both-chroot-and-selinux/
--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.
next prev parent reply other threads:[~2012-12-05 19:25 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-03 14:22 policy for PowerDNS Sander Hoentjen
2012-12-03 15:08 ` grift
2012-12-04 11:37 ` Sander Hoentjen
2012-12-04 14:14 ` Daniel J Walsh
2012-12-04 21:11 ` Sven Vermeulen
2012-12-05 11:51 ` Daniel J Walsh
2012-12-05 13:10 ` Sander Hoentjen
2012-12-05 19:24 ` Sven Vermeulen [this message]
2012-12-24 12:48 ` Sander Hoentjen
[not found] ` <50DC666E.4040101@redhat.com>
2012-12-27 15:23 ` Sander Hoentjen
2012-12-27 17:21 ` Daniel J Walsh
2013-01-03 13:47 ` Sander Hoentjen
2013-01-03 13:52 ` Daniel J Walsh
2013-01-03 16:40 ` Daniel J Walsh
2013-01-04 14:11 ` Sander Hoentjen
2012-12-03 15:10 ` grift
2012-12-04 9:56 ` Sander Hoentjen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20121205192426.GA6594@siphos.be \
--to=sven.vermeulen@siphos.be \
--cc=selinux@tycho.nsa.gov \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.