All of lore.kernel.org
 help / color / mirror / Atom feed
* labeling of compilers etc
@ 2006-01-29  0:56 Russell Coker
  2006-01-29 13:33 ` Steve G
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Russell Coker @ 2006-01-29  0:56 UTC (permalink / raw)
  To: SELinux List

In many discussions about hardening systems the idea is suggested that 
machines should not have compilers unless they are development machines.

It would not be difficult to label compilers as compiler_exec_t and only 
permit user domains the ability to execute files of such type (daemons don't 
need to compile software).  What do you think of this idea?  Maybe we would 
want to have a more generic type such as devel_exec_t and label programs such 
as gdb with it as well.

Also interpreters could be modified to provide similar benefits.  Currently 
many (most?) shell interpreters try to detect and prevent setuid operation 
with code roughly equivalent to if(getuid() != geteuid()) seteuid(getuid).  
Bash currently has such code (just done a quick test) and other shells had 
such cost in place last time I tested them.  I believe that this establishes 
a precedent for shell interpreters to check for and prevent insecure modes of 
operation.

A logical extension of this precedent to SE Linux would be to have it check 
the type of a file to be executed and confirm that the current domain is 
permitted to execute scripts of the type in question, for a regular file it 
would get the context (after opening it) and ask SE Linux whether the current 
context has execute access for the file class.  For a character device node 
(IE stdin but let's not assume that's the only device to be used) it would 
check for execute access of class chr_file for the context in question.  Does 
it even make sense to execute a block device node as a shell script?

In some mailing lists related to SE Linux it's been mentioned that people 
desire these features.  I believe that I have come up with a reasonable 
design to solve the problems in question.  If it's considered worth-while 
then I'm willing to write a policy patch for the first one and a bash patch 
for the second one.

Also it should be noted that if the perl interpreter is setuid then it'll 
happily do things as the EUID, this means that we have no good precedent to 
rely on in this case.  This doesn't stop us, just means that the chance of 
getting code accepted upstream is dramatically reduced.

-- 
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 majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2006-02-03 13:26 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-29  0:56 labeling of compilers etc Russell Coker
2006-01-29 13:33 ` Steve G
2006-01-29 18:39   ` Russell Coker
2006-01-29 22:08 ` Lorenzo Hernández García-Hierro
2006-01-29 23:03   ` Russell Coker
2006-01-30  0:26     ` Lorenzo Hernández García-Hierro
2006-01-30  5:10       ` Russell Coker
2006-01-30 14:29 ` Stephen Smalley
2006-01-31  7:47   ` Russell Coker
2006-02-01  2:34     ` Daniel J Walsh
2006-02-01  8:22       ` Russell Coker
2006-02-01 12:51         ` Daniel J Walsh
2006-02-01 23:15           ` Russell Coker
2006-02-01 13:45     ` Stephen Smalley
2006-02-01 13:47       ` Stephen Smalley
2006-02-01 23:27       ` Russell Coker
2006-02-02 12:32         ` Stephen Smalley
2006-02-03 11:15           ` Russell Coker
2006-02-03 13:26             ` Stephen Smalley

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.