Attempt to Remove File Quarantine Attribute

edit

Identifies a potential Gatekeeper bypass. In macOS, when applications or programs are downloaded from the internet, there is a quarantine flag set on the file. This attribute is read by Apple’s Gatekeeper defense program at execution time. An adversary may disable this attribute to evade defenses.

Rule type: eql

Rule indices:

  • auditbeat-*
  • logs-endpoint.events.*

Severity: medium

Risk score: 47

Runs every: 5 minutes

Searches indices from: now-9m (Date Math format, see also Additional look-back time)

Maximum alerts per execution: 100

References:

Tags:

  • Elastic
  • Host
  • macOS
  • Threat Detection
  • Defense Evasion

Version: 6 (version history)

Added (Elastic Stack release): 7.11.0

Last modified (Elastic Stack release): 8.4.0

Rule authors: Elastic

Rule license: Elastic License v2

Investigation guide

edit

Rule query

edit
process where event.type in ("start", "process_started") and
process.name : "xattr" and ( (process.args :
"com.apple.quarantine" and process.args : ("-d", "-w")) or
(process.args : "-c") or (process.command_line : ("/bin/bash -c
xattr -c *", "/bin/zsh -c xattr -c *", "/bin/sh -c xattr -c *")) )
and not process.args_count > 12

Threat mapping

edit

Framework: MITRE ATT&CKTM

Rule version history

edit
Version 6 (8.4.0 release)
  • Updated query, changed from:

    process where event.type in ("start", "process_started") and
    process.args : "xattr" and ( (process.args :
    "com.apple.quarantine" and process.args : ("-d", "-w")) or
    (process.args : "-c" and process.command_line : (
    "/bin/bash -c xattr -c *", "/bin/zsh -c xattr -c *",
    "/bin/sh -c xattr -c *" ) ) )
Version 4 (8.2.0 release)
  • Formatting only
Version 3 (7.12.0 release)
  • Updated query, changed from:

    process where event.type in ("start", "process_started") and
    process.name == "xattr" and process.args == "com.apple.quarantine" and
    process.args == "-d"
Version 2 (7.11.2 release)
  • Formatting only