Cross-source coverage

T1553.001 / ATT&CK

Subvert Trust Controls: Gatekeeper Bypass

12 rules across 4 sources.

From MITRE ATT&CK 19.2

Adversaries may modify file attributes and subvert Gatekeeper functionality to evade user prompts and execute untrusted programs. Gatekeeper is a set of technologies that act as layer of Apple’s security model to ensure only trusted applications are executed on a host. Gatekeeper was built on top of File Quarantine in Snow Leopard (10.6, 2009) and has grown to include Code Signing, security policy compliance, Notarization, and more. Gatekeeper also treats applications running for the first time differently than reopened applications.

Based on an opt-in system, when files are downloaded an extended attribute (xattr) called com.apple.quarantine (also known as a quarantine flag) can be set on the file by the application performing the download. Launch Services opens the application in a suspended state. For first run applications with the quarantine flag set, Gatekeeper executes the following functions:

  1. Checks extended attribute – Gatekeeper checks for the quarantine flag, then provides an alert prompt to the user to allow or deny execution.

  2. Checks System Policies - Gatekeeper checks the system security policy, allowing execution of apps downloaded from either just the App Store or the App Store and identified developers.

  3. Code Signing – Gatekeeper checks for a valid code signature from an Apple Developer ID.

  4. Notarization - Using the api.apple-cloudkit.com API, Gatekeeper reaches out to Apple servers to verify or pull down the notarization ticket and ensure the ticket is not revoked. Users can override notarization, which will result in a prompt of executing an “unauthorized app” and the security policy will be modified.

Adversaries can subvert one or multiple security controls within Gatekeeper checks through logic errors (e.g. Exploitation for Stealth), unchecked file types, and external libraries. For example, prior to macOS 13 Ventura, code signing and notarization checks were only conducted on first launch, allowing adversaries to write malicious executables to previously opened applications in order to bypass Gatekeeper security checks.

Applications and files loaded onto the system from a USB flash drive, optical disk, external hard drive, from a drive shared over the local network, or using the curl command may not set the quarantine flag. Additionally, it is possible to avoid setting the quarantine flag using Drive-by Compromise.

Platforms
macOS
Telemetry
macos:unifiedlogmacos:osquery

How MITRE says to detect it DET0288

Detect Gatekeeper Bypass via Quarantine Flag and Trust Control Manipulation

macOS Analytic 0800

Correlates suspicious removal or modification of the com.apple.quarantine extended attribute, manipulation of LSFileQuarantineEnabled values in Info.plist, and unexpected process execution of unsigned or non-notarized binaries. Also monitors abnormal trust validation failures in unified logs and unusual activity in QuarantineEvents database entries.

  • macos:unifiedlog xattr -d com.apple.quarantine or similar attribute removal commands
  • macos:unifiedlog Trust validation failures or bypass attempts during notarization and code signing checks
  • macos:osquery Changes to LSFileQuarantineEnabled field in Info.plist

elastic/detection-rules

5 rules
Detection Severity Format
Gatekeeper Override and Execution High Elastic TOML
Suspicious Curl from macOS Application High Elastic TOML
Suspicious Outbound Network Connection via Unsigned Binary High Elastic TOML
Attempt to Disable Gatekeeper Medium Elastic TOML
Quarantine Attrib Removed by Unsigned or Untrusted Process Medium Elastic TOML

elastic/protections-artifacts

5 rules
Detection Severity Format
Potential Payload Download via AppleScript Applet Undefined Elastic TOML
Quarantine Attribute Deleted via Untrusted Binary Undefined Elastic TOML
Quarantine Attribute Removal via TextEdit Undefined Elastic TOML
Quarantine Cleared via Xattr Followed by Ad-hoc Codesign Undefined Elastic TOML
Suspicious File Quarantine Removal via Find Undefined Elastic TOML

SigmaHQ/sigma

1 rule
Detection Severity Format
Gatekeeper Bypass via Xattr Low Sigma

splunk/security_content

1 rule
Detection Severity Format
MacOS Gatekeeper Bypass Undefined SPL

Detection rules belong to the projects that publish them and remain under their own licenses. This site indexes and links to them; it claims no rights in them.