User Added to the Admin Group

Identifies users being added to the admin group. This could be an indication of privilege escalation activity.

Elastic rule (View on GitHub)

  1[metadata]
  2creation_date = "2024/09/12"
  3integration = ["jamf_protect"]
  4maturity = "production"
  5min_stack_comments = "The jamf integration is available for stack versions 8.12 and above"
  6min_stack_version = "8.12.0"
  7updated_date = "2024/09/12"
  8
  9[transform]
 10[[transform.investigate]]
 11label = "Show events after Privilege Escalation"
 12relativeFrom = "now"
 13relativeTo = "now+30m"
 14providers = [
 15  [
 16    {field = "host.hostname", excluded = false, queryType = "phrase", value = "{{host.hostname}}", valueType = "string"}
 17  ]
 18]
 19
 20[[transform.investigate]]
 21label = "Show events having the same reponsible process"
 22providers = [
 23  [
 24    {field = "host.hostname", excluded = false, queryType = "phrase", value = "{{host.hostname}}", valueType = "string"},
 25    {field = "process.entity_id", excluded = false, queryType = "phrase", value = "{{process.group_leader.entity_id}}", valueType = "string"}
 26  ]
 27]
 28
 29[[transform.investigate]]
 30label = "Show events having the same parent process"
 31providers = [
 32  [
 33    {field = "host.hostname", excluded = false, queryType = "phrase", value = "{{host.hostname}}", valueType = "string"},
 34    {field = "process.entity_id", excluded = false, queryType = "phrase", value = "{{process.parent.entity_id}}", valueType = "string"}
 35  ]
 36]
 37
 38[rule]
 39author = ["Thijs Xhaflaire"]
 40description = """
 41Identifies users being added to the admin group. This could be an indication of privilege
 42escalation activity.
 43"""
 44from = "now-9m"
 45index = ["logs-jamf_protect*"]
 46language = "eql"
 47license = "Elastic License v2"
 48name = "User Added to the Admin Group"
 49references = [
 50    "https://www.loobins.io/binaries/dscl/",
 51    "https://managingosx.wordpress.com/2010/01/14/add-a-user-to-the-admin-group-via-command-line-3-0/"
 52]
 53note = """## Triage and analysis
 54
 55To thoroughly investigate the actions that occurred **after a user was elevated to administrator**, it's essential to conduct a search on the Timeline. This allows you to review and understand the sequence of events that followed the elevation, helping to identify any potentially malicious or unauthorized activities that might have taken place. **Analyzing these actions is crucial for maintaining security and ensuring that the elevation was not exploited for harmful purposes.**
 56
 57> **Note**:
 58> This investigation guide uses the [Investigate Markdown Plugin](https://www.elastic.co/guide/en/security/master/interactive-investigation-guides.html) introduced in Elastic Stack version 8.8.0. Older Elastic Stack versions will display unrendered Markdown in this guide.
 59
 60**Consider reviewing these actions:**
 61
 62- Have persistency items been added?
 63- Is any software installed after elevation?
 64- Were any additional users created after elevation?
 65
 66$investigate_0
 67$investigate_1
 68$investigate_2
 69"""
 70risk_score = 21
 71rule_id = "04e65517-16e9-4fc4-b7f1-94dc21ecea0d"
 72setup = """## Setup
 73
 74This rule requires data coming in from Jamf Protect.
 75
 76### Jamf Protect Integration Setup
 77Jamf Protect is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events incoming events and send data to the Elastic.
 78
 79#### Prerequisite Requirements:
 80- Fleet is required for Jamf Protect.
 81- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
 82
 83#### The following steps should be executed in order to add the Jamf Protect integration:
 84- Go to the Kibana home page and click "Add integrations".
 85- In the query bar, search for "Jamf Protect" and select the integration to see more details about it.
 86- Click "Add Jamf Protect".
 87- Configure the integration name.
 88- Click "Save and Continue".
 89"""
 90severity = "low"
 91tags = [
 92    "Domain: Endpoint",
 93    "OS: macOS",
 94    "Use Case: Threat Detection",
 95    "Tactic: Privilege Escalation",
 96    "Data Source: Jamf Protect",
 97]
 98timestamp_override = "event.ingested"
 99type = "eql"
100
101query = '''
102configuration where host.os.type == "macos" and event.type == "change" and
103  event.action == "od_group_add" and group.name:"admin"
104'''
105
106
107[[rule.threat]]
108framework = "MITRE ATT&CK"
109[[rule.threat.technique]]
110id = "T1078"
111name = "Valid Accounts"
112reference = "https://attack.mitre.org/techniques/T1078/"
113[[rule.threat.technique.subtechnique]]
114id = "T1078.003"
115name = "Local Accounts"
116reference = "https://attack.mitre.org/techniques/T1078/003/"
117
118
119
120[rule.threat.tactic]
121id = "TA0004"
122name = "Privilege Escalation"
123reference = "https://attack.mitre.org/tactics/TA0004/"

Triage and analysis

To thoroughly investigate the actions that occurred after a user was elevated to administrator, it's essential to conduct a search on the Timeline. This allows you to review and understand the sequence of events that followed the elevation, helping to identify any potentially malicious or unauthorized activities that might have taken place. Analyzing these actions is crucial for maintaining security and ensuring that the elevation was not exploited for harmful purposes.

Note: This investigation guide uses the Investigate Markdown Plugin introduced in Elastic Stack version 8.8.0. Older Elastic Stack versions will display unrendered Markdown in this guide.

Consider reviewing these actions:

  • Have persistency items been added?
  • Is any software installed after elevation?
  • Were any additional users created after elevation?

$investigate_0 $investigate_1 $investigate_2

References

Related rules

to-top