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

References

Related rules

to-top