All of lore.kernel.org
 help / color / mirror / Atom feed
* MLS enforcing PTYs, sshd, and newrole
@ 2006-10-12  7:33 Klaus Weidner
  2006-10-12 10:25 ` Russell Coker
  0 siblings, 1 reply; 61+ messages in thread
From: Klaus Weidner @ 2006-10-12  7:33 UTC (permalink / raw)
  To: selinux, redhat-lspp

Hello,

in recent LSPP discussions, the subject of end-to-end enforcement of MLS
restrictions in a labeled networking environment came up again, and I had
volunteered to summarize it.

Here's the current situation as I understand it (please correct me if I
misunderstand it).

Background: A user who logs in via sshd over a labeled network connection
through xinetd will get a default MLS level assigned based on the
connection's level.  Then, when using newrole to change MLS levels,
newrole creates a PTY pair and relabels one end to the new level, while
the other end stays at the original level.

There's currently no effective enforcement of MLS restrictions between
the endpoints of a PTY pair, as described in the following bug:

     https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=200110

The effect is that the user could "cat" secret data and have it sent over
an "unclassified" network connection; or use "newrole" to easily
reclassify data without needing any MLS override privileges.

Adding MLS enforcement for PTYs is tricky. There are mainly two options
to give SELinux a chance to enforce rules and constraints:

(a) always relabel both ends synchronously and trust the existing
    MLS constraint checks to prevent unauthorized data flows

(b) do an MLS check in the middle of the PTY to ensure data flow is
    permitted between the ends

Option (a) doesn't work since sshd is a trusted application with MLS
overrides, so it'll happily ignore any MLS level mismatches on data
coming from the relabeled PTY end facing the network. 

Option (b) is also undesirable since it would either need to permit MLS
overrides based on the endpoint labels (which would bring back the sshd
override problem), or if it doesn't permit overrides it would be useless
for cases where you do want them.

Both options are currently not implemented and are likely to break
applications for people who don't care about meeting LSPP requirements,
which is obviously undesirable.

This was the basis for a fairly radical alternate proposal: Leave the PTY
behavior the way it is now, but make sure that they never get relabeled
so that the MLS check is unnecessary. That means no more "newrole -l".

So, an attempt to get a LSPP compliant configuration might look something
like the following (nobody is proposing making this the shipped default,
it would be set up locally by those who want it):

- don't allow non-admin users to run the newrole program at all, for
  example by setting its DAC rights to be root-executable only.

- for network login via sshd, nothing really changes. The user gets a
  session using the network connection's current context, and stays at
  that level for the entire session.

- local login always launches a session at the default context for the
  user

If you need local console (or serial) login at different MLS levels for
the same user, you can create multiple Linux users for each human user
that share the same uid and home directory, and use "semanage login" to
map them to appropriate levels. So you'd have smith_secret_cat1,
smith_unclassified and so on.

(That's currently not well compatible with polyinstantiation based on
username - it would be preferable to use the numerical UID (or canonical
username) instead of the login name for the polydir. But that would be a
fairly easy fix.)

It should still work to put a multilevel X desktop on top of this, since
that presumably uses a mechanism other than "newrole" to launch terminals
or windows at different levels. But that's only guesswork due to not
having seen any code for this...

Comments?

-Klaus

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

end of thread, other threads:[~2007-01-05 18:43 UTC | newest]

Thread overview: 61+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-12  7:33 MLS enforcing PTYs, sshd, and newrole Klaus Weidner
2006-10-12 10:25 ` Russell Coker
2006-10-12 14:48   ` Klaus Weidner
2006-10-12 15:16     ` Michael C Thompson
2006-10-12 16:54     ` [redhat-lspp] " Casey Schaufler
2006-10-12 15:37   ` Casey Schaufler
2006-10-19 13:21     ` [redhat-lspp] " Daniel J Walsh
2006-10-19 13:30       ` Stephen Smalley
2006-10-19 14:06         ` Daniel J Walsh
2006-10-19 14:32           ` Stephen Smalley
2006-10-21  4:37           ` Casey Schaufler
2006-10-23 16:14         ` James Antill
2006-10-23 16:39           ` Casey Schaufler
2006-10-23 16:45             ` Paul Moore
2006-10-23 18:41               ` Casey Schaufler
2006-10-24 20:37           ` James Antill
2006-10-25  0:19             ` George C. Wilson
2006-10-25 11:48             ` Stephen Smalley
2006-10-25 12:22               ` Stephen Smalley
2006-10-25 13:50                 ` James Antill
2006-10-25 13:59                   ` Stephen Smalley
2006-10-25 19:15                     ` James Antill
2006-10-25 19:24                       ` Stephen Smalley
     [not found]                         ` <1161970810.29689.88.camel@code.and.org>
     [not found]                           ` <1161974293.1306.167.camel@moss-spartans.epoch.ncsc.mil>
2006-10-30 20:03                             ` [PATCH 1/3] " James Antill
2006-10-30 20:16                               ` [PATCH 2/3] " James Antill
2006-10-30 20:22                                 ` [PATCH 3/3] " James Antill
2006-10-31 14:23                                 ` [PATCH 2/3] " Stephen Smalley
2006-10-31 14:24                                   ` Stephen Smalley
2006-10-31 15:00                                     ` James Antill
2006-10-31 15:11                                       ` Stephen Smalley
2006-10-31 16:04                                         ` James Antill
2006-10-31 16:21                                           ` Stephen Smalley
2006-10-31 18:33                                             ` James Antill
2006-11-01 12:36                                               ` Stephen Smalley
2007-01-04 21:34                                                 ` [redhat-lspp] " Daniel J Walsh
2007-01-04 21:57                                                   ` Linda Knippers
2007-01-04 22:19                                                     ` Daniel J Walsh
2007-01-04 23:19                                                       ` Linda Knippers
2007-01-05  1:07                                                         ` Klaus Weidner
2007-01-05  3:05                                                           ` Joshua Brindle
2007-01-05  3:33                                                             ` Klaus Weidner
2007-01-05  3:35                                                               ` Joshua Brindle
2007-01-05  4:01                                                                 ` Klaus Weidner
2007-01-05 15:56                                                                   ` Stephen Smalley
2007-01-05 16:23                                                                     ` Daniel J Walsh
2007-01-05 16:24                                                                     ` Daniel J Walsh
2007-01-05 17:05                                                                       ` Daniel J Walsh
2007-01-05 18:34                                                                         ` Stephen Smalley
2007-01-05 18:43                                                                       ` Stephen Smalley
2007-01-05 15:55                                                                 ` Stephen Smalley
2007-01-04 22:13                                                   ` Casey Schaufler
2007-01-04 22:20                                                     ` Daniel J Walsh
2006-10-31 14:20                               ` [PATCH 1/3] " Stephen Smalley
2006-10-25 21:36                       ` [redhat-lspp] " Stephen Smalley
2006-10-26 14:09                         ` Daniel J Walsh
2006-10-19 13:32       ` Steve Grubb
2006-10-19 13:39         ` Stephen Smalley
2006-10-20  7:00       ` Russell Coker
2006-10-27 15:36         ` Valdis.Kletnieks
2006-10-27 23:04           ` Russell Coker
2006-10-31 14:29             ` 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.