Skip to contentSkip to conversation

Latest diffs

DISCUSSION Daniel J Walsh 7 participants 13 messages Jan 3, 2007 – Jan 9, 2007 SELinux security module

lore
Share & tools
lore
#0 lore raw

After one hell of a merge. :^(

Spent Christmas vacation week getting Strict policy into shape.

Here are a bunch of changes as well as fixes for targeted and mls policy

http://people.redhat.com/dwalsh/SELinux/policy.diff

----------------------------------------------------------------------------------

Had to add system_u:system_u to seusers to get cron to work correctly. Cron calls getseusers with parameter of "system_u" if this seuser does not exist it fails over to user_u and everything blows up.

Added booleans

allow_ftpd_full_access - Allows users to use ftp and read any file on the system. Pretty close to disable_trans, but you still have some network controls.

Changes allow_mount_anyfile to only allow files
added allow_mounton_anydir to allow admin to mount on any directory but not read files

allow_daemons_dump_core - Allow daemons to create corefiles in /

use_lpd_server boolean removes lots of not needed privs from lpr on cups platforms.

allow_unconfined_execmem_dyntrans is only used on ia64 platforms to run 32 bit applications. kernel does some funny stuff and rexecs unconfined_t programs but needs execmem and execstack. Otherwise ia64 has to run all apps with execmem execstack.

The MLS constraints are really screwed up. Need to come to some kind of agreement between you, klaus and tcs.

usedom_executable_file is still in there. I believe we need to separate out the executables that are expected to be run by a user and those expected to be run by the system. This helps prevent accidently running of applications under sysadm_t.

mkinitrd should not be confined and should not be labeled bootloader_exec_t. This just causes too many problems and little benifit.

I do not want consoletype and hostname transitioning to their domains unless they need the privs, Having them transition from an init script is broken, because you end up with tons of denials when applications redirect stdin/stdout

Hal restarts the network which has a transition to consoletype and thus we get denials.

logwatch looks for files under /var

quota needed major rework to work correctly in MLS environment

Certain tools have rpm libraries built into them and these end up calling the transition rules and getting denials. I want to allow unconfined_t to transition to rpm_script_t

rpm execs prelink and chats with hal, also needs to kill processes running at different sensitivity levels

Added a tzdata domain to allow proper context of /etc/localtime

sudo reads netlink_route_socket, wants to look at the kernel key ring, stores a token in the pam_pid directory, and needs to getattr on all "user" executables.

Some changes to su in order to handle key rings, Needs mls_file_write_down. Need to be able to su from different domains, and pam_rootok causes some selinux_compute_access checks.

usermanage was changed to allow useradd to automatically label the homedirs correctly. useradd now has a -s qualifier that allows it to select the selinux user. It also then labels the directory correctly. Critical for MLS and Strict policy to work.

Lots of fixes to get evolution, mozilla, thunderbird, gnome, mplayer to work with strict policy.

evolution still needs work. (I mainly use thunderbird...)

Fixes to get gpg secret created correctly

Added java_domtrans_user_javaplugin to get transition from staff_mozilla_t -> staff_javaplugin_t to work.

java wants to dbus chat with unconfined domains and init domains.

Not sure why you want if targeted_policy in loadkeys_run?

Fixes for slocate on MLS

userhelper role line is wrong
userhelper_exec so sysadm_t can run userhelper without transitioning.

webalizer wants to getattr fs_t

Label some executables stored in wierd places.

Still want break out of hi_reserved_port_t from reserved_port_t.

genfscon for ntfs-3g

handles for unlabled_t packets

fixes for kernel_unconfined

httpd_t wants to write to snmp_var_lib_t files. Dontaudit.

Several domains want to run telinit. Added init_exec.

Remove anacron_exec_t. Just run in crond_t.

Remove automount_etc_t - Useless.

clamd wants to read kernel sysctl

Lots of fixes to get cron to work and to use polyinstantiation.

cups changes to run in MLS

dbus needs to ptrance itself.

Needs new interface to connect to user bus.

ftp needs to write to faillog

Hal transitions to some other domains, but needs to have it's fds and fifo_files dontaudited

fixes to allow inetd to run on mls

irqbalance needs additional privs

kerberos libraries now try to read krb6kdc_conf_t, Should be dontaudited.

Lots of fixes to get ypxfr/ypserv to work correctly

Dont want dontaudit var_yp_t:dir search line since this prevents setroubleshoot from realizing you are on an NIS box.

nscd needs auth_use_nsswitch

Added policy for pcscd

Lots of fixes to get rhgb to work correctly in a strict enforcing mode.

rlogind needs nsswitch

sendmail wants to read clamav_libs

userspace connects to setroubleshoot unix_stream_socket

fsdaemon needs mls_write_down

spamassisin needs to read /var/lib/spamassisin directory

ssh_agent leaks fds by design.

sshd wants to look at kernel key ring

relabel ICE-UNIX to xdm_tmp_t, since we can not get transition to work correcrtly. Hopefully alot of these other communications paths are being eliminated by gnome.

Lots of fixes to get xserver working with strict policy

fixes for authlogin handling of keyrings and mls, as well as pcscd

hwclock wants to read system state.

mkswap should not run as fsadm. Should be labeled sbin_t.

Fixes for initrc to run in strict

fixes for iptbales to use nscd

local_login needs additional privs

lvm needs privs for multipath

/usr/share/X11/locale needs a label.

initrc replace localization files using cp -A to preserve context. This causes many avc messages.

modutils fixes for strict policy

Need correct labels for genhomedircon and system-config-selinux to create context correctly.

Lots of fixes for polyinstatiation on MLS

Lots of updates to allow userdomain to work correctly in strict policy

--
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.

#1 lore raw
Quoted 1 line · Daniel J Walsh

After one hell of a merge. :^(

[...]

Quoted 2 lines

The MLS constraints are really screwed up. Need to come to some kind of agreement between you, klaus and tcs.

I'm not sure what the areas of disagreement are - I didn't see any opposing opinions after posting the proposed patches (subject "stricter MLS policy constraints" on this list).

The old "ranged object" constraints violate LSPP requirements, that's why the change is necessary for compliance. Any trusted apps that need the old behavior can get it back by using appropriate overrides. If there are more general problems with the stricter constraints please let me know.

-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.

#2 lore raw
In reply to Daniel J Walsh
Quoted 7 lines · Daniel J Walsh

sudo reads netlink_route_socket, wants to look at the kernel key ring, stores a token in the pam_pid directory, and needs to getattr on all "user" executables.

Some changes to su in order to handle key rings, Needs mls_file_write_down. Need to be able to su from different domains, and pam_rootok causes some selinux_compute_access checks.

[...]

Quoted 1 line

sshd wants to look at kernel key ring

[...]

Quoted 1 line

fixes for authlogin handling of keyrings and mls, as well as pcscd

I'm confused about what kernel keyring features are currently available in the current policy, and who gets to use them.

For the Common Criteria configuration, we had been assuming that the kernel keyring feature would be unavailable for unprivileged users, so that we can avoid the need to do MLS testing on keyring objects. Is that still the case?

If not, an alternative would be to provide a boolean to disable keyring access for the evaluated configuration. I had originally proposed that (subject "[PATCH] Add boolean controlling user access to kernel keyring" on this list back in August) based on a misunderstanding, it wasn't actually necessary back then. I just wanted to make sure that the feature isn't sneaking in now...

-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.

#3 lore raw
Quoted 8 lines · Klaus Weidner
Quoted 7 lines · Daniel J Walsh

sudo reads netlink_route_socket, wants to look at the kernel key ring, stores a token in the pam_pid directory, and needs to getattr on all "user" executables.

Some changes to su in order to handle key rings, Needs mls_file_write_down. Need to be able to su from different domains, and pam_rootok causes some selinux_compute_access checks.

Quoted 7 lines

[...]

Quoted 1 line

sshd wants to look at kernel key ring

[...]

Quoted 1 line

fixes for authlogin handling of keyrings and mls, as well as pcscd

I'm confused about what kernel keyring features are currently available in the current policy, and who gets to use them.

I haven't had a chance to look at the patch, but what is currently upstream does not allow users to do anything with keys. Here's the current rules across the entire upstream repo (which includes modules not enabled in the lspp policy):

allow crond_t kernel_t:key search;
allow crond_t local_login_t:key link;
allow crond_t local_login_t:key search; allow crond_t self:key { search write link }; allow initrc_su_t kernel_t:key search; allow initrc_su_t self:key { search write }; allow local_login_t kernel_t:key link; allow local_login_t kernel_t:key search; allow local_login_t self:key { search write link }; allow local_login_t userdomain:key create; allow remote_login_t self:key write;
allow sshd_t kernel_t:key link;
allow sshd_t self:key { search link write }; allow unconfined_domain_type domain:key *; allow xdm_t self:key { search link write }; allow xdm_t userdomain:key create;

Signature · 9 lines
Chris PeBenito
Tresys Technology, LLC
(410) 290-1411 x150


--
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.
#4 lore raw
Quoted 14 lines · Christopher J. PeBenito
Quoted 13 lines · Klaus Weidner
Quoted 7 lines · Daniel J Walsh

sudo reads netlink_route_socket, wants to look at the kernel key ring, stores a token in the pam_pid directory, and needs to getattr on all "user" executables.

Some changes to su in order to handle key rings, Needs mls_file_write_down. Need to be able to su from different domains, and pam_rootok causes some selinux_compute_access checks.

[...]

Quoted 1 line

sshd wants to look at kernel key ring

[...]

Quoted 1 line

fixes for authlogin handling of keyrings and mls, as well as pcscd

Quoted 7 lines
Quoted 2 lines

I'm confused about what kernel keyring features are currently available in the current policy, and who gets to use them.

I haven't had a chance to look at the patch, but what is currently upstream does not allow users to do anything with keys. Here's the current rules across the entire upstream repo (which includes modules not enabled in the lspp policy):

That sounds harmless for the purposes of the LSPP evaluation, thanks for the clarification.

-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.

#5 lore raw
In reply to Daniel J Walsh
Quoted 1 line · Daniel J Walsh

allow_daemons_dump_core - Allow daemons to create corefiles in /

I hope you aren't planning to make this be on by default. The potential for daemons creating files such as /.autorelabel is not nice.

It would probably be better to have some other directory for core files, someone who wants to collect them all could always change kernel.core_pattern to indicate a directory that has appropriate write permissions.

Quoted 1 line

Fixes for slocate on MLS

Isn't this just a bad idea?

Over the years there have been a number of issues with locate. The design of having all the data in a file that all users can access is risky at best.

Are there actually people who desire both the confidentiality protections that MLS offers but who don't desire the integrity protection offered by turning off locate?

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.
#6 lore raw
Quoted 5 lines
Quoted 2 lines

allow_daemons_dump_core - Allow daemons to create corefiles in /

I hope you aren't planning to make this be on by default. The potential for daemons creating files such as /.autorelabel is not nice.

True. Very few processes should have the ability (or need) to write to /.

Quoted 1 line

It would probably be better to have some other directory for core files,

I think this had been discussed...not sure where it went.

Quoted 1 line
Quoted 1 line

Fixes for slocate on MLS

Is slocate in anyone's security target? I was thinking that it was not due to needing to be level aware.

Quoted 1 line

Isn't this just a bad idea?

Or maybe needless.

Quoted 1 line

desire the integrity protection offered by turning off locate?

locate offers no integrity protection. It also has dubious confidentiality since it is likely not level aware.

-Steve

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

--
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.

#7 lore raw
Quoted 2 lines · Steve G

Is slocate in anyone's security target? I was thinking that it was not due to needing to be level aware.

I'm not aware of one, it hadn't even been included in previous CAPP evaluations due to introducing additional complications for dubious benefit.

-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.

#8 lore raw
In reply to Steve G
Quoted 4 lines · Steve G
Quoted 1 line
Quoted 1 line

Fixes for slocate on MLS

Is slocate in anyone's security target? I was thinking that it was not due to needing to be level aware.

Before returning a result locate checks whether it can be accessed by the calling user. As long as you trust locate to do the right thing in this regard it should be OK. Based on history I'm not going to trust it on my systems.

Quoted 3 lines
Quoted 1 line

Isn't this just a bad idea?

Or maybe needless.

Machines have become much faster since locate was invented, even when it's installed few people bother to use it. The machines I run fall into two general categories, machines on which find is fast enough that you would never desire to run locate, and machines on which "find /" might not complete in 24 hours and therefore need to have locate disabled.

Quoted 4 lines
Quoted 1 line

desire the integrity protection offered by turning off locate?

locate offers no integrity protection. It also has dubious confidentiality since it is likely not level aware.

You mis-read my message. I consider running locate to be risking the integrity of the system. But you are probably correct in considering it to be a confidentiality issue instead.

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.
#9 lore raw
In reply to Russell Coker
Quoted 12 lines · --- Russell Coker
Quoted 1 line · Daniel J Walsh

Fixes for slocate on MLS

Isn't this just a bad idea?

Over the years there have been a number of issues with locate. The design of
having all the data in a file that all users can access is risky at best.

Quoted 5 lines

Are there actually people who desire both the confidentiality protections that
MLS offers but who don't desire the integrity protection offered by turning
off locate?

Yup. Users of real deployed MLS systems want
everything to work, regardless of how "obviously
stoopid" it may appear to you and/or me. Since
locate is a facility that makes looking up
files faster (than "find / -name") and "everyone
knows that MLS makes the system slower" it is
very likely that users will believe they want it.

That doesn't mean that you have to give locate
the ability to show users information about
files they aren't cleared for, that would be
wrong. If noone is eager to make locate MLS
cognizant there's always the option of
polyinstantiating /var/lib/mlocate and running
multiple updatedb's. Whichever (if either)
scheme is best in keeping with the overall
SELinux application philosophy ought to serve
fine.

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.

#10 lore raw
Quoted 7 lines · Casey Schaufler

If noone is eager to make locate MLS cognizant there's always the option of polyinstantiating /var/lib/mlocate and running multiple updatedb's. Whichever (if either) scheme is best in keeping with the overall SELinux application philosophy ought to serve fine.

Having multiple copies of /var/lib/mlocate for each of s0..s15 might be viable, even if a separate "find /" is run for each.

Multiple copies of it for each of the 2^1024 category combinations isn't an option. Multiple copies of it for each of the levels defined by "semanage translation" might be viable but it would involve some pain.

Could we have a version of locate that is a little slower than usual and which just calls find without telling the user? :-#

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.
#11 lore raw
Quoted 3 lines · --- Russell Coker

Could we have a version of locate that is a little slower than usual and which
just calls find without telling the user? :-#

One of the first things I noticed as an important
difference between Unix and Linux is how much
faster (the second) find / is on Linux than it is
on Unix. I say go for it. As mentioned before,
locate is a holdover from the days when a MIPS
was a lot of compute power and disc platters
were a foot across.

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.

#12 lore raw
In reply to Russell Coker

Hi,

Quoted 2 lines

Could we have a version of locate that is a little slower than usual and which just calls find without telling the user? :-#

Or have slocate trying to access the located files before printing them? This will make slocate slower, but also removes files from the result that were deleted in the meantime (locate can give you old results). But it's still faster than find.

Then have a type slocate_t which is able to access the database; regular user domains can't read the file. This should confine an information leak to programming errors in slocate?

best regards,
Erich Schubert

Signature · 10 lines
    erich@(vitavonni.de|debian.org)    --    GPG Key ID: 4B3A135C    (o_
             Reality continues to ruin my life --- Calvin            //\
   Die kürzeste Verbindung zwischen zwei Menschen ist ein Lächeln.   V_/_



--
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.