logoalt Hacker News

mike_hearnyesterday at 8:15 AM2 repliesview on HN

> Any program I run is allowed to silently edit, delete or steal anything I own ... there's currently no desktop environment that provides that ability

Putting aside the philosophical issues, that statement isn't true for a few years now. It's not well known, even in very technical circles like HN, but macOS actually sandboxes every app:

• All apps from outside the app store are always sandboxed to a lesser degree, even if they are old and don't opt-in.

• All apps from outside the app store may opt in to stricter sandboxing for security hardening purposes.

• All apps from the app store are forced to opt-in, must declare their permissions in a fine grained way, and Apple reviews them to make sure they make sense.

To see this is true try downloading a terminal emulator you haven't used before, and then use it to navigate into your Downloads, Photos, Documents etc folders and run "ls". You'll get a permission prompt from the OS telling you the app is requesting access to that folder. If you click deny, ls will return a permission error.

Now try using vim to edit the Info.plist file of something in /Applications. ls will tell you that you have UNIX write permissions, but you'll find you can't actually edit the file. The kernel blocks apps from tampering with each other's files.

Finally, go into the settings and privacy/security area. You can now enable full disk access for the terminal emulator, or a finer grained permission like managing apps. Restart the terminal and permissions work like you'd expect for UNIX again.

Note that you won't see any permission popup in a GUI app if you open the file via the file picker dialog box. That's because the dialog box is a "powerbox" controlled by the OS, so the act of picking the file grants the app permission implicitly. Same for drag and drop, opening via the finder, etc. The permission prompt only appears when an app directly uses syscalls to open a file without some OS-controlled GUI interaction taking place.

So, if you want a desktop OS with a strong sandbox that you actually control, and which has good usability, and a high level of security too, then you should be using macOS. It's the only OS that has managed this transition to all-sandboxed-all-the-time.


Replies

NoGravitastoday at 4:17 PM

> It's the only OS that has managed this transition to all-sandboxed-all-the-time.

Depending on how broadly you define [desktop] OS. There are immutable Linux distributions like Fedora Silverblue or Kinoite where all user apps are run from Flatpak, and so have sandboxing. I'd say it's less mature than MacOS but it's catching up.

hollerithyesterday at 11:37 PM

>It's the only OS that has managed this transition to all-sandboxed-all-the-time.

Apps are all-sandboxed-all-the-time on iOS and Android, too; right?

show 1 reply