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"
  5updated_date = "2024/12/09"
  6
  7[transform]
  8[[transform.investigate]]
  9label = "Show events after Privilege Escalation"
 10providers = [
 11  [
 12    { excluded = false, field = "host.hostname", queryType = "phrase", value = "{{host.hostname}}", valueType = "string" }
 13  ]
 14]
 15relativeFrom = "now"
 16relativeTo = "now+30m"
 17
 18[[transform.investigate]]
 19label = "Show events having the same reponsible process"
 20providers = [
 21  [
 22    { excluded = false, field = "host.hostname", queryType = "phrase", value = "{{host.hostname}}", valueType = "string" },
 23    { excluded = false, field = "process.entity_id", queryType = "phrase", value = "{{process.group_leader.entity_id}}", valueType = "string" }
 24  ]
 25]
 26
 27[[transform.investigate]]
 28label = "Show events having the same parent process"
 29providers = [
 30  [
 31    { excluded = false, field = "host.hostname", queryType = "phrase", value = "{{host.hostname}}", valueType = "string" },
 32    { excluded = false, field = "process.entity_id", queryType = "phrase", value = "{{process.parent.entity_id}}", valueType = "string" }
 33  ]
 34]
 35
 36
 37[rule]
 38author = ["Thijs Xhaflaire"]
 39description = "Identifies users being added to the admin group. This could be an indication of privilege\nescalation activity.\n"
 40from = "now-9m"
 41index = ["logs-jamf_protect*"]
 42language = "eql"
 43license = "Elastic License v2"
 44name = "User Added to the Admin Group"
 45note = """## Triage and analysis
 46
 47To 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.**
 48
 49> **Note**:
 50> 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.
 51
 52**Consider reviewing these actions:**
 53
 54- Have persistency items been added?
 55- Is any software installed after elevation?
 56- Were any additional users created after elevation?
 57
 58$investigate_0
 59$investigate_1
 60$investigate_2
 61"""
 62references = [
 63    "https://www.loobins.io/binaries/dscl/",
 64    "https://managingosx.wordpress.com/2010/01/14/add-a-user-to-the-admin-group-via-command-line-3-0/",
 65]
 66risk_score = 21
 67rule_id = "04e65517-16e9-4fc4-b7f1-94dc21ecea0d"
 68setup = """## Setup
 69
 70This rule requires data coming in from Jamf Protect.
 71
 72### Jamf Protect Integration Setup
 73Jamf 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.
 74
 75#### Prerequisite Requirements:
 76- Fleet is required for Jamf Protect.
 77- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
 78
 79#### The following steps should be executed in order to add the Jamf Protect integration:
 80- Go to the Kibana home page and click "Add integrations".
 81- In the query bar, search for "Jamf Protect" and select the integration to see more details about it.
 82- Click "Add Jamf Protect".
 83- Configure the integration name.
 84- Click "Save and Continue".
 85"""
 86severity = "low"
 87tags = [
 88    "Domain: Endpoint",
 89    "OS: macOS",
 90    "Use Case: Threat Detection",
 91    "Tactic: Privilege Escalation",
 92    "Data Source: Jamf Protect",
 93]
 94timestamp_override = "event.ingested"
 95type = "eql"
 96
 97query = '''
 98configuration where host.os.type == "macos" and event.type == "change" and
 99  event.action == "od_group_add" and group.name:"admin"
100'''
101
102
103[[rule.threat]]
104framework = "MITRE ATT&CK"
105[[rule.threat.technique]]
106id = "T1078"
107name = "Valid Accounts"
108reference = "https://attack.mitre.org/techniques/T1078/"
109[[rule.threat.technique.subtechnique]]
110id = "T1078.003"
111name = "Local Accounts"
112reference = "https://attack.mitre.org/techniques/T1078/003/"
113
114
115
116[rule.threat.tactic]
117id = "TA0004"
118name = "Privilege Escalation"
119reference = "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