All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel J Walsh <dwalsh@redhat.com>
To: Stephen Smalley <sds@epoch.ncsc.mil>
Cc: selinux@tycho.nsa.gov
Subject: Re: SUDO package
Date: Wed, 30 Apr 2003 16:13:44 -0400	[thread overview]
Message-ID: <3EB02E78.3000905@redhat.com> (raw)
In-Reply-To: <1051730417.1028.78.camel@moss-huskers.epoch.ncsc.mil>

[-- Attachment #1: Type: text/plain, Size: 2323 bytes --]

Stephen Smalley wrote:

>On Wed, 2003-04-30 at 15:06, Daniel J Walsh wrote:
>  
>
>>I am still not sure I can do this.  Are you are stating that I would
>>have to have an allow rule for
>>each *exec_t?
>>    
>>
>
>No, I'm talking about your allow rule for directory access.  An *exec_t
>type should never be applied to a directory; it is supposed to be the
>type of an entrypoint executable for a domain.  For allowing sudo to
>search directories containing binaries, you should just be able to
>enumerate the set of directory types, e.g. bin_t, sbin_t, lib_t, etc_t,
>etc.  There is no valid reason to use file_type.  Just define a macro in
>global macros that enumerates the list of system directories with
>authorized programs, and use that macro in your rule.
>  
>
Ok now I understand.  I can just go with the directory commands from  
can_exec_any rule.
    allow $1 { bin_t sbin_t lib_t etc_t }:dir r_dir_perms;
    allow $1 { bin_t sbin_t }:lnk_file read;

in sudo.te which would satisfy my needs.  Probably do not need lib_t or 
etc_t.
Is that what you had in mind?

>  
>
>>So sudo needs all the rights that su/newrole has for a particular
>>    
>>
>role.  
>
>Right, but we would ultimately like to see the roles pruned down to
>least privilege, e.g. you don't really want sysadm_t running arbitrary
>executables directly, as that can easily lead to a compromise.
>
>  
>
>>Ok I just went back and read the code again and it looks like I can
>>implement the terminal stuff.
>>There is a -b option on the sudo command that allows sudo to run in
>>background.  Or using job
>>control you could run the command in background.
>>
>>sudo -r sysadm_r /usr/bin/PROGRAM &
>>
>>So what happens to control over the terminal in this situation?
>>    
>>
>
>In that case, the program shouldn't be accessing the terminal, and you
>should redirect input and/or output to a file if the program wants to
>read any input or write any output.
>
>  
>
Not exactly an ideal behaviour.  

Consider
sudo -r sysadm_r /bin/sh
would be broken by this.

This is an interesting problem in that two processes want to use the 
terminal at the same time, each with a different security context.  So 
if one is running and is suspended, do we change the security context of 
the terminal to the now running terminal?  Could we do that?

Dan

[-- Attachment #2: Type: text/html, Size: 3032 bytes --]

  reply	other threads:[~2003-04-30 20:13 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-16  8:24 update question ccallen
2003-04-16 12:29 ` Stephen Smalley
2003-04-18  4:08 ` Russell Coker
2003-04-18 16:02   ` SUDO package Daniel J Walsh
2003-04-22 14:19     ` Stephen Smalley
2003-04-23  7:10       ` Russell Coker
2003-04-24 17:31         ` Stephen Smalley
2003-04-24 18:07           ` Russell Coker
2003-04-25 19:41             ` Howard Holm
     [not found]       ` <3EA5A040.40107@redhat.com>
     [not found]         ` <1051199603.20300.33.camel@moss-huskers.epoch.ncsc.mil>
2003-04-30 15:42           ` Daniel J Walsh
2003-04-30 17:43             ` Stephen Smalley
2003-04-30 19:04               ` Francois Leclerc
2003-04-30 19:18                 ` Daniel J Walsh
2003-04-30 19:06               ` Daniel J Walsh
2003-04-30 19:20                 ` Stephen Smalley
2003-04-30 20:13                   ` Daniel J Walsh [this message]
2003-04-30 20:26                     ` Stephen Smalley
2003-05-01  5:46                 ` Russell Coker
2003-04-30 18:09             ` Russell Coker

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=3EB02E78.3000905@redhat.com \
    --to=dwalsh@redhat.com \
    --cc=sds@epoch.ncsc.mil \
    --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.