Skip to contentSkip to conversation

New Potential Research Area for SELinux

DISCUSSION Joseph Pingenot 3 participants 3 messages Sep 14, 2003 – Sep 15, 2003 SELinux security module

lore
Share & tools
lore
#0 lore raw

Hello.

A new potential area for SELinux to research is sandboxing native code
and system spoofing (emulation, if you prefer).
While this is already done to an extent in some systems (e.g. Gentoo's
portage system can "sandbox"), usually through a special kernel code and/or playing with dynamic linking (e.g. making programs load special libraris), to my knowledge. The problem with playing with dynamic linking is apparent if you consider sandboxing statically linked applications. The problem with special kernel code is that you have to play around in the kernel itself, which requires root access and isn't always feasible (e.g. in Windows). This also requires rules to be handed down by the administrator; users cannot control what the programs can and cannot do without special workarounds.
A much more robust sandboxing solution can be created when you go to the
chip emulation layer. If you have a virtual PC (e.g. VirtualPC for the Mac or bochs (iirc)), you can intercept system calls and modify or reject them as desired. The most obvious application of this is permitting or denying file access, specifically writing files or dealing with networking (to prevent the next Blaster). You can also modify just about anything desired, so the system spoofing part comes in here; you could, for instance, copy another system's /proc entries to make a program think it's running on a different machine or play with password/user lookup routines to fool a program. Essentially, a user can tell the emulator how to set up an environment. The original kernel will allow or deny things in the end, but the user can further restrict what her programs may do, without the administrator needing to intervene (which makes a degree of sense).
The biggest drawback to such a scheme is the overhead of emulating a whole
system. A much faster solution would be to create a virtual machine type system, like VMWare. My knowlege in this area is quite hazy, but it is my understanding that the Linux kernel has hooks to allow a process to act as a virtual machine if the underlying hardware allows, and that interrupts and traps can then be, well, trapped and redirected or modified. This would be much faster than complete emulation, at the cost of extra work to ensure the security of the system.
Hope I'm not too far off my rocker; I think this would be an excellent
system for running untrusted code (or even "trusted" code. ;) Examples which immediately come to mind are executable email attachments and networked collaboration/p2p environments (part of my netshard project, which is part of what gave me the idea in the first place).
Sorry if someone's already thought of this. I'd work on it, but I have
about five active projects on the table already, and I have to succeed in grad school at the same time. ;)

-Joseph

Signature · 10 lines
Joseph===============================================trelane@digitasaru.net
"That is the key to the real monopoly in Redmond. _They_ control your data.
 Their products have the content needed to do your work locked up in their
 semantics, and their binary formats. Before we can start creating a bold
 new world, we've got to free the hostage content."  --Jody Goldberg, on /.

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#1 lore raw
Quoted 6 lines · Joseph Pingenot

While this is already done to an extent in some systems (e.g. Gentoo's
portage system can "sandbox"), usually through a special kernel code and/or playing with dynamic linking (e.g. making programs load special libraris), to my knowledge. The problem with playing with dynamic
linking is apparent if you consider sandboxing statically linked applications. The problem with special kernel code is that you have to play

My SE Linux policy for chroot environments does most of what you would desire in this regard.

Quoted 7 lines

system. A much faster solution would be to create a virtual machine type system, like VMWare. My knowlege in this area is quite hazy, but it is my understanding that the Linux kernel has hooks to allow a process to act as a virtual machine if the underlying hardware allows, and that interrupts and traps can then be, well, trapped and redirected or modified. This would be much faster than complete emulation, at the cost of extra work to ensure the security of the system.

You should probably investigate UML, see:
http://sourceforge.net/projects/user-mode-linux/

Quoted 4 lines

Hope I'm not too far off my rocker; I think this would be an excellent
system for running untrusted code (or even "trusted" code. ;) Examples which immediately come to mind are executable email attachments and networked collaboration/p2p environments (part of my netshard project,

Regular SE Linux functionality should be enough for such things IMHO. Why do you think you need more than a separate domain for such untrusted code?

The biggest problem we have at the moment (IMHO) is that Security Enhanced X isn't implemented yet.

Signature · 10 lines
http://www.coker.com.au/selinux/   My NSA Security Enhanced Linux packages
http://www.coker.com.au/bonnie++/  Bonnie++ hard drive benchmark
http://www.coker.com.au/postal/    Postal SMTP/POP benchmark
http://www.coker.com.au/~russell/  My home page


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#2 lore raw
Quoted 9 lines · Russell Coker
Quoted 7 lines · Joseph Pingenot

[...]

Hope I'm not too far off my rocker; I think this would be an excellent
system for running untrusted code (or even "trusted" code. ;) Examples which immediately come to mind are executable email attachments and networked collaboration/p2p environments (part of my netshard project,

Quoted 6 lines

Regular SE Linux functionality should be enough for such things IMHO. Why do you think you need more than a separate domain for such untrusted code?

The biggest problem we have at the moment (IMHO) is that Security Enhanced X isn't implemented yet.

SE-X is something I'm working on as time permits, based on the current XFree86 v4.3.0. I'm hoping to have an initial draft of an implementation strategy I can publish on the mailing list sometime towards the end of September to middle of October, with the desire that all mailing list participants critically review it for completeness and/or security loopholes.

Bill

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.