Authorization Plugin Modification
Authorization plugins are used to extend the authorization services API and implement mechanisms that are not natively supported by the OS, such as multi-factor authentication with third party software. Adversaries may abuse this feature to persist and/or collect clear text credentials as they traverse the registered plugins during user logon.
Elastic rule (View on GitHub)
1[metadata]
2creation_date = "2021/01/13"
3integration = ["endpoint"]
4maturity = "production"
5updated_date = "2025/01/15"
6
7[rule]
8author = ["Elastic"]
9description = """
10Authorization plugins are used to extend the authorization services API and implement mechanisms that are not natively
11supported by the OS, such as multi-factor authentication with third party software. Adversaries may abuse this feature
12to persist and/or collect clear text credentials as they traverse the registered plugins during user logon.
13"""
14from = "now-9m"
15index = ["logs-endpoint.events.*"]
16language = "kuery"
17license = "Elastic License v2"
18name = "Authorization Plugin Modification"
19references = [
20 "https://developer.apple.com/documentation/security/authorization_plug-ins",
21 "https://www.xorrior.com/persistent-credential-theft/",
22]
23risk_score = 47
24rule_id = "e6c98d38-633d-4b3e-9387-42112cd5ac10"
25setup = """## Setup
26
27This rule requires data coming in from Elastic Defend.
28
29### Elastic Defend Integration Setup
30Elastic 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.
31
32#### Prerequisite Requirements:
33- Fleet is required for Elastic Defend.
34- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
35
36#### The following steps should be executed in order to add the Elastic Defend integration on a macOS System:
37- Go to the Kibana home page and click "Add integrations".
38- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
39- Click "Add Elastic Defend".
40- Configure the integration name and optionally add a description.
41- Select the type of environment you want to protect, for MacOS it is recommended to select "Traditional Endpoints".
42- 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).
43- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
44- 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.
45For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/current/agent-policy.html).
46- Click "Save and Continue".
47- 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.
48For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
49"""
50severity = "medium"
51tags = [
52 "Domain: Endpoint",
53 "OS: macOS",
54 "Use Case: Threat Detection",
55 "Tactic: Persistence",
56 "Data Source: Elastic Defend",
57 "Resources: Investigation Guide",
58]
59timestamp_override = "event.ingested"
60type = "query"
61
62query = '''
63event.category:file and host.os.type:macos and not event.type:deletion and
64 file.path:(/Library/Security/SecurityAgentPlugins/* and
65 not (/Library/Security/SecurityAgentPlugins/KandjiPassport.bundle/* or /Library/Security/SecurityAgentPlugins/TeamViewerAuthPlugin.bundle/*)) and
66 not (process.name:shove and process.code_signature.trusted:true)
67'''
68note = """## Triage and analysis
69
70> **Disclaimer**:
71> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
72
73### Investigating Authorization Plugin Modification
74
75Authorization plugins in macOS extend authentication capabilities, enabling features like third-party multi-factor authentication. Adversaries may exploit these plugins to maintain persistence or capture credentials by modifying or adding unauthorized plugins. The detection rule identifies suspicious modifications by monitoring changes in specific plugin directories, excluding known legitimate plugins and trusted processes, thus highlighting potential unauthorized activities.
76
77### Possible investigation steps
78
79- Review the file path of the modified plugin to determine if it is located in the /Library/Security/SecurityAgentPlugins/ directory and verify if it is not among the known legitimate plugins like KandjiPassport.bundle or TeamViewerAuthPlugin.bundle.
80- Examine the process name associated with the modification event to ensure it is not 'shove' with a trusted code signature, as these are excluded from the detection rule.
81- Investigate the history of the modified plugin file to identify when it was created or last modified and by which user or process, to assess if the change aligns with expected administrative activities.
82- Check for any recent user logon events that might correlate with the timing of the plugin modification to identify potential unauthorized access attempts.
83- Analyze any associated network activity or connections from the host around the time of the modification to detect possible data exfiltration or communication with external command and control servers.
84- Review system logs for any other suspicious activities or anomalies that occurred around the same time as the plugin modification to gather additional context on the potential threat.
85
86### False positive analysis
87
88- Known legitimate plugins such as KandjiPassport.bundle and TeamViewerAuthPlugin.bundle may trigger alerts if they are updated or modified. Users can handle these by ensuring these plugins are included in the exclusion list within the detection rule.
89- Trusted processes like those signed by a verified code signature, such as the process named 'shove', might be flagged if they interact with the plugin directories. Users should verify the code signature and add these processes to the trusted list to prevent false positives.
90- System updates or legitimate software installations may cause temporary changes in the plugin directories. Users should monitor for these events and temporarily adjust the detection rule to exclude these known activities during the update period.
91- Custom or in-house developed plugins that are not widely recognized may be flagged. Users should ensure these plugins are properly documented and added to the exclusion list if they are verified as safe and necessary for business operations.
92
93### Response and remediation
94
95- Immediately isolate the affected macOS system from the network to prevent potential lateral movement or further unauthorized access.
96- Review and terminate any suspicious processes associated with unauthorized plugins, especially those not signed by a trusted code signature.
97- Remove any unauthorized or suspicious plugins from the /Library/Security/SecurityAgentPlugins/ directory to eliminate persistence mechanisms.
98- Conduct a thorough credential audit for any accounts that may have been compromised, and enforce a password reset for affected users.
99- Escalate the incident to the security operations team for further investigation and to determine if additional systems are affected.
100- Implement additional monitoring on the affected system and similar endpoints to detect any further unauthorized plugin modifications.
101- Review and update security policies to ensure only authorized personnel can modify or add authorization plugins, and consider implementing stricter access controls."""
102
103
104[[rule.threat]]
105framework = "MITRE ATT&CK"
106[[rule.threat.technique]]
107id = "T1547"
108name = "Boot or Logon Autostart Execution"
109reference = "https://attack.mitre.org/techniques/T1547/"
110[[rule.threat.technique.subtechnique]]
111id = "T1547.002"
112name = "Authentication Package"
113reference = "https://attack.mitre.org/techniques/T1547/002/"
114
115
116
117[rule.threat.tactic]
118id = "TA0003"
119name = "Persistence"
120reference = "https://attack.mitre.org/tactics/TA0003/"
Triage and analysis
Disclaimer: This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
Investigating Authorization Plugin Modification
Authorization plugins in macOS extend authentication capabilities, enabling features like third-party multi-factor authentication. Adversaries may exploit these plugins to maintain persistence or capture credentials by modifying or adding unauthorized plugins. The detection rule identifies suspicious modifications by monitoring changes in specific plugin directories, excluding known legitimate plugins and trusted processes, thus highlighting potential unauthorized activities.
Possible investigation steps
- Review the file path of the modified plugin to determine if it is located in the /Library/Security/SecurityAgentPlugins/ directory and verify if it is not among the known legitimate plugins like KandjiPassport.bundle or TeamViewerAuthPlugin.bundle.
- Examine the process name associated with the modification event to ensure it is not 'shove' with a trusted code signature, as these are excluded from the detection rule.
- Investigate the history of the modified plugin file to identify when it was created or last modified and by which user or process, to assess if the change aligns with expected administrative activities.
- Check for any recent user logon events that might correlate with the timing of the plugin modification to identify potential unauthorized access attempts.
- Analyze any associated network activity or connections from the host around the time of the modification to detect possible data exfiltration or communication with external command and control servers.
- Review system logs for any other suspicious activities or anomalies that occurred around the same time as the plugin modification to gather additional context on the potential threat.
False positive analysis
- Known legitimate plugins such as KandjiPassport.bundle and TeamViewerAuthPlugin.bundle may trigger alerts if they are updated or modified. Users can handle these by ensuring these plugins are included in the exclusion list within the detection rule.
- Trusted processes like those signed by a verified code signature, such as the process named 'shove', might be flagged if they interact with the plugin directories. Users should verify the code signature and add these processes to the trusted list to prevent false positives.
- System updates or legitimate software installations may cause temporary changes in the plugin directories. Users should monitor for these events and temporarily adjust the detection rule to exclude these known activities during the update period.
- Custom or in-house developed plugins that are not widely recognized may be flagged. Users should ensure these plugins are properly documented and added to the exclusion list if they are verified as safe and necessary for business operations.
Response and remediation
- Immediately isolate the affected macOS system from the network to prevent potential lateral movement or further unauthorized access.
- Review and terminate any suspicious processes associated with unauthorized plugins, especially those not signed by a trusted code signature.
- Remove any unauthorized or suspicious plugins from the /Library/Security/SecurityAgentPlugins/ directory to eliminate persistence mechanisms.
- Conduct a thorough credential audit for any accounts that may have been compromised, and enforce a password reset for affected users.
- Escalate the incident to the security operations team for further investigation and to determine if additional systems are affected.
- Implement additional monitoring on the affected system and similar endpoints to detect any further unauthorized plugin modifications.
- Review and update security policies to ensure only authorized personnel can modify or add authorization plugins, and consider implementing stricter access controls.
References
Related rules
- Attempt to Enable the Root Account
- Bash Shell Profile Modification
- Modification of Standard Authentication Module or Configuration
- Persistence via DirectoryService Plugin Modification
- Persistence via Docker Shortcut Modification