disable disk image mounting.

Hello all,

I am looking to lock down our users a little bit further as they have circumvented the noexec flag on their home directories simply by using the mounted disk images without installing them locally.

How do I disable disk image mounting for non-administrators?

G5 Dual 2.0, Mac OS X (10.4.5), Intel Pro 1000 XT network card

Posted on Aug 26, 2008 12:12 PM

Reply
15 replies

Aug 26, 2008 1:38 PM in response to KJK555

I'm unsure whether you are speaking of encrypting their home directories or encrypting the disk images. I'll address both.

Encrypting home directories - doesn't help as they will still be able to mount disk images.
Encrypting disk images - doesn't help because they can download any disk image they want and mount it from there.

ACL's are obviously what am a looking for as you can tell from any mounted disk image it gets default permissions 755 for the user:group that opens it.

Unfortunately since disk images act much akin to USB hotplug devices I can't simply perform ACL operations on something that has yet to be opened.

Best effort I can do without knowing where these defaults come from is to change the permission on the root /Volumes .. however that's quite useless as that is also where the hard drive is mounted and obviously I want them to be able to use that.

Aug 26, 2008 2:05 PM in response to oddio

I was saying to encrypt the disk images, I assume you are referring to backup images of
some sort stored on the network somewhere.

If that's the case then the obvious most secure solution is to physically store the encrypted backups
on a removable device and lock the whole shebang up when not needed.

ACL's can be used to limit directory access between users or even access to applications when used
in conjunction with the correct posix permissions.
For example:
Let's say you don't want your users using Disk Utility. Simply change the DiskUtility.app posix
permissions to owner: root with only root having read,write and execute permissions, everyone else
"no access"
Open sandbox and use it to apply read,write and execute permissions to the admin user(s) using
ACL's. Once applied properly, admin user(s) will be able to use DU, but no else one can.

Nice thing about ACL's is you can limit or allow Access Privileges individually as well as by groups
and/or any combination thereof.

Beware that ACL's can be easily circumvented (as can posix permissions) outside of the boot
volume, simple by using the "ignore permissions on this volume" option.

Kj

Aug 26, 2008 5:24 PM in response to oddio

I see.

I tried by changing permissions (using acl's) on /system/library/coreservices/diskimagemounter.app,
but only with limited success. Instead of mounting the image, DU opened and you could still
mount it by selecting "open".

I also tried changes permissions on /usr/bin/hdiutil, but still no cigar.

I did do it by disabling Disk Utility though. I don't know if that is going to be practical for you
though. Image mounting is integrated into Leo's Disk Utility framework now.

Kj

Aug 26, 2008 6:30 PM in response to oddio

I think I found an answer for you that will also work for your other question about external drives.

You can use Workgroup manager to do all of that. I just checked and using workgroup manager you can restrict or make read only access to any external drives, disk media and disk images.

Workgroup Manager is part of the [Server Admin Tools|http://www.apple.com/downloads/macosx/apple/macosx_updates/serveradmintoo ls105.html] but it can be installed on client versions too. of course, if run OS X server you should have it already.


Once you install Server Admin Tools, start Workgroup manager and enter
localhost in the address field and enter you admin name and password. select an account, go to preferences->media access and it's all there.

Message was edited by: V.K.

P.S. you can use it on groups instead of individual users. this should make it easier to manage.

Message was edited by: V.K.

Aug 26, 2008 9:01 PM in response to V.K.

I am not sure if the workgroup manager will work as users are not local, but in fact ldap users (not AD or OD). I have yet to see a solid solution arise to the case of integrating ldap into a situation such as this (or the use of say iCal server), although Apple documentation has assured me that it can be done (without ever explaining how).

I'll give it a shot in the morning, thanks for the help thus far guys.

Cheers!

Aug 27, 2008 1:20 AM in response to oddio

Hi oddmyth:
I experimented with Workgroup Manager and got some strange behavior. I blocked a user from
opening images and tested it. It prevented the user from opening the image, but it got caught
in a loop trying to open it and I had to use activity monitor app to manually make the
diskimagemounter program stop. I did not have to force quit it though. When it stopped it
gave a message saying child processes would not start, so apparently something is lacking
in the consumer version of Leo to properly administrate these restrictions.

Depending on the complexity of your network, you may have to upgrade to Leo Server
to maintain both your security and your sanity.

Kj

Aug 27, 2008 11:08 AM in response to KJK555

Hey guys,

So the ultimate solution to this thus far (and a really cruddy one at that I might add) is to turn off diskarbitrationd.

This is done via the launchctl command:

sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.diskarbitrationd.plist

The -w flag writes the disable into the plist instead of just stopping the daemon.

This basically does the exact same thing as KJ's suggestion of modifying ACL's which I prefer not to do as some program installs generate improper permissions as such it is habit to run 'fix permissions' from the Disk Utility after my initial install of a new program. This habit breaks the idea of using ACL's to modify the behaviour.

Overall this solves both my problems (USB drives and disk images). Albeit, I find it hard to believe that modifying the mounting options and permissions sets of both USB and disk images is UNMODIFYABLE in OSX, but both Linux and Windows both contain these feature sets.

I would love my users to still be able to play their iPods through their machines, but not be able to write information back out to them. I would love them to be able to copy things onto our system via their USB drives but not write back to them. I would think that this is a feature set that should have a prevalent use as OS X becomes more and more integrated into the corporate world.

Aug 27, 2008 11:11 AM in response to oddio

As well the method described works exactly the same way as the Workgroup manager solution and the ACL modifying solution in that double clicking a .dmg will generate a 'no child process found' error and opening Disk Utility will generate a 'Unable to start Disk Utility background process' hanging error that requires a 'force quit'.

Solution awarded to KJ.

Aug 27, 2008 11:27 AM in response to oddio

this is actually quite different from the ACL suggestion. it also disables mounting of dmgs and external drives completely, does it not? I thought the goal was to only do it for nonadmin users and make the drives read only.

I wonder how workgroup manager actually handles this. the fact that it does means that it's possible somehow.

Aug 27, 2008 11:41 AM in response to V.K.

Indeed it does V.K. In fact I just managed to crash my machine by hitting eject key too many times with diskarbitrationd unloaded.

The ultimate solution is for non-admins not to be able to mount disk images and USB drives to be read only.

I'm going to give the Workgroup Manager a shot, but this is a far from ideal solution already. Either someone at Apple has greatly under estimated the usefulness of being able to configure this spectrum of events or its so far removed (or right under my nose) that I have yet to locate it.

Aug 27, 2008 12:04 PM in response to oddio

oddmyth wrote:
Indeed it does V.K. In fact I just managed to crash my machine by hitting eject key too many times with diskarbitrationd unloaded.

lol
The ultimate solution is for non-admins not to be able to mount disk images and USB drives to be read only.

one more question/comment. what will happen if you simply run /usr/sbin/diskarbitrationd in terminal with the launchdaemon unloaded? would it start the process anyway?

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

disable disk image mounting.

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.