Suspicious Calendar File Modification

Identifies suspicious modifications of the calendar file by an unusual process. Adversaries may create a custom calendar notification procedure to execute a malicious program at a recurring interval to establish persistence.

Elastic rule (View on GitHub)

 1[metadata]
 2creation_date = "2021/01/19"
 3integration = ["endpoint"]
 4maturity = "production"
 5min_stack_comments = "New fields added: required_fields, related_integrations, setup"
 6min_stack_version = "8.3.0"
 7updated_date = "2023/11/15"
 8
 9[rule]
10author = ["Elastic"]
11description = """
12Identifies suspicious modifications of the calendar file by an unusual process. Adversaries may create a custom calendar
13notification procedure to execute a malicious program at a recurring interval to establish persistence.
14"""
15false_positives = ["Trusted applications for managing calendars and reminders."]
16from = "now-9m"
17index = ["logs-endpoint.events.*"]
18language = "kuery"
19license = "Elastic License v2"
20name = "Suspicious Calendar File Modification"
21references = [
22    "https://labs.f-secure.com/blog/operationalising-calendar-alerts-persistence-on-macos",
23    "https://github.com/FSecureLABS/CalendarPersist",
24    "https://github.com/D00MFist/PersistentJXA/blob/master/CalendarPersist.js",
25]
26risk_score = 47
27rule_id = "cb71aa62-55c8-42f0-b0dd-afb0bb0b1f51"
28setup = """## Setup
29
30This rule requires data coming in from Elastic Defend.
31
32### Elastic Defend Integration Setup
33Elastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.
34
35#### Prerequisite Requirements:
36- Fleet is required for Elastic Defend.
37- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
38
39#### The following steps should be executed in order to add the Elastic Defend integration on a macOS System:
40- Go to the Kibana home page and click "Add integrations".
41- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
42- Click "Add Elastic Defend".
43- Configure the integration name and optionally add a description.
44- Select the type of environment you want to protect, for MacOS it is recommended to select "Traditional Endpoints".
45- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).
46- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
47- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
48For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/current/agent-policy.html).
49- Click "Save and Continue".
50- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.
51For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
52"""
53severity = "medium"
54tags = ["Domain: Endpoint", "OS: macOS", "Use Case: Threat Detection", "Tactic: Persistence", "Data Source: Elastic Defend"]
55timestamp_override = "event.ingested"
56type = "query"
57
58query = '''
59event.category:file and host.os.type:macos and event.action:modification and
60  file.path:/Users/*/Library/Calendars/*.calendar/Events/*.ics and
61  process.executable:
62  (* and not
63    (
64      /System/Library/* or
65      /System/Applications/Calendar.app/Contents/MacOS/* or
66      /System/Applications/Mail.app/Contents/MacOS/Mail or
67      /usr/libexec/xpcproxy or
68      /sbin/launchd or
69      /Applications/*
70    )
71  )
72'''
73
74
75[[rule.threat]]
76framework = "MITRE ATT&CK"
77[[rule.threat.technique]]
78id = "T1546"
79name = "Event Triggered Execution"
80reference = "https://attack.mitre.org/techniques/T1546/"
81
82
83[rule.threat.tactic]
84id = "TA0003"
85name = "Persistence"
86reference = "https://attack.mitre.org/tactics/TA0003/"

References

Related rules

to-top