limiting types on a file system
We have mount options nosuid and nodev that make it safe to use an ext2 file system on removable media with automount.
With SE Linux we can't allow automount of ext2 etc file systems, as we can't allow arbitary type selection by the user who is in posession of the floppy disk or cd-rom. Also this means that we can't allow -fstype=auto...
Before someone says "but that's a security issue", well if you have access to the floppy drive you're probably fairly trusted anyway, and there are degrees of security (no point totally wiping out security on machines that need access to floppy disks).
I was thinking, that if we could specify a limited range of types for a file system based on the domain of the process that is mounting it, and the type (if any) of the device that is being mounted then we would be able to adequately control this.
Maybe something like the following:type_transition user_mount_t removable_device_t:filesystem { user_home_dir_t user_home_t };
Then any types other than those two would appear as unlabelled_t. Of course the problem with this is that if you use chsid to change the type of a file (or create a file with Netscape) then it'll effectively disappear at the next mount! Unless the domain used to mount the file system is tracked right through (which is ugly).
Also something to be concerned about is that if the constraints allow some identity on the file to have greater rights than the user in question (IE if I'm logged in as identity "rjc" then I get greater rights to a file with identity "foo" than a file with identity "rjc") then the user can gain that - but surely no-one would be crazy enough to do this?!?!
Maybe just being able to force a single type (similar to the uid= and gid= options for mounting some file systems) would be the easiest solution.
Signature · 10 lines
http://www.coker.com.au/selinux/ My NSA Security Enhanced Linux packages http://www.coker.com.au/bonnie++/ Bonnie++ hard drive benchmark http://www.coker.com.au/postal/ Postal SMTP/POP benchmark http://www.coker.com.au/~russell/ My home page -- 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
Maybe something like the following:
type_transitionuser_mount_tremovable_device_t:filesystem {user_home_dir_tuser_home_t};Then any types other than those two would appear as
unlabelled_t. Of course the problem with this is that if you use chsid to change the type of a file (or create a file with Netscape) then it'll effectively disappear at the next mount! Unless the domain used to mount the file system is tracked right through (which is ugly).
Would you want to allow the disk to be labelled based on information stored on that disk?
I think this goes against the principles behind SE-Linux, where it is the system adminstrator who is in control of the system, not each user.
Also floppy disks are typically small, and you want to maximize available space.
How about a fixed type depending on who is doing the mount command, and what parameters they use?
(eg. so one user may want the floppy disk to save files downloaded from netscape, but another user may want to prevent netscape having any access)
Are there any implications here in case the user wants to back up their private gpg key on floppy disk?
Signature · 6 lines
Brian May <[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 2 lines · Brian May
Would you want to allow the disk to be labelled based on information stored on that disk?
Ideally yes but within certain limits.
Quoted 3 lines
I think this goes against the principles behind SE-Linux, where it is the system adminstrator who is in control of the system, not each user.
The system administrator would still be in control, they could limit which types a particular mount domain could create.
Currently the user can change files between user_home_t, user_netscape_ro_t, and user_netscape_rw_t in their home directory. Why not allow them to store the same types on a floppy disk?
Quoted 2 lines
Also floppy disks are typically small, and you want to maximize available space.
The difference between minix and ext2 is probably greater than the size of /...security ...
Quoted 2 lines
How about a fixed type depending on who is doing the mount command, and what parameters they use?
That would be workable.
Quoted 6 lines
(eg. so one user may want the floppy disk to save files downloaded from netscape, but another user may want to prevent netscape having any access)
Are there any implications here in case the user wants to back up their private gpg key on floppy disk?
Yes, so the user can mount one disk for netscape to access, umount it and then mount a disk for the gpg private key (which netscape is not allowed to access) with a different type.
Signature · 10 lines
http://www.coker.com.au/selinux/ My NSA Security Enhanced Linux packages http://www.coker.com.au/bonnie++/ Bonnie++ hard drive benchmark http://www.coker.com.au/postal/ Postal SMTP/POP benchmark http://www.coker.com.au/~russell/ My home page -- 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.
Re the original problem of allowing end-users to use removable media, notably a floppy, many years ago I was faced with that one, and addressed it by making the raw floppy device read/write accessible to the user, then providing a build of mtools, cmdline utilities for copying files to and from MS-DOS formatted filesystems. This worked well enough for them.
It's not always the fix, but where applicable it's a solution with a nicely simple security model, dodges all the concerns about what clever funkiness people can pull off if they're permitted to mount filesystems from media they control.
-Bennett
Quoted 6 lines · Bennett Todd
Re the original problem of allowing end-users to use removable media, notably a floppy, many years ago I was faced with that one, and addressed it by making the raw floppy device read/write accessible to the user, then providing a build of mtools, cmdline utilities for copying files to and from MS-DOS formatted filesystems. This worked well enough for them.
That will work as long as the disks are in DOS or TAR formats.
Also to do that you would want to have a PAM module to relabel the floppy device node to a type that the user can access (maybe the home directory type for the user). Don't want to have someone insert a floppy disk only to have someone login over the network and copy all the data off...
Signature · 10 lines
http://www.coker.com.au/selinux/ My NSA Security Enhanced Linux packages http://www.coker.com.au/bonnie++/ Bonnie++ hard drive benchmark http://www.coker.com.au/postal/ Postal SMTP/POP benchmark http://www.coker.com.au/~russell/ My home page -- 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.