MLS enforcing PTYs, sshd, and newrole
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 [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 5 lines · Klaus Weidner
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_unclassifiedand so on.
That doesn't work well with password expiry policies. Having smith_secret_cat1 password expire at different times to smith_unclassified would be a pain for users and sys-admins.
Then if you want to use RSA SecurID or similar tokens you have an extra level of pain in mapping them to the right Unix account names.
I think that the right solution is to re-enable the code for selecting the role etc at login time and adding some code for selecting the level. It should not be difficult to do this if there are no plans to ever support it for ssh or X logins.
Quoted 4 lines
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...
Can someone who has worked on one of these things before please comment on how it's done?
It seems to me that the current way of managing desktops isn't going to work (IE Gnome and KDE won't work).
Currently we have a desktop manager program that can launch an xterm (in the same context) and then a shell (EG bash) is run in the same context as an xterm. This means that if you run a hostile program in one xterm it can ptrace or otherwise interfere with all processes back to the desktop and down again to another xterm. I guess we need to have a trusted desktop manager (I use the term loosely, such a program probably wouldn't have 10% the features of anything we currently call a "desktop manager") that launches xterms in different contexts depending on what they are doing and has the option of launching an xterm that runs "newrole -l" (or maybe launches xterms at different levels).
Signature · 9 lines
[email protected] http://etbe.blogspot.com/ My Blog http://www.coker.com.au/sponsorship.html Sponsoring Free Software development -- 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.
Quoted 11 lines · Russell Coker
Quoted 5 lines · Klaus Weidner
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_unclassifiedand so on.That doesn't work well with password expiry policies. Having
smith_secret_cat1password expire at different times tosmith_unclassifiedwould be a pain for users and sys-admins.
Quoted 7 lines
Then if you want to use RSA SecurID or similar tokens you have an extra level of pain in mapping them to the right Unix account names.
I think that the right solution is to re-enable the code for selecting the role etc at login time and adding some code for selecting the level. It should not be difficult to do this if there are no plans to ever support it for ssh or X logins.
Good point, and I agree that the right long-term solution would be to do context selection (via a PAM module?) at login time.
I don't think that it's a significant issue though for current LSPP configurations - any people who plan to use this please speak up if you disagree. The current LSPP configurations are for server systems, and require that local consoles (including serial consoles listed in /etc/securetty) are physically restricted to be accessible by admins only, and admins can still use newrole. This leaves only non-admin serial terminals, and I don't think those are that common these days.
Of course, people deploying a system that's based on the LSPP configuration can choose to deviate from the evaluated configuration based on their own risk assessment. This could include restoring general access to "newrole" if they don't consider the PTY exploit to be a concern.
-Klaus
--
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.
Quoted 5 lines · Klaus Weidner
Of course, people deploying a system that's based on the LSPP configuration can choose to deviate from the evaluated configuration based on their own risk assessment. This could include restoring general access to "newrole" if they don't consider the PTY exploit to be a concern.
And if you want polyinstation, then an suid newrole needs to be available :)
--
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.
Quoted 6 lines · --- Klaus Weidner
I don't think that it's a significant issue though for current LSPP
configurations - any people who plan to use this please speak up if you
disagree. The current LSPP configurations are for server systems,
A common deployment of an MLS system is the
the enormous compute "server", where users
log in at various MLS values to process
data, some of which is common, and some of
which is not. Usually this means a network
login, today typically using ssh. Rarely
will a user need to log in at more than one
MLS value, but it can (and has) happened
that a user will have multiple valid MLS
values. In some installations they will want
to allow this over "unlabeled networks",
and in some they will not.
Quoted 9 lines
and
require that local consoles (including serial consoles listed in/etc/securetty) are physically restricted to be accessible by admins
only, and admins can still use newrole. This leaves only non-admin serial
terminals, and I don't think those are that common these days.
Indeed!
Quoted 9 lines
Of course, people deploying a system that's based on the LSPP
configuration can choose to deviate from the evaluated configuration
based on their own risk assessment. This could include restoring general
access to "newrole" if they don't consider the PTY exploit to be a
concern.
It might be best if you don't say that out loud.
Casey Schaufler
[email protected]
--
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.
Quoted 11 lines · --- Russell Coker
Quoted 1 line · Klaus Weidner
If you need local console (or serial) login at
different MLS levels for
Quoted 1 line
the same user, you can create multiple Linux users
for each human user
Quoted 1 line
that share the same uid and home directory, and
use "semanage login" to
Quoted 1 line
map them to appropriate levels. So you'd have
smith_secret_cat1,Quoted 1 line
smith_unclassifiedand so on.
The Unix MLS systems provide mechanism
in login to specify MAC the user label.
In Trix 6 I would use:
login: casey MAC=appropriatevalue
passwd: ....
In Trix 4 it was:
login: casey
label: appropriatevalue
passwd: ...In Solaris I *think* it would be:
login: casey -l appropriatevalue
passwd: ...
but rust could well have filled that part
of my memory.
Creating a seperate login name for each MLS
value would be fine if you have a small number
of users with a small number of labels, but
will not be competitive in a production
environment.
Quoted 5 lines
That doesn't work well with password expiry policies. Having
smith_secret_cat1password expire at different times tosmith_unclassified
would be a pain for users and sys-admins.
That too.
Quoted 16 lines
Then if you want to use RSA SecurID or similar
tokens you have an extra level
of pain in mapping them to the right Unix account
names.I think that the right solution is to re-enable the code for selecting the
role etc at login time and adding some code for selecting the level. It
should not be difficult to do this if there are no plans to ever support it
for ssh or X logins.Quoted 1 line
It should still work to put a multilevel X desktop
on top of this, since
Quoted 1 line
that presumably uses a mechanism other than
Quoted 8 lines
"newrole" to launch terminals
Quoted 1 line
or windows at different levels. But that's only
guesswork due to not
Quoted 1 line
having seen any code for this...
Can someone who has worked on one of these things
before please comment on how
it's done?
Hee Hee Hee. On Trix you get a new window at
a different label using su -M:
trix% su -M moresecret -c xterm &
trix% su -M evenmoresecret -c xclock &
This works because "su -M" closes all open
fds, reopening std{in,out,err} on /dev/null,
and the X server is MLS aware, accepting
connections with any label the user is cleared
for and enforcing policy on the objects it
controls. The X server uses TSIG interfaces
to obtain MLS information about the far end
of the connections ...
Quoted 3 lines
It seems to me that the current way of managing
desktops isn't going to work
(IE Gnome and KDE won't work).
... and the window manager is also MLS aware.
Casey Schaufler
[email protected]
--
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.
So one proposed solution to this is to take away the newrole -l functionality all together and to add Sensitivity selection to the local login.
We can implement pam_selinux to ask for the sensitivity level
username: dwalsh
passwd: ********
Sensitivity: SystemLow
If we then remove -l from newrole we are done?
Dan
--
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.
Quoted 4 lines · Daniel J Walsh
So one proposed solution to this is to take away the newrole -l functionality all together and to add Sensitivity selection to the local login.
Quoted 8 lines
We can implement
pam_selinuxto ask for the sensitivity levelusername: dwalsh
passwd: ********
Sensitivity: SystemLowIf we then remove -l from newrole we are done?
pam_selinux used to have support to let the user pick from the list of reachable contexts for the user. So you could just restore that support.
That doesn't address sshd though. Or gdm. sshd shouldn't be too difficult. There were some externally developed gdm patches for selinux that enabled context selection long ago, but nothing recent (pre-Fedora).
You don't need to remove -l from newrole; you can just constrain its use via DAC and via SELinux policy, as Klaus has previously suggested.
Signature · 8 lines
Stephen Smalley National Security Agency -- 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.
Quoted 11 lines · Stephen Smalley
Quoted 9 lines · Daniel J Walsh
So one proposed solution to this is to take away the newrole -l functionality all together and to add Sensitivity selection to the local login.
We can implement
pam_selinuxto ask for the sensitivity levelusername: dwalsh
passwd: ********
Sensitivity: SystemLow
Quoted 7 lines
Quoted 2 lines
If we then remove -l from newrole we are done?
pam_selinuxused to have support to let the user pick from the list of reachable contexts for the user. So you could just restore that support.
I don't think so. This allowed you to select your TE role, not your Sensitivity. The problem is selecting your sensivity. Since there is an large number of sensitivities a user can log in as he will need to key it in.
Quoted 5 lines
That doesn't address sshd though. Or gdm. sshd shouldn't be too difficult. There were some externally developed gdm patches for selinux that enabled context selection long ago, but nothing recent (pre-Fedora).
I though the sshd would happen automatically when you login via a secure channel. IE If I connect at TopSecret, I get TopSecret.
I think gdm will require other features such that I launch terminals at different sensitivity levels???
I think we should separate the TE Context selection from the Sensitivity Selection, in order to satisfy the MLS problems.
Quoted 4 lines
You don't need to remove -l from newrole; you can just constrain its use via DAC and via SELinux policy, as Klaus has previously suggested.
So it will not work on ptys? Or are you thinking a boolean? I think it will be strange for a user to have the app work differently depending on how they logged in, but I guess this is another short coming of MLS.
--
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.
Quoted 9 lines · Daniel J Walsh
Quoted 4 lines · Stephen Smalley
pam_selinuxused to have support to let the user pick from the list of reachable contexts for the user. So you could just restore that support.I don't think so. This allowed you to select your TE role, not your Sensitivity. The problem is selecting your sensivity. Since there is an large number of sensitivities a user can log in as he will need to key it in.
Ah, I was thinking of the old MLS implementation, pre-TCS. Fair point.
Quoted 7 lines
Quoted 5 lines
That doesn't address sshd though. Or gdm. sshd shouldn't be too difficult. There were some externally developed gdm patches for selinux that enabled context selection long ago, but nothing recent (pre-Fedora).
I though the sshd would happen automatically when you login via a secure channel. IE If I connect at TopSecret, I get TopSecret.
Only if running it via the modified xinetd and only if using labeled networking. Otherwise, you still need a way for users to select a level for their session.
Quoted 2 lines
I think gdm will require other features such that I launch terminals at different sensitivity levels???
Well, doing that right requires security enhanced X, a modified window manager, and a trusted path, so that won't be happening today.
Quoted 2 lines
I think we should separate the TE Context selection from the Sensitivity Selection, in order to satisfy the MLS problems.
Ok.
Quoted 7 lines
Quoted 4 lines
You don't need to remove -l from newrole; you can just constrain its use via DAC and via SELinux policy, as Klaus has previously suggested.
So it will not work on ptys? Or are you thinking a boolean? I think it will be strange for a user to have the app work differently depending on how they logged in, but I guess this is another short coming of MLS.
It would be restricted via DAC mode and possibly a boolean in policy, such that an admin could allow use of it if desired. Only the LSPP config would need to lock it down.
Signature · 8 lines
Stephen Smalley National Security Agency -- 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.
Quoted 4 lines · --- Daniel J Walsh
... Since there is
an large number of sensitivities a user can log in as he will need to
key it in.
Existing systems allow the user a default MLS
value that is used (on a terminal) if none is
specified (e.g. just hit ENTER at the label
prompt).
Quoted 4 lines
I though the sshd would happen automatically when you login via a secure
channel. IE If I connect at TopSecret, I get TopSecret.
This is the usual behavior, but we're talking
about real deployments here, so there will
always be someone who wants (and is unwilling
to use/buy a system that won't allow her) to
long in at multiple labels across a single
level network. For your system to be popular
you need to provide the facility. Just consider
the admin who wants to log in at SystemHigh
to fix the broken network.
Quoted 9 lines
I think gdm will require other features such that I launch terminals at
different sensitivity levels???I think we should separate the TE Context selection from the Sensitivity
Selection, in order to satisfy the MLS problems.From the standpoint of someone who likes MLS
better than TE, I agree, but from the standpoint
of someone who hates to see mixed metaphores
I disagree.
Quoted 6 lines
So it will not work on ptys? Or are you thinking a boolean? I think it
will be strange for a user to have the app work differently depending on
how they logged in, but I guess this is another short coming of MLS.
I don't get how this is a shortcoming of MLS.
Casey Schaufler
[email protected]
--
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.
Quoted 3 lines · Stephen Smalley
pam_selinuxused to have support to let the user pick from the list of reachable contexts for the user. So you could just restore that support.
So, in summary of the discussion, having pam_selinux let the user pick
the TE and Sensitivity separately (much as it does now if get_ordered_context_list_with_level() fails) is the valid approach?
Quoted 2 lines
That doesn't address sshd though. Or gdm. sshd shouldn't be too difficult.
Combined with adding similar code to sshd.
Quoted 3 lines
There were some externally developed gdm patches for selinux
that enabled context selection long ago, but nothing recent (pre-Fedora).
But, from the "gdm/trsuted-X needs lots more work" discussion, gdm
should just stay with the default Sensitivity and people can use a terminal+ssh to change levels?
Signature · 1 line
James Antill <[email protected]>
Quoted 7 lines · --- James Antill
Quoted 1 line · Stephen Smalley
pam_selinuxused to have support to let the userpick from the list of
Quoted 1 line
reachable contexts for the user. So you could
just restore that
Quoted 8 lines
Quoted 1 line
support.
So, in summary of the discussion, having
pam_selinuxlet the user pick
the TE and Sensitivity separately (much as it does now ifget_ordered_context_list_with_level()fails) is the valid approach?
On Trix you can specify the MAC and Capabilities
this way, so it seems you ought to be able to
specify Sensitivity and TE on SELinux.
Quoted 5 lines
Quoted 1 line
That doesn't address sshd though. Or gdm. sshd
shouldn't be too
Quoted 1 line
difficult.
Combined with adding similar code to sshd.
Just a heads up, you want to do this, but
you may not be able to get an evaluation team
to allow it in an evaluated configuration.
Quoted 11 lines
Quoted 1 line
There were some externally developed gdm patches
for selinux
Quoted 1 line
that enabled context selection long ago, but
nothing recent
Quoted 1 line
(pre-Fedora).
But, from the "gdm/trsuted-X needs lots more work"
discussion, gdm
should just stay with the default Sensitivity and people can use a
terminal+ssh to change levels?
The MLS-ignorant Xserver should not be able to
communicate with clients run with a different MLS
value, but this trick ought to work, providing
further assurance that allowing the option to
specific MLS value when you login (ssh) over a
network connection won't get past the evaluators.
Plus, it will only work for terminals, not
for launching X clients.
Casey Schaufler
[email protected]
--
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.
Quoted 7 lines · Casey Schaufler
Quoted 4 lines · --- James Antill
Quoted 1 line · Stephen Smalley
That doesn't address sshd though. Or gdm. sshd
Quoted 8 lines
Quoted 3 lines
shouldn't be too difficult.
Combined with adding similar code to sshd.
Just a heads up, you want to do this, but
you may not be able to get an evaluation team
to allow it in an evaluated configuration.
Okay, I'm curious so I'll bite - why not, what problems would you expect?
Signature · 7 lines
paul moore linux security @ hp -- 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.
Quoted 13 lines · --- Paul Moore
Quoted 12 lines · Casey Schaufler
Quoted 7 lines · --- James Antill
Quoted 1 line · Stephen Smalley
That doesn't address sshd though. Or gdm. sshd
shouldn't be too difficult.
Combined with adding similar code to sshd.
Quoted 6 lines
Quoted 3 lines
Just a heads up, you want to do this, but
you may not be able to get an evaluation team
to allow it in an evaluated configuration.Okay, I'm curious so I'll bite - why not, what
problems would you expect?
I'm talking strictly from an MLS viewpoint here, mind you. If y'all are using TE as a security mechanism in your evaluation you'll have to deal with that as well. Anywho ...
If you are treating your network as a single level device and allow logins (e.g. via ssh) at labels other than that configured to the device you are violating the MLS policy on the device. A TopSecret login on a device configured to be Confidential can not be permitted because TopSecret information, such as the command prompt, cannot be sent to the Confidential device.
If you are treating the network as a multi level device the communications will take place at a label passed along with (or beside) the packets. Changing the label of the process will prevent it from going out through the established connection. If you could, you'd be able to pass TopSecret information in packets marked Confidential, again a Bad Thing.
If you are treating each packet as a labeled entity and the network environment irrelivent and you don't change how the packets are labeled when you change the process label you are not properly labeling them. If you do change the labeling of the packets and let them through anyway you're not enforcing MLS policy.
You can treat the network as a device, an import/ export mechanism, or an internal communication mechanism but you can't get away from the fact that when a process changes its MLS properties it can't use the communication channels it was using with the old properties. Unless the communication channels don't enforce policy, in which case your system isn't enforcing MLS policy everywhere required.
I understand that this is not the case with TE. I am very curious how domain transitions are going to play out in an evaluation. The process should be educational.
Casey Schaufler
[email protected]
--
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.
Quoted 8 lines · James Antill
Quoted 3 lines · Stephen Smalley
pam_selinuxused to have support to let the user pick from the list of reachable contexts for the user. So you could just restore that support.So, in summary of the discussion, having
pam_selinuxlet the user pick
the TE and Sensitivity separately (much as it does now ifget_ordered_context_list_with_level()fails) is the valid approach?
Ok, I've done a patch to PAM which which adds a config_role option to
the pam_selinux module ... which if turned on takes the users default context and allows them to change the role and/or level (if mls is enabled). Entering a blank line sticks with the default.
It's available from:
http://people.redhat.com/jantill/pam-config_role/
...the rpms there have been built on FC5.
Signature · 4 lines
James Antill - <[email protected]> setsockopt(fd, IPPROTO_TCP, TCP_CONGESTION, ...); setsockopt(fd, IPPROTO_TCP, TCP_DEFER_ACCEPT, ...); setsockopt(fd, SOL_SOCKET, SO_ATTACH_FILTER, ...);
Quoted 15 lines · James Antill
Quoted 8 lines · James Antill
Quoted 3 lines · Stephen Smalley
pam_selinuxused to have support to let the user pick from the list of reachable contexts for the user. So you could just restore that support.So, in summary of the discussion, having
pam_selinuxlet the user pick
the TE and Sensitivity separately (much as it does now ifget_ordered_context_list_with_level()fails) is the valid approach?Ok, I've done a patch to PAM which which adds a
config_roleoption to
thepam_selinuxmodule ... which if turned on takes the users default context and allows them to change the role and/or level (if mls is enabled). Entering a blank line sticks with the default.
Quoted 6 lines
It's available from:
http://people.redhat.com/jantill/pam-config_role/
...the rpms there have been built on FC5.
Thanks, James. I got it built on a ppc64 victim. Hopefully Klaus can take a quick look to see if it will work for the cert.
Signature · 7 lines
George Wilson <[email protected]> IBM Linux Technology Center -- 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.
Quoted 15 lines · James Antill
Quoted 8 lines · James Antill
Quoted 3 lines · Stephen Smalley
pam_selinuxused to have support to let the user pick from the list of reachable contexts for the user. So you could just restore that support.So, in summary of the discussion, having
pam_selinuxlet the user pick
the TE and Sensitivity separately (much as it does now ifget_ordered_context_list_with_level()fails) is the valid approach?Ok, I've done a patch to PAM which which adds a
config_roleoption to
thepam_selinuxmodule ... which if turned on takes the users default context and allows them to change the role and/or level (if mls is enabled). Entering a blank line sticks with the default.
Quoted 5 lines
It's available from:
http://people.redhat.com/jantill/pam-config_role/
...the rpms there have been built on FC5.
Doesn't this provide a way of bypassing the per-Linux-user level restrictions defined by the seusers mapping (vs. per-SELinux-user)?
Signature · 8 lines
Stephen Smalley National Security Agency -- 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.
Quoted 16 lines · Stephen Smalley
Quoted 15 lines · James Antill
Quoted 8 lines · James Antill
Quoted 3 lines · Stephen Smalley
pam_selinuxused to have support to let the user pick from the list of reachable contexts for the user. So you could just restore that support.So, in summary of the discussion, having
pam_selinuxlet the user pick
the TE and Sensitivity separately (much as it does now ifget_ordered_context_list_with_level()fails) is the valid approach?Ok, I've done a patch to PAM which which adds a
config_roleoption to
thepam_selinuxmodule ... which if turned on takes the users default context and allows them to change the role and/or level (if mls is enabled). Entering a blank line sticks with the default.
Quoted 8 lines
Quoted 5 lines
It's available from:
http://people.redhat.com/jantill/pam-config_role/
...the rpms there have been built on FC5.
Doesn't this provide a way of bypassing the per-Linux-user level restrictions defined by the seusers mapping (vs. per-SELinux-user)?
To elaborate, as I understood it, seusers (managed via semanage login) was to provide per-Linux-user authorizations for MLS/MCS ranges, while multiple such Linux users might be mapped to a single SELinux user that was authorized for the full system range. The login-style programs would then ensure that the range in the initial security context for the Linux user's session was limited by the value defined in seusers, and SELinux policy would subsequently ensure that processes in that session can not escalate outside of that range via newrole -l (or other mechanism).
It isn't sufficient to check the validity of the context with the user-supplied level, because from the kernel's POV, any level might be authorized for the underlying SELinux user identity, whereas seusers might have defined a more restricted range for the Linux user identity. You need a check between the user-supplied level and the seusers-defined value (more generally, this could be an avc_has_perm or security_compute_av check between contexts containing those levels, and the underlying policy could define a mlsconstrain on the corresponding permission).
Signature · 8 lines
Stephen Smalley National Security Agency -- 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.
Quoted 9 lines · Stephen Smalley
To elaborate, as I understood it, seusers (managed via semanage login) was to provide per-Linux-user authorizations for MLS/MCS ranges, while multiple such Linux users might be mapped to a single SELinux user that was authorized for the full system range. The login-style programs would then ensure that the range in the initial security context for the Linux user's session was limited by the value defined in seusers, and SELinux policy would subsequently ensure that processes in that session can not escalate outside of that range via newrole -l (or other mechanism).
My understanding is that while security_check_context() allows it, thesetexeccon() will fail. Which seemed to be good enough.
Quoted 9 lines
It isn't sufficient to check the validity of the context with the user-supplied level, because from the kernel's POV, any level might be authorized for the underlying SELinux user identity, whereas seusers might have defined a more restricted range for the Linux user identity. You need a check between the user-supplied level and the seusers-defined value (more generally, this could be an
avc_has_permorsecurity_compute_avcheck between contexts containing those levels, and the underlying policy could define a mlsconstrain on the corresponding permission).
Signature · 4 lines
James Antill - <[email protected]> setsockopt(fd, IPPROTO_TCP, TCP_CONGESTION, ...); setsockopt(fd, IPPROTO_TCP, TCP_DEFER_ACCEPT, ...); setsockopt(fd, SOL_SOCKET, SO_ATTACH_FILTER, ...);
Quoted 12 lines · James Antill
Quoted 9 lines · Stephen Smalley
To elaborate, as I understood it, seusers (managed via semanage login) was to provide per-Linux-user authorizations for MLS/MCS ranges, while multiple such Linux users might be mapped to a single SELinux user that was authorized for the full system range. The login-style programs would then ensure that the range in the initial security context for the Linux user's session was limited by the value defined in seusers, and SELinux policy would subsequently ensure that processes in that session can not escalate outside of that range via newrole -l (or other mechanism).
Quoted 2 lines
My understanding is that while
security_check_context()allows it, thesetexeccon()will fail. Which seemed to be good enough.
No, it won't. Suppose that I have two Linux users A and B, with A authorized for category c0 and B authorized for category c2 in seusers, but both A and B are mapped to SELinux user U who is authorized for all categories in the kernel policy. The login-style programs are naturally going to be authorized to transition to any of those contexts since they have to deal with user logins at any level, so the setexeccon() will succeed. The SELinux security context will have U as the user identity, so it will always be valid. You need an explicit check.
Quoted 11 lines
Quoted 10 lines
It isn't sufficient to check the validity of the context with the user-supplied level, because from the kernel's POV, any level might be authorized for the underlying SELinux user identity, whereas seusers might have defined a more restricted range for the Linux user identity. You need a check between the user-supplied level and the seusers-defined value (more generally, this could be an
avc_has_permorsecurity_compute_avcheck between contexts containing those levels, and the underlying policy could define a mlsconstrain on the corresponding permission).
Signature · 8 lines
Stephen Smalley National Security Agency -- 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.
Quoted 4 lines · Stephen Smalley
Quoted 2 lines · James Antill
My understanding is that while
security_check_context()allows it, thesetexeccon()will fail. Which seemed to be good enough.
Quoted 8 lines
No, it won't. Suppose that I have two Linux users A and B, with A authorized for category c0 and B authorized for category c2 in seusers, but both A and B are mapped to SELinux user U who is authorized for all categories in the kernel policy. The login-style programs are naturally going to be authorized to transition to any of those contexts since they have to deal with user logins at any level, so the
setexeccon()will succeed. The SELinux security context will have U as the user identity, so it will always be valid. You need an explicit check.
Ok, I had assumed that "U" would always be different in this case. I
think this update to the patch solves the problem ... it gets the list of valid roles/levels from get_ordered_context_list() (which I think is complete, but I'm not 100%) and compares what is entered against that.
I'm not 100% sure this is right (it means there would be huge lists
returned for MCS, no?), but I don't see what else I can call that would validate the role/level-range for a specific login.
Signature · 4 lines
James Antill - <[email protected]> setsockopt(fd, IPPROTO_TCP, TCP_CONGESTION, ...); setsockopt(fd, IPPROTO_TCP, TCP_DEFER_ACCEPT, ...); setsockopt(fd, SOL_SOCKET, SO_ATTACH_FILTER, ...);
Quoted 14 lines · James Antill
Quoted 4 lines · Stephen Smalley
Quoted 2 lines · James Antill
My understanding is that while
security_check_context()allows it, thesetexeccon()will fail. Which seemed to be good enough.Quoted 8 lines
No, it won't. Suppose that I have two Linux users A and B, with A authorized for category c0 and B authorized for category c2 in seusers, but both A and B are mapped to SELinux user U who is authorized for all categories in the kernel policy. The login-style programs are naturally going to be authorized to transition to any of those contexts since they have to deal with user logins at any level, so the
setexeccon()will succeed. The SELinux security context will have U as the user identity, so it will always be valid. You need an explicit check.
Quoted 7 lines
Ok, I had assumed that "U" would always be different in this case. I
think this update to the patch solves the problem ... it gets the list of valid roles/levels fromget_ordered_context_list()(which I think is complete, but I'm not 100%) and compares what is entered against that.
I'm not 100% sure this is right (it means there would be huge lists
returned for MCS, no?), but I don't see what else I can call that would validate the role/level-range for a specific login.
Sorry, no (at least based on that description - didn't receive the patch itself). get_ordered_context_list() et al are still interfaces based on SELinux user identity. What you need to do is to validate the user-supplied level against the range returned by getseuserbyname(), and the particular check needs to see whether the level is within the user's authorized range. Which gets into policy specifics, which is why I suggested using a permission check via avc_has_perm or security_compute_av, and letting policy define a mlsconstrain on it.
Signature · 8 lines
Stephen Smalley National Security Agency -- 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.
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 3 lines · Stephen Smalley
Look at Darrel's patch for mcstransd to apply a permission check between the level of the caller and the level being translated for context translations.
Thanks to much discussion with Dan and Stephen, I'm pretty sure I have
this correct now.
Here is the libselinux part of the patch (reference policy and PAM are
next).
Signature · 4 lines
James Antill - <[email protected]> setsockopt(fd, IPPROTO_TCP, TCP_CONGESTION, ...); setsockopt(fd, IPPROTO_TCP, TCP_DEFER_ACCEPT, ...); setsockopt(fd, SOL_SOCKET, SO_ATTACH_FILTER, ...);
include/selinux/av_permissions.h +1 -0
@@ -896,3 +896,4 @@#define KEY__SETATTR 0x00000020UL#define KEY__CREATE 0x00000040UL#define CONTEXT__TRANSLATE 0x00000001UL +#define CONTEXT__TRANSITION 0x00000002UL
src/av_perm_to_string.h +1 -0
@@ -266,3 +266,4 @@ S_(SECCLASS_KEY, KEY__SETATTR, "setattr") S_(SECCLASS_KEY, KEY__CREATE, "create") S_(SECCLASS_CONTEXT, CONTEXT__TRANSLATE, "translate") +S_ (SECCLASS_CONTEXT ,CONTEXT__TRANSITION ,"transition" )
Quoted 8 lines · James Antill
Quoted 3 lines · Stephen Smalley
Look at Darrel's patch for mcstransd to apply a permission check between the level of the caller and the level being translated for context translations.
Thanks to much discussion with Dan and Stephen, I'm pretty sure I have
this correct now.
Here is the reference policy part of the patches (libselinux came
previously and PAM is next).
Signature · 4 lines
James Antill - <[email protected]> setsockopt(fd, IPPROTO_TCP, TCP_CONGESTION, ...); setsockopt(fd, IPPROTO_TCP, TCP_DEFER_ACCEPT, ...); setsockopt(fd, SOL_SOCKET, SO_ATTACH_FILTER, ...);
flask/access_vectors +1 -0
@@ -635,4 +635,5 @@ class context { translate + transition }
modules/system/authlogin.if +3 -0
@@ -278,6 +278,9 @@ allow $2 $1:fd use; allow $2 $1:fifo_file rw_file_perms; allow $2 $1:process sigchld; + + # Check MLS Range + allow $1 domain:context transition; ') ########################################
mls +3 -0
@@ -596,4 +596,7 @@ mlsconstrain context translate (( h1 dom h2 ) or ( t1 == mlstranslate )); +mlsconstrain context transition + ( h1 dom h2 ); + ') dnl end enable_mls
Quoted 9 lines · James Antill
Quoted 8 lines · James Antill
Quoted 3 lines · Stephen Smalley
Look at Darrel's patch for mcstransd to apply a permission check between the level of the caller and the level being translated for context translations.
Thanks to much discussion with Dan and Stephen, I'm pretty sure I have
this correct now.
Here is the PAM part of the patches (libselinux and reference policy
came previously). This requires the libselinux changes.
Signature · 1 line
James Antill <[email protected]>
modules/pam_selinux/pam_selinux.8.xml +14 -0
@@ -36,6 +36,9 @@ <arg choice="opt"> verbose </arg> + <arg choice="opt"> + config_role + </arg> </cmdsynopsis> </refsynopsisdiv>
@@ -121,6 +124,17 @@ </para> </listitem> </varlistentry> + <varlistentry> + <term> + <option>config_role</option> + </term> + <listitem> + <para> + attempt to ask the user for a custom security context role (and + level, if MLS is on). + </para> + </listitem> + </varlistentry> </variablelist> </refsect1>
Only in Linux-PAM-0.99.6.2/modules/pam_selinux: pam_selinux.8.xml.config_role
modules/pam_selinux/pam_selinux.c +119 -10
217 lines not on this page · raw message
Only in Linux-PAM-0.99.6.2/modules/pam_selinux: pam_selinux.c.config_role
Quoted 7 lines · James Antill
Quoted 6 lines · James Antill
Quoted 3 lines · Stephen Smalley
Look at Darrel's patch for mcstransd to apply a permission check between the level of the caller and the level being translated for context translations.
Quoted 6 lines
Quoted 2 lines
Thanks to much discussion with Dan and Stephen, I'm pretty sure I have
this correct now.Here is the reference policy part of the patches (libselinux came
previously and PAM is next).
In addition to the permission name, I'd have expected the rule (and the check in the code) to always use the same type in both contexts, so the rules could just be:
allow $1 self:context <permissionname>;
Not allow $1 domain:context, which will yield many more rules without any real justification.
Signature · 8 lines
Stephen Smalley National Security Agency -- 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.
Quoted 15 lines · Stephen Smalley
Quoted 7 lines · James Antill
Quoted 6 lines · James Antill
Quoted 3 lines · Stephen Smalley
Look at Darrel's patch for mcstransd to apply a permission check between the level of the caller and the level being translated for context translations.
Quoted 6 lines
Quoted 2 lines
Thanks to much discussion with Dan and Stephen, I'm pretty sure I have
this correct now.Here is the reference policy part of the patches (libselinux came
previously and PAM is next).
Quoted 7 lines
In addition to the permission name, I'd have expected the rule (and the check in the code) to always use the same type in both contexts, so the rules could just be:
allow $1 self:context <permissionname>;Not allow $1 domain:context, which will yield many more rules without any real justification.
I'm also unclear as to what you are checking - you seem to be putting this in authlogin, but I had expected this to be a check between two user contexts, identical in all respects except for the MLS ranges (one from seusers, one from the user-supplied input).
Signature · 8 lines
Stephen Smalley National Security Agency -- 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.
Quoted 9 lines · Stephen Smalley
Quoted 8 lines · Stephen Smalley
In addition to the permission name, I'd have expected the rule (and the check in the code) to always use the same type in both contexts, so the rules could just be:
allow $1 self:context <permissionname>;Not allow $1 domain:context, which will yield many more rules without any real justification.
Ok, I can fix that to be just self:context.
Quoted 4 lines
I'm also unclear as to what you are checking - you seem to be putting this in authlogin, but I had expected this to be a check between two user contexts, identical in all respects except for the MLS ranges (one from seusers, one from the user-supplied input).
AIUI the code in authlogin allows all of the login type programs (like
getty) to call the check. The check being performed is in policy/mls and is just:
mlsconstrain context transition
( h1 dom h2 );
...have I misunderstood this?
Signature · 1 line
James Antill <[email protected]>
Quoted 18 lines · James Antill
Quoted 9 lines · Stephen Smalley
Quoted 8 lines · Stephen Smalley
In addition to the permission name, I'd have expected the rule (and the check in the code) to always use the same type in both contexts, so the rules could just be:
allow $1 self:context <permissionname>;Not allow $1 domain:context, which will yield many more rules without any real justification.
Ok, I can fix that to be just self:context.
Quoted 4 lines
I'm also unclear as to what you are checking - you seem to be putting this in authlogin, but I had expected this to be a check between two user contexts, identical in all respects except for the MLS ranges (one from seusers, one from the user-supplied input).
Quoted 8 lines
AIUI the code in authlogin allows all of the login type programs (like
getty) to call the check. The check being performed is in policy/mls and is just:mlsconstrain context transition
( h1 dom h2 );...have I misunderstood this?
As I understood it (and the code in pam seems to match this), you were going to generate two security contexts for the user session, one based on seusers and one based on the provided range, otherwise identical in all respects, and apply a permission check between those two contexts. So for example, if my seusers-defined default context would be staff_u:staff_r:staff_t:s0-s0:c0.c255 and I entered a level of s0:c3 as input, there would be a permission check made by pam_selinux between staff_u:staff_r:staff_t:s0-s0:c0.c255 and staff_u:staff_r:staff_t:s0:c3. Thus, the TE rule would have to be between staff_t and itself (i.e. the user domains), not between local_login_t and anything.
We aren't checking whether login can do anything (or using its context anywhere); we are checking whether the seusers-defined default context for the user contains the user-supplied context.
Signature · 8 lines
Stephen Smalley National Security Agency -- 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.
Quoted 8 lines · Stephen Smalley
As I understood it (and the code in pam seems to match this), you were going to generate two security contexts for the user session, one based on seusers and one based on the provided range, otherwise identical in all respects, and apply a permission check between those two contexts. So for example, if my seusers-defined default context would be staff_u:staff_r:staff_t:s0-s0:c0.c255 and I entered a level of s0:c3 as input, there would be a permission check made by
pam_selinuxbetween staff_u:staff_r:staff_t:s0-s0:c0.c255 and staff_u:staff_r:staff_t:s0:c3.
This should all be true.
Quoted 2 lines
Thus, the TE rule would have to be between
staff_tand itself (i.e. the user domains), not betweenlocal_login_tand anything.
Right. Does the mlsconstrain line not do that?
Quoted 3 lines
We aren't checking whether login can do anything (or using its context anywhere); we are checking whether the seusers-defined default context for the user contains the user-supplied context.
Right my understanding was that the policy line:
allow $1 domain:context transition
...meant that the login program could make security call:
security_compute_av(src, dst, SECCLASS_CONTEXT, CONTEXT__TRANSITION, &avd)
Signature · 1 line
James Antill <[email protected]>
Quoted 11 lines · James Antill
Quoted 8 lines · Stephen Smalley
As I understood it (and the code in pam seems to match this), you were going to generate two security contexts for the user session, one based on seusers and one based on the provided range, otherwise identical in all respects, and apply a permission check between those two contexts. So for example, if my seusers-defined default context would be staff_u:staff_r:staff_t:s0-s0:c0.c255 and I entered a level of s0:c3 as input, there would be a permission check made by
pam_selinuxbetween staff_u:staff_r:staff_t:s0-s0:c0.c255 and staff_u:staff_r:staff_t:s0:c3.
Quoted 6 lines
This should all be true.
Quoted 2 lines
Thus, the TE rule would have to be between
staff_tand itself (i.e. the user domains), not betweenlocal_login_tand anything.Right. Does the mlsconstrain line not do that?
The mlsconstrain line wasn't my concern - it was the TE rule.
Quoted 11 lines
Quoted 3 lines
We aren't checking whether login can do anything (or using its context anywhere); we are checking whether the seusers-defined default context for the user contains the user-supplied context.
Right my understanding was that the policy line:
allow $1 domain:context transition
...meant that the login program could make security call:
security_compute_av(src, dst, SECCLASS_CONTEXT, CONTEXT__TRANSITION, &avd)
No. The ability to make the security call is controlled by the compute_av permission on the security class, and isn't based on the individual contexts passed as arguments. That would be:
allow $1 security_t:security compute_av;
which has an interface:
selinux_compute_access_vector($1)
which is already in authlogin.if. No change required for allowing the call to happen.
What you are instead trying to do is to define the _result_ of that compute_av call based on its arguments, not whether it can be made by login. So the TE rule would go into userdomain.if and be of the form:
allow $1 self:context <permissionname>;
The mlsconstrain statement is ok, as long as it is sufficient to check the high levels and not impose any constraint on the low levels.
Signature · 8 lines
Stephen Smalley National Security Agency -- 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.
Quoted 9 lines · Stephen Smalley
No. The ability to make the security call is controlled by the
compute_avpermission on the security class, and isn't based on the individual contexts passed as arguments. That would be:allow $1 security_t:security compute_av;which has an interface:
selinux_compute_access_vector($1)
which is already in authlogin.if. No change required for allowing the call to happen.
Quoted 4 lines
What you are instead trying to do is to define the _result_ of that
compute_avcall based on its arguments, not whether it can be made by login. So the TE rule would go into userdomain.if and be of the form:allow $1 self:context <permissionname>;
Ok, I think I have it now. Both patches are at (with the renamed
permission):
http://people.redhat.com/jantill/pam-config_role/upstream/
Signature · 4 lines
James Antill - <[email protected]> setsockopt(fd, IPPROTO_TCP, TCP_CONGESTION, ...); setsockopt(fd, IPPROTO_TCP, TCP_DEFER_ACCEPT, ...); setsockopt(fd, SOL_SOCKET, SO_ATTACH_FILTER, ...);
flask/access_vectors +1 -0
@@ -635,4 +635,5 @@ class context { translate + contains }
modules/system/userdomain.if +2 -0
@@ -51,6 +51,8 @@ allow $1_t self:msg { send receive }; dontaudit $1_t self:socket create; + allow $1_t self:context contains; + allow $1_t $1_devpts_t:chr_file { setattr ioctl read getattr lock write append }; term_create_pty($1_t,$1_devpts_t)
mls +3 -0
@@ -596,4 +596,7 @@ mlsconstrain context translate (( h1 dom h2 ) or ( t1 == mlstranslate )); +mlsconstrain context contains + ( h1 dom h2 ); + ') dnl end enable_mls
include/selinux/av_permissions.h +1 -0
@@ -896,3 +896,4 @@#define KEY__SETATTR 0x00000020UL#define KEY__CREATE 0x00000040UL#define CONTEXT__TRANSLATE 0x00000001UL +#define CONTEXT__CONTAINS 0x00000002UL
src/av_perm_to_string.h +1 -0
@@ -266,3 +266,4 @@ S_(SECCLASS_KEY, KEY__SETATTR, "setattr") S_(SECCLASS_KEY, KEY__CREATE, "create") S_(SECCLASS_CONTEXT, CONTEXT__TRANSLATE, "translate") +S_ (SECCLASS_CONTEXT ,CONTEXT__CONTAINS ,"contains" )
Quoted 16 lines · James Antill
Quoted 9 lines · Stephen Smalley
No. The ability to make the security call is controlled by the
compute_avpermission on the security class, and isn't based on the individual contexts passed as arguments. That would be:allow $1 security_t:security compute_av;which has an interface:
selinux_compute_access_vector($1)
which is already in authlogin.if. No change required for allowing the call to happen.Quoted 4 lines
What you are instead trying to do is to define the _result_ of that
compute_avcall based on its arguments, not whether it can be made by login. So the TE rule would go into userdomain.if and be of the form:allow $1 self:context <permissionname>;
Quoted 4 lines
Ok, I think I have it now. Both patches are at (with the renamed
permission):
They look sane to me. Please post them in separate messages, preferably inline, and cc Chris PeBenito on the policy patch.
Signature · 8 lines
Stephen Smalley National Security Agency -- 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.
We still have a problem on MLS machines, in that newrole can be used to pass data via pseudo terminals.
script
newrole -l SystemHigh
cat TopSecret.doc
^d
^d
cat typescript
I propose we add this patch to newrole to check if we are on a pseudo terminal and then fail if user is using -l.
Basically this patch checks the major number of the stdin, stdout, stderr for a number in the pseudo number range, If yes the pseudo terminal, if not continue. Not pretty but it solves the problem. I could not figure out another way to check if you are on a pseudo terminal.
Comments?
newrole/newrole.c 2007-01-04 16:24:47.000000000 -0500 renamed from newrole/newrole.c 2006-11-29 17:11:18.000000000 -0500 +0 -0
@@ -67,6 +67,7 @@
#include <selinux/get_context_list.h> /* for SELINUX_DEFAULTUSER */ #include <signal.h>
#include <unistd.h> /* for getuid(), exit(), getopt() */
+#include <sys/stat.h>
#ifdef USE_AUDIT
#include <libaudit.h>
#endif
@@ -93,6 +94,19 @@
extern char **environ;
+static int check_isapty(int fd) {
+ struct stat buf;
+ if ((isatty(fd)) && (fstat(fd, &buf) == 0)) {
+ int dev=major(buf.st_rdev);
+ if (dev > 135 && dev < 144) {
+ return 1;
+ } else {
+ return 0;
+ }
+ }
+ return 0;
+}
+ /**
* Construct from the current range and specified desired level a resulting
* range. If the specified level is a range, return that. If it is not,
then
@@ -733,6 +747,7 @@
security_context_t *new_context, int *preserve_environment)
{
+ int i; /* index for open file descriptors */
int flag_index; /* flag index in argv[] */
int clflag; /* holds codes for command line flags */
char *role_s = NULL; /* role spec'd by user in argv[] */
@@ -793,6 +808,13 @@
"specified\n"));
return -1;
}+ for (i=0; i < 3; i++) {
+ if (check_isapty(i)) {
+ fprintf(stderr, "Error: you are not allowed to change levels on pseudo terminals\n");
+ return -1;
+ }
+ }
+
level_s = optarg;
break;
default:--
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.
Quoted 36 lines · Daniel J Walsh
We still have a problem on MLS machines, in that newrole can be used to pass data via pseudo terminals.
script
newrole -l SystemHigh
cat TopSecret.doc
^d
^d
cat typescriptI propose we add this patch to newrole to check if we are on a pseudo terminal and then fail if user is using -l.
Basically this patch checks the major number of the stdin, stdout, stderr for a number in the pseudo number range, If yes the pseudo terminal, if not continue. Not pretty but it solves the problem. I could not figure out another way to check if you are on a pseudo terminal. Comments?
diff --exclude-from=exclude --exclude POTFILES.in --exclude='*.po' --exclude='*.pot' -N -u -r
nsapolicycoreutils/newrole/newrole.cpolicycoreutils-1.33.7/newrole/newrole.c
---nsapolicycoreutils/newrole/newrole.c2006-11-29
17:11:18.000000000 -0500
+++policycoreutils-1.33.7/newrole/newrole.c2007-01-04
16:24:47.000000000 -0500(quoted diff) +1
-0@@ -67,6 +67,7 @@ #include <selinux/get_context_list.h> /* for SELINUX_DEFAULTUSER */ #include <signal.h> #include <unistd.h> /* for getuid(), exit(), getopt() */ +#include <sys/stat.h> #ifdef USE_AUDIT #include <libaudit.h> #endif
Review line 101
Quoted 8 lines
(quoted diff) +5
-0@@ -93,6 +94,19 @@ extern char **environ; +static int check_isapty(int fd) { + struct stat buf; + if ((isatty(fd)) && (fstat(fd, &buf) == 0)) { + int dev=major(buf.st_rdev); + if (dev > 135 && dev < 144) {
Where do these numbers come from? Is UNIX98_PTY_SLAVE_MAJOR in /usr/include/linux/major.h useful? That's what the value is on my system. There's also PTY_SLAVE_MAJOR (value of 3) in that file, but on my system that's the major for real ttys.
Quoted 33 lines
(quoted diff) +8
-0+ return 1; + } else { + return 0; + } + } + return 0; +} + /** * Construct from the current range and specified desired level a resulting * range. If the specified level is a range, return that. If it is not,then
(quoted diff) +8
-0@@ -733,6 +747,7 @@ security_context_t *new_context, int *preserve_environment) { + int i; /* index for open file descriptors */ int flag_index; /* flag index in argv[] */ int clflag; /* holds codes for command line flags */ char *role_s = NULL; /* role spec'd by user in argv[] */@@ -793,6 +808,13 @@ "specified\n")); return -1; } + for (i=0; i < 3; i++) { + if (check_isapty(i)) { + fprintf(stderr, "Error: you are not allowed to change levels on pseudo terminals\n"); + return -1; + } + } + level_s = optarg; break;
Quoted 8 lines
default:
Signature · 4 lines
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.
--
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.
Quoted 90 lines · Linda Knippers
Quoted 36 lines · Daniel J Walsh
We still have a problem on MLS machines, in that newrole can be used to pass data via pseudo terminals.
script
newrole -l SystemHigh
cat TopSecret.doc
^d
^d
cat typescriptI propose we add this patch to newrole to check if we are on a pseudo terminal and then fail if user is using -l.
Basically this patch checks the major number of the stdin, stdout, stderr for a number in the pseudo number range, If yes the pseudo terminal, if not continue. Not pretty but it solves the problem. I could not figure out another way to check if you are on a pseudo terminal. Comments?
diff --exclude-from=exclude --exclude POTFILES.in --exclude='*.po' --exclude='*.pot' -N -u -r
nsapolicycoreutils/newrole/newrole.cpolicycoreutils-1.33.7/newrole/newrole.c
---nsapolicycoreutils/newrole/newrole.c2006-11-29
17:11:18.000000000 -0500
+++policycoreutils-1.33.7/newrole/newrole.c2007-01-04
16:24:47.000000000 -0500(quoted diff) +1
-0@@ -67,6 +67,7 @@ #include <selinux/get_context_list.h> /* for SELINUX_DEFAULTUSER */ #include <signal.h> #include <unistd.h> /* for getuid(), exit(), getopt() */ +#include <sys/stat.h> #ifdef USE_AUDIT #include <libaudit.h> #endifReview line 102
Quoted 9 lines
(quoted diff) +5
-0@@ -93,6 +94,19 @@ extern char **environ; +static int check_isapty(int fd) { + struct stat buf; + if ((isatty(fd)) && (fstat(fd, &buf) == 0)) { + int dev=major(buf.st_rdev); + if (dev > 135 && dev < 144) {Where do these numbers come from? Is
UNIX98_PTY_SLAVE_MAJORin/usr/include/linux/major.huseful? That's what the value is on my system. There's alsoPTY_SLAVE_MAJOR(value of 3) in that file, but on my system that's the major for real ttys.Quoted 36 lines
(quoted diff) +8
-0+ return 1; + } else { + return 0; + } + } + return 0; +} + /** * Construct from the current range and specified desired level a resulting * range. If the specified level is a range, return that. If it is not,then
(quoted diff) +8
-0@@ -733,6 +747,7 @@ security_context_t *new_context, int *preserve_environment) { + int i; /* index for open file descriptors */ int flag_index; /* flag index in argv[] */ int clflag; /* holds codes for command line flags */ char *role_s = NULL; /* role spec'd by user in argv[] */@@ -793,6 +808,13 @@ "specified\n")); return -1; } + for (i=0; i < 3; i++) { + if (check_isapty(i)) { + fprintf(stderr, "Error: you are not allowed to change levels on pseudo terminals\n"); + return -1; + } + } + level_s = optarg; break;default:
Quoted 6 lines
Quoted 6 lines
Signature · 4 lines
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.
devices.txt in kernel documentation.
Quoted 4 lines
2176 <http://www.mjmwired.net/kernel/Documentation/devices.txt#2176> 136-143 char Unix98 PTY slaves
2177 <http://www.mjmwired.net/kernel/Documentation/devices.txt#2177> 0 =/dev/pts/0First Unix98 pseudo-TTY
2178 <http://www.mjmwired.net/kernel/Documentation/devices.txt#2178> 1 =/dev/pts/1Second Unix98 pesudo-TTY
2179 <http://www.mjmwired.net/kernel/Documentation/devices.txt#2179> ...
Quoted 8 lines
2180 <http://www.mjmwired.net/kernel/Documentation/devices.txt#2180>
2181 <http://www.mjmwired.net/kernel/Documentation/devices.txt#2181> These device nodes are automatically generated with
2182 <http://www.mjmwired.net/kernel/Documentation/devices.txt#2182> the proper permissions and modes by mounting the
2183 <http://www.mjmwired.net/kernel/Documentation/devices.txt#2183> devpts filesystem onto/dev/ptswith the appropriate
2184 <http://www.mjmwired.net/kernel/Documentation/devices.txt#2184> mount options (distribution dependent, however, on
2185 <http://www.mjmwired.net/kernel/Documentation/devices.txt#2185> *most* distributions the appropriate options are
2186 <http://www.mjmwired.net/kernel/Documentation/devices.txt#2186> "mode=0620,gid=<gid of the "tty" group>".)
2187 <http://www.mjmwired.net/kernel/Documentation/devices.txt#2187>
--
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.
Quoted 2 lines
devices.txt in kernel documentation.
2176 <http://www.mjmwired.net/kernel/Documentation/devices.txt#2176> 136-143 char Unix98 PTY slaves
Since that document has multiple devices with the same major, I wonder if its safer to fstatfs() the fd and make sure the f_type is the devpts fs magic number. It only seems to be defined in fs/devpts/inode.c though.
Quoted 1 line
#define
DEVPTS_SUPER_MAGIC0x1cd1
devpts is mounted on /dev/pts before single user mode so it seems to always be there unless someone unmounts it. If you try to ssh in without /dev/pts mounted the ssh hangs.
-- ljk
--
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.
Quoted 7 lines · Linda Knippers
Quoted 2 lines
devices.txt in kernel documentation.
2176 <http://www.mjmwired.net/kernel/Documentation/devices.txt#2176> 136-143 char Unix98 PTY slavesSince that document has multiple devices with the same major, I wonder if its safer to
fstatfs()the fd and make sure thef_typeis the devpts fs magic number. It only seems to be defined infs/devpts/inode.cthough.
Quoted 5 lines
Quoted 1 line
#define
DEVPTS_SUPER_MAGIC0x1cd1devpts is mounted on
/dev/ptsbefore single user mode so it seems to always be there unless someone unmounts it. If you try to ssh in without/dev/ptsmounted the ssh hangs.
I think blacklists are usually a bad idea for security, for example this breaks if people have a kernel that supports the old-style ptys that don't use devpts. How about turning it around and only allowing use of known good ttys, similar to /etc/securetty, or insisting on type "tty_device_t" which includes the virtual console and serial terminals but not the ptys?
-Klaus
--
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.
Quoted 16 lines · Klaus Weidner
Quoted 7 lines · Linda Knippers
Quoted 2 lines
devices.txt in kernel documentation. 2176 <http://www.mjmwired.net/kernel/Documentation/devices.txt#2176> 136-143 char Unix98 PTY slaves
Since that document has multiple devices with the same major, I wonder if its safer to
fstatfs()the fd and make sure thef_typeis the devpts fs magic number. It only seems to be defined infs/devpts/inode.cthough.Quoted 6 lines
Quoted 2 lines
#define
DEVPTS_SUPER_MAGIC0x1cd1devpts is mounted on
/dev/ptsbefore single user mode so it seems to always be there unless someone unmounts it. If you try to ssh in without/dev/ptsmounted the ssh hangs.
Quoted 7 lines
I think blacklists are usually a bad idea for security, for example this breaks if people have a kernel that supports the old-style ptys that don't use devpts. How about turning it around and only allowing use of known good ttys, similar to
/etc/securetty, or insisting on type "tty_device_t" which includes the virtual console and serial terminals but not the ptys?
Hardcoding types into code makes it inflexible to policy changes, this is a bad idea IMO, the tty whitelist, however, is probably the way to go. I don't know if we should use the existing /etc/securetty or add our own file though.
--
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.
Quoted 4 lines · Joshua Brindle
Hardcoding types into code makes it inflexible to policy changes, this is a bad idea IMO, the tty whitelist, however, is probably the way to go. I don't know if we should use the existing
/etc/securettyor add our own file though.
I'm not sure if the existing /etc/securetty is the right one, since people may make serial terminals available to users but would not want direct root login on those. Well, maybe not terribly likely these days.
Instead of hardcoded types, how about a configurable type or a /etc/securettytypes file that contains the types instead of tty names?
-Klaus
--
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.
Quoted 11 lines
From: Klaus Weidner [mailto:[email protected]]
Quoted 1 line · Joshua Brindle
Hardcoding types into code makes it inflexible to policy
changes, this
Quoted 1 line
is a bad idea IMO, the tty whitelist, however, is probably
the way to
Quoted 1 line
go. I don't know if we should use the existing
/etc/securettyor addQuoted 1 line
our own file though.
Quoted 8 lines
I'm not sure if the existing
/etc/securettyis the right one, since people may make serial terminals available to users but would not want direct root login on those. Well, maybe not terribly likely these days.Instead of hardcoded types, how about a configurable type or a
/etc/securettytypesfile that contains the types instead of tty names?
Sure, the securettycontexts might be the way to go. I'm dubious about just making this happen for level changes though, you shouldn't be able to bypass any part of the security policy using newrole.
--
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.
Quoted 8 lines · Joshua Brindle
Quoted 4 lines
From: Klaus Weidner [mailto:[email protected]] Instead of hardcoded types, how about a configurable type or a
/etc/securettytypesfile that contains the types instead of tty names?Sure, the securettycontexts might be the way to go. I'm dubious about just making this happen for level changes though, you shouldn't be able to bypass any part of the security policy using newrole.
The problem isn't actually in newrole, so this is a workaround to close an information leak in MLS environments without causing problems for everyone else who wouldn't care about this leak. Newrole has special privileges (specifically the "mlsprocsetsl" attribute) which make it a trusted program, and I think it's reasonable to have a trusted program enforce part of the security policy.
Quoted 1 line
From what I recall from the previous discussions, there is a lot of
resistance to implementing SELinux hooks in the PTY layer which would be needed to enforce the restriction at the kernel level.
A permission check at the PTY level would most likely require a fair amount of policy to avoid TE denials, and even getting just the MLS constraints to work would be tricky. For example, which of the processes involved at the ends of the PTY should gain MLS override privileges due to its type attributes if any?
-Klaus
--
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.
Quoted 17 lines · Klaus Weidner
Quoted 8 lines · Joshua Brindle
Quoted 4 lines
From: Klaus Weidner [mailto:[email protected]] Instead of hardcoded types, how about a configurable type or a
/etc/securettytypesfile that contains the types instead of tty names?Sure, the securettycontexts might be the way to go. I'm dubious about just making this happen for level changes though, you shouldn't be able to bypass any part of the security policy using newrole.
The problem isn't actually in newrole, so this is a workaround to close an information leak in MLS environments without causing problems for everyone else who wouldn't care about this leak. Newrole has special privileges (specifically the "mlsprocsetsl" attribute) which make it a trusted program, and I think it's reasonable to have a trusted program enforce part of the security policy.
Quoted 3 lines
Quoted 1 line
From what I recall from the previous discussions, there is a lot of
resistance to implementing SELinux hooks in the PTY layer which would be needed to enforce the restriction at the kernel level.
Not so much resistance as uncertainty as to what form such a check would take and how effective it would be.
Quoted 7 lines
A permission check at the PTY level would most likely require a fair amount of policy to avoid TE denials, and even getting just the MLS constraints to work would be tricky. For example, which of the processes involved at the ends of the PTY should gain MLS override privileges due to its type attributes if any?
-Klaus
Signature · 8 lines
Stephen Smalley National Security Agency -- 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.
libselinux securetty_context patch
debugfiles.list +10 -0
@@ -0,0 +1,10 @@ +/usr/lib/debug/usr/sbin/getsebool.debug +/usr/lib/debug/usr/sbin/getenforce.debug +/usr/lib/debug/usr/sbin/selinuxenabled.debug +/usr/lib/debug/usr/sbin/avcstat.debug +/usr/lib/debug/usr/sbin/matchpathcon.debug +/usr/lib/debug/usr/sbin/togglesebool.debug +/usr/lib/debug/usr/sbin/setenforce.debug +/usr/lib/debug/usr/lib/python2.4/site-packages/_selinux.so.debug +/usr/lib/debug/lib/libselinux.so.1.debug +/usr/src/debug/libselinux-1.33.3
Binary files nsalibselinux/debugsources.list and libselinux-1.33.3/debugsources.list differ
include/selinux/selinux.h +4 -1
@@ -406,6 +406,7 @@extern const char *selinux_homedir_context_path (void );extern const char *selinux_media_context_path (void );extern const char *selinux_contexts_path (void ); +extern const char *selinux_securetty_context_path (void );extern const char *selinux_booleans_path (void );extern const char *selinux_customizable_types_path (void );extern const char *selinux_users_path (void );
@@ -413,12 +414,14 @@extern const char *selinux_translations_path (void );extern const char *selinux_netfilter_context_path (void );extern const char *selinux_path (void ); -/* Check a permission in the passwd class. Return 0 if granted or -1 otherwise. */ extern int selinux_check_passwd_access (access_vector_t requested);extern int checkPasswdAccess (access_vector_t requested); +/* Check if the tty_context is defined as a securetty +Return 1 if secure, 0 if not, or -1 if otherwise. */ +extern int selinux_check_securetty_context (security_context_t tty_context);/* Set the path to the selinuxfs mount point explicitly. Normally, this is determined automatically during libselinux initialization, but this is not always possible, e.g. for /sbin/init
man/man3/selinux_binary_policy_path.3 +4 -0
@@ -27,6 +27,8 @@ .br extern const char *selinux_media_context_path(void); .br +extern const char *selinux_securetty_context_path(void); +.br extern const char *selinux_contexts_path(void); .br extern const char *selinux_booleans_path(void);
@@ -56,6 +58,8 @@ .sp selinux_contexts_path() - directory containing all of the context configuration files .sp +selinux_securetty_context_path() - defines terminal contexts for securetty +.sp selinux_booleans_path() - initial policy boolean settings .SH AUTHOR
man/man3/selinux_check_securetty_context.3 +13 -0
@@ -0,0 +1,13 @@ +.TH "selinux_check_securetty_context" "3" "1 January 2007" "[email protected]" "SE Linux API documentation" +.SH "NAME" +selinux_check_securetty_context \- check whether a tty security context is defined as a securetty context +.SH "SYNOPSIS" +.B #include <selinux/selinux.h> +.sp +.BI "int selinux_check_securetty_context(security_context_t "tty_context ); + +.SH "DESCRIPTION" +.B selinux_check_securetty_context +returns 1 if tty_context is a securetty context +returns 0 if tty_context is a not a securetty context +returns -1 on error.
man/man3/selinux_securetty_context_path.3 +1 -0
@@ -0,0 +1 @@ +.so man3/selinux_binary_policy_path.3
Binary files nsalibselinux/src/avc_internal.lo and libselinux-1.33.3/src/avc_internal.lo differ Binary files nsalibselinux/src/avc_internal.o and libselinux-1.33.3/src/avc_internal.o differ Binary files nsalibselinux/src/avc.lo and libselinux-1.33.3/src/avc.lo differ
Binary files nsalibselinux/src/avc.o and libselinux-1.33.3/src/avc.o differ
Binary files nsalibselinux/src/avc_sidtab.lo and libselinux-1.33.3/src/avc_sidtab.lo differ Binary files nsalibselinux/src/avc_sidtab.o and libselinux-1.33.3/src/avc_sidtab.o differ Binary files nsalibselinux/src/booleans.lo and libselinux-1.33.3/src/booleans.lo differ Binary files nsalibselinux/src/booleans.o and libselinux-1.33.3/src/booleans.o differ
Binary files nsalibselinux/src/canonicalize_context.lo and libselinux-1.33.3/src/canonicalize_context.lo differ Binary files nsalibselinux/src/canonicalize_context.o and libselinux-1.33.3/src/canonicalize_context.o differ Binary files nsalibselinux/src/checkAccess.lo and libselinux-1.33.3/src/checkAccess.lo differ Binary files nsalibselinux/src/checkAccess.o and libselinux-1.33.3/src/checkAccess.o differ Binary files nsalibselinux/src/check_context.lo and libselinux-1.33.3/src/check_context.lo differ Binary files nsalibselinux/src/check_context.o and libselinux-1.33.3/src/check_context.o differ Binary files nsalibselinux/src/compute_av.lo and libselinux-1.33.3/src/compute_av.lo differ Binary files nsalibselinux/src/compute_av.o and libselinux-1.33.3/src/compute_av.o differ Binary files nsalibselinux/src/compute_create.lo and libselinux-1.33.3/src/compute_create.lo differ Binary files nsalibselinux/src/compute_create.o and libselinux-1.33.3/src/compute_create.o differ Binary files nsalibselinux/src/compute_member.lo and libselinux-1.33.3/src/compute_member.lo differ Binary files nsalibselinux/src/compute_member.o and libselinux-1.33.3/src/compute_member.o differ Binary files nsalibselinux/src/compute_relabel.lo and libselinux-1.33.3/src/compute_relabel.lo differ Binary files nsalibselinux/src/compute_relabel.o and libselinux-1.33.3/src/compute_relabel.o differ Binary files nsalibselinux/src/compute_user.lo and libselinux-1.33.3/src/compute_user.lo differ Binary files nsalibselinux/src/compute_user.o and libselinux-1.33.3/src/compute_user.o differ Binary files nsalibselinux/src/context.lo and libselinux-1.33.3/src/context.lo differ
Binary files nsalibselinux/src/context.o and libselinux-1.33.3/src/context.o differ
Binary files nsalibselinux/src/disable.lo and libselinux-1.33.3/src/disable.lo differ
Binary files nsalibselinux/src/disable.o and libselinux-1.33.3/src/disable.o differ
Binary files nsalibselinux/src/enabled.lo and libselinux-1.33.3/src/enabled.lo differ
Binary files nsalibselinux/src/enabled.o and libselinux-1.33.3/src/enabled.o differ
Binary files nsalibselinux/src/fgetfilecon.lo and libselinux-1.33.3/src/fgetfilecon.lo differ Binary files nsalibselinux/src/fgetfilecon.o and libselinux-1.33.3/src/fgetfilecon.o differ
src/file_path_suffixes.h +1 -0
@@ -7,6 +7,7 @@ S_(USER_CONTEXTS, "/contexts/users/") S_(FAILSAFE_CONTEXT, "/contexts/failsafe_context") S_(DEFAULT_TYPE, "/contexts/default_type") + S_(SECURETTY_CONTEXTS, "/contexts/securetty_contexts") S_(BOOLEANS, "/booleans") S_(MEDIA_CONTEXTS, "/contexts/files/media")S_ (REMOVABLE_CONTEXT ,"/contexts/removable_context" )
Binary files nsalibselinux/src/freeconary.lo and libselinux-1.33.3/src/freeconary.lo differ Binary files nsalibselinux/src/freeconary.o and libselinux-1.33.3/src/freeconary.o differ Binary files nsalibselinux/src/freecon.lo and libselinux-1.33.3/src/freecon.lo differ
Binary files nsalibselinux/src/freecon.o and libselinux-1.33.3/src/freecon.o differ
Binary files nsalibselinux/src/fsetfilecon.lo and libselinux-1.33.3/src/fsetfilecon.lo differ Binary files nsalibselinux/src/fsetfilecon.o and libselinux-1.33.3/src/fsetfilecon.o differ Binary files nsalibselinux/src/get_context_list.lo and libselinux-1.33.3/src/get_context_list.lo differ Binary files nsalibselinux/src/get_context_list.o and libselinux-1.33.3/src/get_context_list.o differ Binary files nsalibselinux/src/get_default_type.lo and libselinux-1.33.3/src/get_default_type.lo differ Binary files nsalibselinux/src/get_default_type.o and libselinux-1.33.3/src/get_default_type.o differ Binary files nsalibselinux/src/getenforce.lo and libselinux-1.33.3/src/getenforce.lo differ Binary files nsalibselinux/src/getenforce.o and libselinux-1.33.3/src/getenforce.o differ Binary files nsalibselinux/src/getfilecon.lo and libselinux-1.33.3/src/getfilecon.lo differ Binary files nsalibselinux/src/getfilecon.o and libselinux-1.33.3/src/getfilecon.o differ Binary files nsalibselinux/src/getpeercon.lo and libselinux-1.33.3/src/getpeercon.lo differ Binary files nsalibselinux/src/getpeercon.o and libselinux-1.33.3/src/getpeercon.o differ Binary files nsalibselinux/src/init.lo and libselinux-1.33.3/src/init.lo differ
Binary files nsalibselinux/src/init.o and libselinux-1.33.3/src/init.o differ
Binary files nsalibselinux/src/is_customizable_type.lo and libselinux-1.33.3/src/is_customizable_type.lo differ Binary files nsalibselinux/src/is_customizable_type.o and libselinux-1.33.3/src/is_customizable_type.o differ Binary files nsalibselinux/src/lgetfilecon.lo and libselinux-1.33.3/src/lgetfilecon.lo differ Binary files nsalibselinux/src/lgetfilecon.o and libselinux-1.33.3/src/lgetfilecon.o differ Binary files nsalibselinux/src/libselinux.a and libselinux-1.33.3/src/libselinux.a differ Binary files nsalibselinux/src/libselinux.so and libselinux-1.33.3/src/libselinux.so differ Binary files nsalibselinux/src/libselinux.so.1 and libselinux-1.33.3/src/libselinux.so.1 differ Binary files nsalibselinux/src/load_policy.lo and libselinux-1.33.3/src/load_policy.lo differ Binary files nsalibselinux/src/load_policy.o and libselinux-1.33.3/src/load_policy.o differ Binary files nsalibselinux/src/lsetfilecon.lo and libselinux-1.33.3/src/lsetfilecon.lo differ Binary files nsalibselinux/src/lsetfilecon.o and libselinux-1.33.3/src/lsetfilecon.o differ Binary files nsalibselinux/src/matchmediacon.lo and libselinux-1.33.3/src/matchmediacon.lo differ Binary files nsalibselinux/src/matchmediacon.o and libselinux-1.33.3/src/matchmediacon.o differ Binary files nsalibselinux/src/matchpathcon.lo and libselinux-1.33.3/src/matchpathcon.lo differ Binary files nsalibselinux/src/matchpathcon.o and libselinux-1.33.3/src/matchpathcon.o differ Binary files nsalibselinux/src/policyvers.lo and libselinux-1.33.3/src/policyvers.lo differ Binary files nsalibselinux/src/policyvers.o and libselinux-1.33.3/src/policyvers.o differ Binary files nsalibselinux/src/procattr.lo and libselinux-1.33.3/src/procattr.lo differ Binary files nsalibselinux/src/procattr.o and libselinux-1.33.3/src/procattr.o differ
Binary files nsalibselinux/src/query_user_context.lo and libselinux-1.33.3/src/query_user_context.lo differ Binary files nsalibselinux/src/query_user_context.o and libselinux-1.33.3/src/query_user_context.o differ Binary files nsalibselinux/src/rpm.lo and libselinux-1.33.3/src/rpm.lo differ
Binary files nsalibselinux/src/rpm.o and libselinux-1.33.3/src/rpm.o differ
src/selinux_check_securetty_context.c +44 -0
44 lines not on this page · raw message
Binary files nsalibselinux/src/selinux_check_securetty_context.lo and libselinux-1.33.3/src/selinux_check_securetty_context.lo differ Binary files nsalibselinux/src/selinux_check_securetty_context.o and libselinux-1.33.3/src/selinux_check_securetty_context.o differ
src/selinux_config.c +8 -1
@@ -38,7 +38,8 @@#define NETFILTER_CONTEXTS 15#define FILE_CONTEXTS_HOMEDIR 16#define FILE_CONTEXTS_LOCAL 17 -#define NEL 18 +#define SECURETTY_CONTEXTS 18 +#define NEL 19/* New layout is relative to SELINUXDIR/policytype. */ static char *file_paths[NEL ];
@@ -299,6 +300,12 @@hidden_def (selinux_default_context_path) +const char *selinux_securetty_context_path() +{ +return get_path (SECURETTY_CONTEXTS ); +} +hidden_def (selinux_securetty_context_path) + const char *selinux_failsafe_context_path() {return get_path (FAILSAFE_CONTEXT );
Binary files nsalibselinux/src/selinux_config.lo and libselinux-1.33.3/src/selinux_config.lo differ Binary files nsalibselinux/src/selinux_config.o and libselinux-1.33.3/src/selinux_config.o differ
src/selinux_internal.h +2 -0
@@ -53,6 +53,7 @@ hidden_proto(security_setenforce) hidden_proto(selinux_binary_policy_path) hidden_proto(selinux_default_context_path) + hidden_proto(selinux_securetty_context_path) hidden_proto(selinux_failsafe_context_path) hidden_proto(selinux_removable_context_path) hidden_proto(selinux_file_context_path)
@@ -66,6 +67,7 @@ hidden_proto(selinux_media_context_path) hidden_proto(selinux_path) hidden_proto(selinux_check_passwd_access) + hidden_proto(selinux_check_securetty_context) hidden_proto(matchpathcon_init_prefix) hidden_proto(selinux_users_path) hidden_proto(selinux_usersconf_path);
Binary files nsalibselinux/src/_selinux.so and libselinux-1.33.3/src/_selinux.so differ
Binary files nsalibselinux/src/selinuxswig_wrap.lo and libselinux-1.33.3/src/selinuxswig_wrap.lo differ
Binary files nsalibselinux/src/setenforce.lo and libselinux-1.33.3/src/setenforce.lo differ
Binary files nsalibselinux/src/setenforce.o and libselinux-1.33.3/src/setenforce.o differ
Binary files nsalibselinux/src/setfilecon.lo and libselinux-1.33.3/src/setfilecon.lo differ
Binary files nsalibselinux/src/setfilecon.o and libselinux-1.33.3/src/setfilecon.o differ
Binary files nsalibselinux/src/setrans_client.lo and libselinux-1.33.3/src/setrans_client.lo differ
Binary files nsalibselinux/src/setrans_client.o and libselinux-1.33.3/src/setrans_client.o differ
Binary files nsalibselinux/src/seusers.lo and libselinux-1.33.3/src/seusers.lo differ
Binary files nsalibselinux/src/seusers.o and libselinux-1.33.3/src/seusers.o differ
Binary files nsalibselinux/utils/avcstat and libselinux-1.33.3/utils/avcstat differ
Binary files nsalibselinux/utils/compute_av and libselinux-1.33.3/utils/compute_av differ
Binary files nsalibselinux/utils/compute_create and libselinux-1.33.3/utils/compute_create differ
Binary files nsalibselinux/utils/compute_member and libselinux-1.33.3/utils/compute_member differ
Binary files nsalibselinux/utils/compute_relabel and libselinux-1.33.3/utils/compute_relabel differ
Binary files nsalibselinux/utils/compute_user and libselinux-1.33.3/utils/compute_user differ
Binary files nsalibselinux/utils/getconlist and libselinux-1.33.3/utils/getconlist differ
Binary files nsalibselinux/utils/getenforce and libselinux-1.33.3/utils/getenforce differ
Binary files nsalibselinux/utils/getfilecon and libselinux-1.33.3/utils/getfilecon differ
Binary files nsalibselinux/utils/getpidcon and libselinux-1.33.3/utils/getpidcon differ
Binary files nsalibselinux/utils/getsebool and libselinux-1.33.3/utils/getsebool differ
Binary files nsalibselinux/utils/getseuser and libselinux-1.33.3/utils/getseuser differ
Binary files nsalibselinux/utils/matchpathcon and libselinux-1.33.3/utils/matchpathcon differ
Binary files nsalibselinux/utils/policyvers and libselinux-1.33.3/utils/policyvers differ
Binary files nsalibselinux/utils/selinux_check_securetty_context and libselinux-1.33.3/utils/selinux_check_securetty_context differ
utils/selinux_check_securetty_context.c +40 -0
@@ -0,0 +1,40 @@ +#include <unistd.h> +#include <stdio.h> +#include <stdlib.h> +#include <getopt.h> +#include <errno.h> +#include <string.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <sys/errno.h> +#include <selinux/selinux.h> + +void usage (const char *progname) +{ +fprintf (stderr, +"usage: %s tty_context...\n" , + progname); +exit (1 ); +} + +int main (int argc,char **argv) +{ +int i; +if (argc <2 ) +usage (argv[0 ]); + +for (i =1 ; i < argc; i++) { +switch (selinux_check_securetty_context (argv[i])) { +case 1 : +printf ("%s securetty.\n" , argv[i]); +break ; +case 0 : +printf ("%s not securetty.\n" , argv[i]); +break ; +case -1 : +perror ("Failed on check if securetty" ); +return -1 ; + } + } +return 0 ; +}
Binary files nsalibselinux/utils/selinuxenabled and libselinux-1.33.3/utils/selinuxenabled differ Binary files nsalibselinux/utils/setenforce and libselinux-1.33.3/utils/setenforce differ Binary files nsalibselinux/utils/setfilecon and libselinux-1.33.3/utils/setfilecon differ Binary files nsalibselinux/utils/togglesebool and libselinux-1.33.3/utils/togglesebool differ
newrole patch. for checking securetty.
newrole/newrole.c 2007-01-05 11:17:36.000000000 -0500 renamed from newrole/newrole.c 2007-01-04 17:01:41.000000000 -0500 +0 -0
@@ -733,6 +734,7 @@ security_context_t *new_context, int *preserve_environment)
{
+ int i; /* index for open file descriptors */
int flag_index; /* flag index in argv[] */
int clflag; /* holds codes for command line flags */
char *role_s = NULL; /* role spec'd by user in argv[] */
@@ -741,6 +743,8 @@
char *level_s = NULL; /* level spec'd by user in argv[] */
char *range_ptr = NULL;
security_context_t new_con = NULL;
+ security_context_t tty_con = NULL;
+ int securetty=0;
context_t context = NULL; /* manipulatable form of new_context */
const struct option long_options[] = {
{"role", 1, 0, 'r'},
@@ -793,6 +797,18 @@
"specified\n"));
return -1;
}+ for (i=0; i < 3; i++) {
+ securetty=0;
+ if (fgetfilecon(i,&tty_con) >= 0) {
+ securetty = (selinux_check_securetty_context(tty_con) == 1);
+ freecon(tty_con);
+ }
+ if (!securetty) {
+ fprintf(stderr, "Error: you are not allowed to change levels on a non secure terminal\n");
+ return -1;
+ }
+ }
+
level_s = optarg;
break;
default:--
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.
First libselinux-rhat patch was broken. Needs to only check the context type.
more /etc/selinux/mls/contexts/securetty_contextssysadm_tty_device_tstaff_tty_device_tuser_tty_device_t
include/selinux/selinux.h +4 -1
@@ -406,6 +406,7 @@extern const char *selinux_homedir_context_path (void );extern const char *selinux_media_context_path (void );extern const char *selinux_contexts_path (void ); +extern const char *selinux_securetty_context_path (void );extern const char *selinux_booleans_path (void );extern const char *selinux_customizable_types_path (void );extern const char *selinux_users_path (void );
@@ -413,12 +414,14 @@extern const char *selinux_translations_path (void );extern const char *selinux_netfilter_context_path (void );extern const char *selinux_path (void ); -/* Check a permission in the passwd class. Return 0 if granted or -1 otherwise. */ extern int selinux_check_passwd_access (access_vector_t requested);extern int checkPasswdAccess (access_vector_t requested); +/* Check if the tty_context is defined as a securetty +Return 1 if secure, 0 if not, or -1 if otherwise. */ +extern int selinux_check_securetty_context (security_context_t tty_context);/* Set the path to the selinuxfs mount point explicitly. Normally, this is determined automatically during libselinux initialization, but this is not always possible, e.g. for /sbin/init
man/man3/selinux_binary_policy_path.3 +4 -0
@@ -27,6 +27,8 @@ .br extern const char *selinux_media_context_path(void); .br +extern const char *selinux_securetty_context_path(void); +.br extern const char *selinux_contexts_path(void); .br extern const char *selinux_booleans_path(void);
@@ -56,6 +58,8 @@ .sp selinux_contexts_path() - directory containing all of the context configuration files .sp +selinux_securetty_context_path() - defines terminal contexts for securetty +.sp selinux_booleans_path() - initial policy boolean settings .SH AUTHOR
man/man3/selinux_check_securetty_context.3 +13 -0
@@ -0,0 +1,13 @@ +.TH "selinux_check_securetty_context" "3" "1 January 2007" "[email protected]" "SE Linux API documentation" +.SH "NAME" +selinux_check_securetty_context \- check whether a tty security context is defined as a securetty context +.SH "SYNOPSIS" +.B #include <selinux/selinux.h> +.sp +.BI "int selinux_check_securetty_context(security_context_t "tty_context ); + +.SH "DESCRIPTION" +.B selinux_check_securetty_context +returns 1 if tty_context is a securetty context +returns 0 if tty_context is a not a securetty context +returns -1 on error.
man/man3/selinux_securetty_context_path.3 +1 -0
@@ -0,0 +1 @@ +.so man3/selinux_binary_policy_path.3
src/file_path_suffixes.h +1 -0
@@ -7,6 +7,7 @@ S_(USER_CONTEXTS, "/contexts/users/") S_(FAILSAFE_CONTEXT, "/contexts/failsafe_context") S_(DEFAULT_TYPE, "/contexts/default_type") + S_(SECURETTY_CONTEXTS, "/contexts/securetty_contexts") S_(BOOLEANS, "/booleans") S_(MEDIA_CONTEXTS, "/contexts/files/media")S_ (REMOVABLE_CONTEXT ,"/contexts/removable_context" )
src/selinux_check_securetty_context.c +49 -0
49 lines not on this page · raw message
src/selinux_config.c +8 -1
@@ -38,7 +38,8 @@#define NETFILTER_CONTEXTS 15#define FILE_CONTEXTS_HOMEDIR 16#define FILE_CONTEXTS_LOCAL 17 -#define NEL 18 +#define SECURETTY_CONTEXTS 18 +#define NEL 19/* New layout is relative to SELINUXDIR/policytype. */ static char *file_paths[NEL ];
@@ -299,6 +300,12 @@hidden_def (selinux_default_context_path) +const char *selinux_securetty_context_path() +{ +return get_path (SECURETTY_CONTEXTS ); +} +hidden_def (selinux_securetty_context_path) + const char *selinux_failsafe_context_path() {return get_path (FAILSAFE_CONTEXT );
src/selinux_internal.h +2 -0
@@ -53,6 +53,7 @@ hidden_proto(security_setenforce) hidden_proto(selinux_binary_policy_path) hidden_proto(selinux_default_context_path) + hidden_proto(selinux_securetty_context_path) hidden_proto(selinux_failsafe_context_path) hidden_proto(selinux_removable_context_path) hidden_proto(selinux_file_context_path)
@@ -66,6 +67,7 @@ hidden_proto(selinux_media_context_path) hidden_proto(selinux_path) hidden_proto(selinux_check_passwd_access) + hidden_proto(selinux_check_securetty_context) hidden_proto(matchpathcon_init_prefix) hidden_proto(selinux_users_path) hidden_proto(selinux_usersconf_path);
utils/selinux_check_securetty_context.c +40 -0
@@ -0,0 +1,40 @@ +#include <unistd.h> +#include <stdio.h> +#include <stdlib.h> +#include <getopt.h> +#include <errno.h> +#include <string.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <sys/errno.h> +#include <selinux/selinux.h> + +void usage (const char *progname) +{ +fprintf (stderr, +"usage: %s tty_context...\n" , + progname); +exit (1 ); +} + +int main (int argc,char **argv) +{ +int i; +if (argc <2 ) +usage (argv[0 ]); + +for (i =1 ; i < argc; i++) { +switch (selinux_check_securetty_context (argv[i])) { +case 1 : +printf ("%s securetty.\n" , argv[i]); +break ; +case 0 : +printf ("%s not securetty.\n" , argv[i]); +break ; +case -1 : +perror ("Failed on check if securetty" ); +return -1 ; + } + } +return 0 ; +}
Quoted 7 lines · Daniel J Walsh
First libselinux-rhat patch was broken. Needs to only check the context type.
more
/etc/selinux/mls/contexts/securetty_contextssysadm_tty_device_tstaff_tty_device_tuser_tty_device_t
Use getline() instead of fgets() to gain the benefit of automatically allocated buffers. See init_selinux_config() for example.
Signature · 8 lines
Stephen Smalley National Security Agency -- 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.
Quoted 29 lines · Daniel J Walsh
newrole patch. for checking securetty.
diff --exclude-from=exclude --exclude POTFILES.in --exclude='*.po' --exclude='*.pot' -N -u -r
nsapolicycoreutils/newrole/newrole.cpolicycoreutils-1.33.8/newrole/newrole.c
---nsapolicycoreutils/newrole/newrole.c2007-01-04
17:01:41.000000000 -0500
+++policycoreutils-1.33.8/newrole/newrole.c2007-01-05
11:17:36.000000000 -0500(quoted diff) +12
-0@@ -793,6 +797,18 @@ "specified\n")); return -1; } + for (i=0; i < 3; i++) { + securetty=0; + if (fgetfilecon(i,&tty_con) >= 0) { + securetty = (selinux_check_securetty_context(tty_con) == 1); + freecon(tty_con); + } + if (!securetty) { + fprintf(stderr, "Error: you are not allowed to change levels on a non secure terminal\n"); + return -1; + } + } + level_s = optarg;
Quoted 3 lines
break;
default:Aside from whitespace damage, do we need to check all three descriptors? newrole only calls ttyname(0) and then re-opens that on all three descriptors, so even if 1 and 2 point to something else, they would be ignored (never relabeled, just closed). So I would think you would only need to check descriptor 0.
Signature · 8 lines
Stephen Smalley National Security Agency -- 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.
Quoted 16 lines · Joshua Brindle
Quoted 16 lines
From: Klaus Weidner [mailto:[email protected]]
Quoted 1 line · Joshua Brindle
Hardcoding types into code makes it inflexible to policy
changes, this
Quoted 1 line
is a bad idea IMO, the tty whitelist, however, is probably
the way to
Quoted 1 line
go. I don't know if we should use the existing
/etc/securettyor addQuoted 1 line
our own file though.
I'm not sure if the existing
/etc/securettyis the right one, since people may make serial terminals available to users but would not want direct root login on those. Well, maybe not terribly likely these days.
Quoted 7 lines
Quoted 3 lines
Instead of hardcoded types, how about a configurable type or a
/etc/securettytypesfile that contains the types instead of tty names?Sure, the securettycontexts might be the way to go. I'm dubious about just making this happen for level changes though, you shouldn't be able to bypass any part of the security policy using newrole.
We don't want to break newrole -r on a pty.
(issue is that there are two ends for a pty, master and slave, and only the slave end is relabeled by newrole. master end is always /dev/ptmx wrt the inode, only the open file is per instance IIUC).
Signature · 8 lines
Stephen Smalley National Security Agency -- 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.
Quoted 24 lines · --- Daniel J Walsh
We still have a problem on MLS machines, in that newrole can be used to
pass data via pseudo terminals.script
newrole -l SystemHigh
cat TopSecret.doc
^d
^d
cat typescriptI propose we add this patch to newrole to check if we are on a pseudo
terminal and then fail if user is using -l.Basically this patch checks the major number of the stdin, stdout,
stderr for a number in the pseudo number range, If yes the pseudo
terminal, if not continue. Not pretty but it solves the problem. I
could not figure out another way to check if you are on a pseudo terminal.
Quoted 1 line
Comments?
Are you 100% certain that this is only a pty issue? Any chance you'll have a similar problem with other devices, pipes, fifos, UDS or the like? My pair of Lincolns says otherwise, but they've been wrong before.
Casey Schaufler
[email protected]
--
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.
Quoted 22 lines · Casey Schaufler
Quoted 19 lines · --- Daniel J Walsh
We still have a problem on MLS machines, in that newrole can be used to pass data via pseudo terminals.
script
newrole -l SystemHigh
cat TopSecret.doc
^d
^d
cat typescriptI propose we add this patch to newrole to check if we are on a pseudo terminal and then fail if user is using -l.
Basically this patch checks the major number of the stdin, stdout, stderr for a number in the pseudo number range, If yes the pseudo terminal, if not continue. Not pretty but it solves the problem. I could not figure out another way to check if you are on a pseudo terminal.
Quoted 11 lines
Quoted 2 lines
Comments?
Are you 100% certain that this is only a pty issue? Any chance you'll have a similar problem with other devices, pipes, fifos, UDS or the like? My pair of Lincolns says otherwise, but they've been wrong before.
That would probably be a fools bet. There are other checks in newrole to make sure it is talking to a terminal, though. I worry that I have hit all the pseudo terminals though. I am hoping others smarter then me in the kernel would know.
Quoted 3 lines
Casey Schaufler
[email protected]
--
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.
Quoted 11 lines · James Antill
Quoted 3 lines · Stephen Smalley
Look at Darrel's patch for mcstransd to apply a permission check between the level of the caller and the level being translated for context translations.
Thanks to much discussion with Dan and Stephen, I'm pretty sure I have
this correct now.Here is the libselinux part of the patch (reference policy and PAM are
next).
transition is a bit misleading as a name - you are checking a contains relationship between two contexts, not transitioning between them.
Signature · 8 lines
Stephen Smalley National Security Agency -- 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.
Quoted 14 lines · James Antill
Quoted 4 lines · Stephen Smalley
Quoted 2 lines · James Antill
My understanding is that while
security_check_context()allows it, thesetexeccon()will fail. Which seemed to be good enough.Quoted 8 lines
No, it won't. Suppose that I have two Linux users A and B, with A authorized for category c0 and B authorized for category c2 in seusers, but both A and B are mapped to SELinux user U who is authorized for all categories in the kernel policy. The login-style programs are naturally going to be authorized to transition to any of those contexts since they have to deal with user logins at any level, so the
setexeccon()will succeed. The SELinux security context will have U as the user identity, so it will always be valid. You need an explicit check.
Quoted 1 line
Ok, I had assumed that "U" would always be different in this case.
BTW, using different SELinux user identities (U) was the approach before seusers came into being, but the point of seusers was to avoid having to rebuild the kernel policy every time you wanted to add, remove, or change a Linux user's authorized range. Thus, the per-Linux-user restriction is specified in seusers and enforced by the login-style programs (and then subsequently bounded for the session based on the high/clearance level).
Signature · 8 lines
Stephen Smalley National Security Agency -- 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.
Quoted 21 lines · Stephen Smalley
Quoted 16 lines · James Antill
Quoted 5 lines · Stephen Smalley
Quoted 3 lines · James Antill
My understanding is that while
security_check_context()allows it, thesetexeccon()will fail. Which seemed to be good enough.Quoted 9 lines
No, it won't. Suppose that I have two Linux users A and B, with A authorized for category c0 and B authorized for category c2 in seusers, but both A and B are mapped to SELinux user U who is authorized for all categories in the kernel policy. The login-style programs are naturally going to be authorized to transition to any of those contexts since they have to deal with user logins at any level, so the
setexeccon()will succeed. The SELinux security context will have U as the user identity, so it will always be valid. You need an explicit check.Quoted 2 lines
Ok, I had assumed that "U" would always be different in this case.
Quoted 8 lines
BTW, using different SELinux user identities (U) was the approach before seusers came into being, but the point of seusers was to avoid having to rebuild the kernel policy every time you wanted to add, remove, or change a Linux user's authorized range. Thus, the per-Linux-user restriction is specified in seusers and enforced by the login-style programs (and then subsequently bounded for the session based on the high/clearance level).
I think the same check should be added to the cron patch also.
--
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.
Quoted 1 line · Daniel J Walsh
If we then remove -l from newrole we are done?
And would doing this also mean we do not need to add pam_namespace to newrole?
-Steve
--
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.
Quoted 4 lines · Steve Grubb
Quoted 1 line · Daniel J Walsh
If we then remove -l from newrole we are done?
And would doing this also mean we do not need to add
pam_namespaceto newrole?
Well, some people want pam_namespace functionality for roles, not just levels.
Signature · 8 lines
Stephen Smalley National Security Agency -- 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.
Quoted 1 line · Daniel J Walsh
If we then remove -l from newrole we are done?
Why remove it? Why not just cease using it and leave it there for other people who have different needs?
Signature · 9 lines
[email protected] http://etbe.blogspot.com/ My Blog http://www.coker.com.au/sponsorship.html Sponsoring Free Software development -- 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.
Quoted 5 lines · Russell Coker
Quoted 1 line · Daniel J Walsh
If we then remove -l from newrole we are done?
Why remove it? Why not just cease using it and leave it there for other people who have different needs?
I suspect that it wouldn't fly during an eval, because even if unused, it would be a possible avenue to bypass the evel'ed config. You'd probably have to add a flag of some sort someplace that said if it was permitted. (If done inside PAM, having the .so have an option 'allow-dash-l' and submitting for eval with it not present would probably be OK).
Quoted 2 lines · On Saturday 28 October 2006 01:36, [email protected] wrote:
Quoted 1 line · Russell Coker
On Thursday 19 October 2006 23:21, Daniel J Walsh <[email protected]>
Quoted 6 lines · wrote:
Quoted 4 lines
Quoted 1 line
If we then remove -l from newrole we are done?
Why remove it? Why not just cease using it and leave it there for other people who have different needs?
I suspect that it wouldn't fly during an eval, because even if unused, it
OK.
Well #if 0 would still be better than removing the code. This is something we may want to resurrect at a later time.
Signature · 9 lines
[email protected] http://etbe.blogspot.com/ My Blog http://www.coker.com.au/sponsorship.html Sponsoring Free Software development -- 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.
Quoted 9 lines · Russell Coker
Quoted 2 lines · On Saturday 28 October 2006 01:36, [email protected] wrote:
Quoted 1 line · Russell Coker
On Thursday 19 October 2006 23:21, Daniel J Walsh <[email protected]>
Quoted 5 lines · wrote:
Quoted 4 lines
Quoted 1 line
If we then remove -l from newrole we are done?
Why remove it? Why not just cease using it and leave it there for other people who have different needs?
Quoted 6 lines
Quoted 1 line
I suspect that it wouldn't fly during an eval, because even if unused, it
OK.
Well #if 0 would still be better than removing the code. This is something we may want to resurrect at a later time.
It isn't being removed, at least not upstream.
Signature · 8 lines
Stephen Smalley National Security Agency -- 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.