All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: Domain transition -- enabling user_r in eklogin
@ 2002-12-17 17:25 Stephen D. Smalley
  2002-12-18  0:28 ` forrest whitcher
  0 siblings, 1 reply; 15+ messages in thread
From: Stephen D. Smalley @ 2002-12-17 17:25 UTC (permalink / raw)
  To: fw; +Cc: russell, SELinux


> avc:  denied  { ioctl } for  pid=142 exe=/bin/bash path=/dev/tty1 dev=08:02 
ino=22757 scontext=system_u:system_r:user_t 
tcontext=system_u:object_r:tty_device_t tclass=chr_file
> avc:  denied  { ioctl } for  pid=142 exe=/bin/bash path=/dev/tty1 dev=08:02 
ino=22757 scontext=system_u:system_r:user_t 
tcontext=system_u:object_r:tty_device_t tclass=chr_file

This looks like you aren't using the SELinux-patched login program.
The login process needs to set the security context for the user session
and to relabel the tty based on that security context.  If you use an
unmodified login, you'll get the behavior above.

--
Stephen Smalley, NSA
sds@epoch.ncsc.mil


--
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] 15+ messages in thread
* Re: Domain transition -- enabling user_r in eklogin
@ 2002-12-17 16:14 Stephen D. Smalley
  2002-12-17 17:10 ` forrest whitcher
  0 siblings, 1 reply; 15+ messages in thread
From: Stephen D. Smalley @ 2002-12-17 16:14 UTC (permalink / raw)
  To: russell, fw; +Cc: SELinux


> For which I've been having problems getting an appropriate transition working.
> (the following may have some typos I don't have either box running just now
> to refer to)
> 
> The remote_login domain was clearly designed with telnet in mind, there is
> no transtion to user_u:user_r.
> 
> Looking this over I moved login.krb5 into the same SID as /bin/login, using
> login.te as an example, however once the user's successfully authenticated
> the domain remains system_u:system_r and 'newrole(1)' is not available.
> 
> I'm going somewhat from memory so there may be some missed details, however
> I've tried re-configuring several times without much luck.
> 
> Also this test is being done on a slackware setup, because I was able to
> get telnetd working in a redhat system more easily there may be some system 
> layout issues causing problems, not sure yet.

The example policy includes rules to transition from inetd_t or tcpd_t to 
rlogind_t upon executing a file labeled with the rlogind_exec_t type (assigned 
to in.rlogind and in.telnetd in the file contexts configuration), and to 
transition from rlogind_t to remote_login_t upon executing a file labeled with 
the login_exec_t type (assigned to login in the file contexts configuration).  
The remote_login_t domain can then transition to user_t, at which point
the user can run newrole if the user has an entry in the policy/users
file and is authorized for any other roles.  If the user lacks an entry in the 
policy/users file and you retain the user_u entry in policy/users, then the user 
will be mapped to the generic user_u identity for the SELinux security context 
and will be limited to operating in user_r.

--
Stephen Smalley, NSA
sds@epoch.ncsc.mil


--
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] 15+ messages in thread
* Re: Domain transition
@ 2002-12-16 21:25 Stephen D. Smalley
  2002-12-17  9:19 ` Russell Coker
  0 siblings, 1 reply; 15+ messages in thread
From: Stephen D. Smalley @ 2002-12-16 21:25 UTC (permalink / raw)
  To: SELinux, rmayo


> 1)    What is "domain transition"?  I've configured my system such that it
> doesn't happen, but I'm wondering if it's the best way to go.

Read the Configuring the SELinux Policy report, available in the
distribution (selinux/doc/policy) or from the NSA SELinux web site.
You might also want to read a background paper on Type Enforcement (TE).

A domain is a security attribute associated with a process.  Processes with the 
same domain have the same set of permissions to the same set of objects. A 
domain transition occurs when a process changes its domain, conventionally by 
executing a program with a particular entrypoint type.  Domain transitions 
provide a controlled mechanism for changes in permissions, whether to gain 
permissions, shed permissions, or switch to a completely orthogonal set of 
permissions.  I doubt that you really configured away domain transitions. If you 
did, you might as well not use SELinux.

> 2)    Is there a text file on my system with the list of user roles or is
> that information stored some other way?

In the source distribution's selinux tree, the policy/users file specifies the 
set of roles authorized for each user.  Obtaining the full set of defined roles
is not entirely straightforward because role declarations are now distributed
among the domain .te files.  Roles for user processes are typically defined
in policy/domains/user.te or policy/domains/admin.te.  You may want to look at 
the Tresys policy tools as a way of more easily viewing the policy or managing 
users.

In an installed form, the policy sources are typically placed into 
/etc/security/selinux/src/policy.

> 3)    Can I configure the operating system NOT to ask for a user role on
> login?  I would much prefer to have user role determined BY the login.

The user will be limited to the roles authorized for that user in
policy/users.  If you authorize the user for multiple roles, then he
can choose one of those roles at login time or subsequently via newrole.
What's the point of limiting the user to a single role at login time if he can 
change it subsequently via newrole?  Of course, you could limit login
to transition to a single user domain if you want to force all users to
initially login with a certain role/domain.

--
Stephen Smalley, NSA
sds@epoch.ncsc.mil


--
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] 15+ messages in thread

end of thread, other threads:[~2002-12-21 22:34 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-12-17 17:25 Domain transition -- enabling user_r in eklogin Stephen D. Smalley
2002-12-18  0:28 ` forrest whitcher
2002-12-18  1:28   ` Brian May
2002-12-18  7:45     ` Russell Coker
2002-12-18 22:27       ` Brian May
2002-12-19  9:51         ` Russell Coker
2002-12-19 14:02           ` Jesse Pollard
2002-12-19 22:33             ` Russell Coker
2002-12-20 16:25               ` Jesse Pollard
2002-12-20 18:40                 ` Russell Coker
2002-12-20 20:07                   ` Jesse Pollard
2002-12-21 22:34                     ` Russell Coker
  -- strict thread matches above, loose matches on Subject: below --
2002-12-17 16:14 Stephen D. Smalley
2002-12-17 17:10 ` forrest whitcher
2002-12-16 21:25 Domain transition Stephen D. Smalley
2002-12-17  9:19 ` Russell Coker
2002-12-17 11:42   ` Brian May
2002-12-17 13:31     ` Russell Coker
2002-12-17 15:48       ` Domain transition -- enabling user_r in eklogin forrest whitcher

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.