Beyond Perimeter Defense

Traditional security focuses on “who” can enter. Modern macOS security focuses on “what” an application can do after it enters. This is achieved through The App Sandbox and TCC (Transparency, Consent, and Control).

The Sandbox Model

The Sandbox restricts an application’s access to system resources (files, network, hardware) based on a “entitlements” profile. Even if an app is compromised, it cannot access data outside its designated sandbox.

Visualizing the Sandbox Boundary:

      [ Operating System ]
      +---------------------------------+
      |                                 |
      |   [ App A ]        [ App B ]    |
      |   +---------+      +---------+  |
      |   | Sandbox |      | Sandbox |  |
      |   |  Zone   |      |  Zone   |  |
      |   +---------+      +---------+  |
      |       |                |        |
      |       v                v        |
      |  [ Allowed ]       [ Denied ]   |
      |  Data/Folder       Data/Folder  |
      +---------------------------------+

Entitlements

Developers request permissions via an Entitlements.plist file. As a security professional, you can inspect these entitlements to see what an app is capable of.

Example Command:

codesign -d --entitlements :- /Applications/SomeApp.app

Sample Output (Sanitized):

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "...">
<plist version="1.0">
<dict>
    <key>com.apple.security.app-sandbox</key>
    <true/>
    <key>com.apple.security.network.client</key>
    <true/>
    <key>com.apple.security.personal-information.photos-library</key>
    <true/>
</dict>
</plist>

While Sandbox restricts technical access, TCC handles user privacy (Camera, Microphone, Full Disk Access).

TCC decisions are stored in a SQLite database located at: /Library/Application Support/com.apple.TCC/TCC.db

Warning: Modifying this database directly requires Full Disk Access and is flagged by SIP. However, inspecting it allows admins to audit privacy permissions.

TCC Database Schema (Simplified):

Column Description
client Bundle ID of the requesting app
auth_value 0 (Denied), 2 (Allowed)
service e.g., kTCCServiceCamera, kTCCServiceSystemPolicyAllFiles

The Security Implication

If a malware author tricks a user into granting “Full Disk Access,” the sandbox is effectively useless for user data. Principle of Least Privilege is critical here. Always audit apps requesting Full Disk Access.

References

  1. The Mac Hacker’s Handbook, Chapter 7: The Sandbox.
  2. Apple Developer Documentation: App Sandbox.
  3. Wardle, P. (2021). The Art of Mac Malware.