macOS operating system internals for detection engineering — process model (XPC, launchd, posix_spawn), TCC (Transparency, Consent, and Control) framework, Gatekeeper and notarisation, code signing enforcement, System Extensions vs kernel extensions, Endpoint Security framework, persistence locations (LaunchAgents, LaunchDaemons, login items), Keychain access, and the mapping between macOS operations and EDR telemetry. Use when authoring detections targeting macOS endpoints.
Installation
Mit Codex oder Claude installieren Kopieren Sie diesen Prompt, fügen Sie ihn in Codex, Claude oder einen anderen Assistant ein und lassen Sie die Skill-Seite prüfen und installieren.
macOS operating system internals for detection engineering — process model (XPC, launchd, posix_spawn), TCC (Transparency, Consent, and Control) framework, Gatekeeper and notarisation, code signing enforcement, System Extensions vs kernel extensions, Endpoint Security framework, persistence locations (LaunchAgents, LaunchDaemons, login items), Keychain access, and the mapping between macOS operations and EDR telemetry. Use when authoring detections targeting macOS endpoints.
macOS Internals — detection-relevant knowledge
This skill encodes how macOS works at the level needed to write detections for macOS endpoints. macOS has fundamentally different security architecture from Windows and Linux — detections cannot be ported without understanding these differences.
1. Process model
Process creation
macOS uses posix_spawn() (preferred) or fork()/exec() for process creation. Key differences from Windows:
Concept
macOS
Windows equivalent
Detection relevance
launchd (PID 1)
Init system, manages all services
SCM + Task Scheduler
Parent of all system services. Unexpected launchd children are suspicious.
XPC services
Inter-process communication framework
COM/DCOM
Sandboxed helper processes. XPC service abuse = privilege escalation.
App bundles
.app directories with Info.plist
.exe files
Malware can hide in app bundle resources
Universal binaries
Fat binaries with multiple architectures
N/A
Can contain both x86_64 and arm64 code
Rosetta 2
x86_64 translation on Apple Silicon
WoW64
x86_64 processes on arm64 hardware — unusual for native apps
Process hierarchy
launchd (PID 1)
├── System services (LaunchDaemons)
├── Per-user launchd
│ ├── User services (LaunchAgents)
│ ├── Applications
│ └── Login items
└── Kernel extensions / System Extensions
2. TCC (Transparency, Consent, and Control)
TCC controls access to sensitive resources. Applications must be granted permission via user consent or MDM profile.
TCC-protected resource
What it controls
Detection relevance
Full Disk Access
Read all files including protected locations
Required for EDR sensors. Malware seeking FDA = high-signal.
Screen Recording
Capture screen content
Spyware indicator
Accessibility
Control other applications
Keylogging, UI manipulation
Camera / Microphone
Audio/video capture
Surveillance
Contacts / Calendar / Photos
Personal data access
Data theft
Location Services
GPS/Wi-Fi location
Tracking
Automation (AppleScript)
Control other apps via AppleScript
Scripted attacks
TCC database
Permissions stored in ~/Library/Application Support/com.apple.TCC/TCC.db (user) and /Library/Application Support/com.apple.TCC/TCC.db (system).
Detection: Direct TCC database modification (bypassing the consent UI) is a known attack technique. Monitor for sqlite3 or other processes writing to TCC.db.
TCC bypass techniques
Technique
Mechanism
Detection signal
TCC.db manipulation
Direct SQLite modification
Process accessing TCC.db that isn't tccd
FDA app abuse
Inject into an app that already has FDA
Code injection into FDA-granted process
MDM profile
Deploy TCC profile via MDM
New configuration profile installation
Mounting TCC.db
Mount a modified TCC.db over the original
Mount operations targeting TCC paths
3. Gatekeeper and notarisation
Layer
What it does
Bypass detection
Gatekeeper
Blocks unsigned/unnotarised apps from running
xattr -d com.apple.quarantine removes quarantine flag
Notarisation
Apple scans app for malware before issuing a ticket
Unnotarised app execution (requires user override)
Quarantine flag
com.apple.quarantine extended attribute on downloaded files
Key gap: macOS EDR coverage is generally less comprehensive than Windows. Process tree depth is full, but registry-equivalent (plist) monitoring, DLL-equivalent (dylib) loading, and script content capture vary significantly by vendor.
9. macOS-specific attack techniques
Technique
Mechanism
Detection signal
DYLD_INSERT_LIBRARIES
Environment variable forces dylib loading
Process with DYLD_INSERT_LIBRARIES set (blocked by Hardened Runtime)
Dylib hijacking
Place malicious dylib in app's @rpath
Dylib loaded from unexpected path
AppleScript abuse
osascript executing AppleScript for automation
osascript spawning unexpected child processes
JXA (JavaScript for Automation)
JavaScript executed via osascript -l JavaScript
JXA execution from non-IDE context
Installer package abuse
.pkg with pre/post-install scripts
installer process spawning shell commands
Profile installation
MDM-style configuration profiles
New profile in /Library/Managed Preferences/
10. Quality checklist
Detection accounts for macOS-specific process model (launchd, XPC).
TCC permissions considered (does the detection require FDA?).
Code signing status checked (Apple-signed, Developer ID, ad-hoc, unsigned).