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 = "2026/10/26"
  6[transform]
  7[[transform.investigate]]
  8label = "Show events having the same responsible process"
  9providers = [
 10  [
 11    { excluded = false, field = "host.hostname", queryType = "phrase", value = "{{host.hostname}}", valueType = "string" },
 12    { excluded = false, field = "process.entity_id", queryType = "phrase", value = "{{process.responsible.entity_id}}", valueType = "string" }
 13  ]
 14]
 15
 16[[transform.investigate]]
 17label = "Show events having the same parent process"
 18providers = [
 19  [
 20    { excluded = false, field = "host.hostname", queryType = "phrase", value = "{{host.hostname}}", valueType = "string" },
 21    { excluded = false, field = "process.entity_id", queryType = "phrase", value = "{{process.parent.entity_id}}", valueType = "string" }
 22  ]
 23]
 24
 25
 26[rule]
 27author = ["Thijs Xhaflaire"]
 28description = "Identifies users being added to the admin group. This could be an indication of privilege\nescalation activity.\n"
 29from = "now-9m"
 30index = ["logs-jamf_protect*"]
 31language = "eql"
 32license = "Elastic License v2"
 33name = "User Added to the Admin Group"
 34note = """## Triage and analysis
 35
 36> **Disclaimer**:
 37> 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.
 38
 39### Investigating User Added to the Admin Group
 40
 41Members of the macOS `admin` group can use `sudo`, install software, and change system-wide settings. Adversaries who gain a foothold may add an account they control to this group, using tools such as `dscl` or `dseditgroup`, to escalate privileges or keep privileged access. This rule uses Jamf Protect telemetry to alert when a user is added to the `admin` group.
 42
 43### Possible investigation steps
 44
 45- Identify the account that was added to the `admin` group (`user.name`) and the account that performed the change (`process.user.name`), and confirm whether the change was requested or approved.
 46- Review the process that made the change (`process.executable`, for example `dscl`, `dseditgroup`, `sysadminctl`, or System Settings), its parent (`process.parent.executable`), and its responsible process (`process.responsible.executable`) to determine whether the change was interactive or scripted.
 47  - $investigate_0
 48  - $investigate_1
 49- Determine whether the added account was recently created, and whether it is hidden or has an unusual name or UID.
 50- Search the timeline for activity that followed the elevation, such as new persistence items (LaunchAgents, LaunchDaemons, login items), software installation, additional user creation, or security setting changes.
 51- Review authentication activity for the added account, including remote logins over SSH or Screen Sharing.
 52- Review other alerts for the same host to identify the initial access or execution activity that preceded the group change.
 53
 54### False positive analysis
 55
 56- IT administrators, device management solutions, and privilege management tools legitimately add users to the `admin` group during provisioning or temporary elevation. Verify the change against change tickets or the expected management workflow.
 57- When the activity is confirmed benign, create an exception for the specific management process or service account rather than for the `admin` group.
 58
 59### Response and remediation
 60
 61- Remove the account from the `admin` group if the change was not authorized.
 62- Disable or delete the account if it was created by the attacker, and reset the credentials of any compromised legitimate account.
 63- Review and revert changes made with the elevated privileges, such as persistence items, installed software, and modified security settings.
 64- Isolate the host if follow-on malicious activity is identified.
 65- Investigate how the attacker obtained the privileges required to modify group membership and remediate the initial access vector.
 66- Escalate to the incident response team and check other macOS hosts for similar group membership changes.
 67"""
 68references = [
 69    "https://www.loobins.io/binaries/dscl/",
 70    "https://managingosx.wordpress.com/2010/01/14/add-a-user-to-the-admin-group-via-command-line-3-0/",
 71]
 72risk_score = 21
 73rule_id = "04e65517-16e9-4fc4-b7f1-94dc21ecea0d"
 74setup = """## Setup
 75
 76This rule requires data coming in from Jamf Protect.
 77
 78### Jamf Protect Integration Setup
 79Jamf 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.
 80
 81#### Prerequisite Requirements:
 82- Fleet is required for Jamf Protect.
 83- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
 84
 85#### The following steps should be executed in order to add the Jamf Protect integration:
 86- Go to the Kibana home page and click "Add integrations".
 87- In the query bar, search for "Jamf Protect" and select the integration to see more details about it.
 88- Click "Add Jamf Protect".
 89- Configure the integration name.
 90- Click "Save and Continue".
 91"""
 92severity = "low"
 93tags = [
 94    "Domain: Endpoint",
 95    "OS: macOS",
 96    "Use Case: Threat Detection",
 97    "Tactic: Privilege Escalation",
 98    "Data Source: Jamf Protect",
 99    "Resources: Investigation Guide",
100    "Noise: Low",
101    "Performance: Fast",
102    "Rule Type: Event Correlation (EQL)",
103    "Platform: macOS",
104]
105timestamp_override = "event.ingested"
106type = "eql"
107
108query = '''
109configuration where host.os.type == "macos" and event.type == "change" and
110  event.action == "od_group_add" and group.name:"admin"
111'''
112
113
114[[rule.threat]]
115framework = "MITRE ATT&CK"
116
117[[rule.threat.technique]]
118id = "T1078"
119name = "Valid Accounts"
120reference = "https://attack.mitre.org/techniques/T1078/"
121
122[[rule.threat.technique.subtechnique]]
123id = "T1078.003"
124name = "Local Accounts"
125reference = "https://attack.mitre.org/techniques/T1078/003/"
126
127[[rule.threat.technique]]
128id = "T1098"
129name = "Account Manipulation"
130reference = "https://attack.mitre.org/techniques/T1098/"
131
132[[rule.threat.technique.subtechnique]]
133id = "T1098.007"
134name = "Additional Local or Domain Groups"
135reference = "https://attack.mitre.org/techniques/T1098/007/"
136
137[rule.threat.tactic]
138id = "TA0004"
139name = "Privilege Escalation"
140reference = "https://attack.mitre.org/tactics/TA0004/"

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 User Added to the Admin Group

Members of the macOS admin group can use sudo, install software, and change system-wide settings. Adversaries who gain a foothold may add an account they control to this group, using tools such as dscl or dseditgroup, to escalate privileges or keep privileged access. This rule uses Jamf Protect telemetry to alert when a user is added to the admin group.

Possible investigation steps

  • Identify the account that was added to the admin group (user.name) and the account that performed the change (process.user.name), and confirm whether the change was requested or approved.
  • Review the process that made the change (process.executable, for example dscl, dseditgroup, sysadminctl, or System Settings), its parent (process.parent.executable), and its responsible process (process.responsible.executable) to determine whether the change was interactive or scripted.
    • $investigate_0
    • $investigate_1
  • Determine whether the added account was recently created, and whether it is hidden or has an unusual name or UID.
  • Search the timeline for activity that followed the elevation, such as new persistence items (LaunchAgents, LaunchDaemons, login items), software installation, additional user creation, or security setting changes.
  • Review authentication activity for the added account, including remote logins over SSH or Screen Sharing.
  • Review other alerts for the same host to identify the initial access or execution activity that preceded the group change.

False positive analysis

  • IT administrators, device management solutions, and privilege management tools legitimately add users to the admin group during provisioning or temporary elevation. Verify the change against change tickets or the expected management workflow.
  • When the activity is confirmed benign, create an exception for the specific management process or service account rather than for the admin group.

Response and remediation

  • Remove the account from the admin group if the change was not authorized.
  • Disable or delete the account if it was created by the attacker, and reset the credentials of any compromised legitimate account.
  • Review and revert changes made with the elevated privileges, such as persistence items, installed software, and modified security settings.
  • Isolate the host if follow-on malicious activity is identified.
  • Investigate how the attacker obtained the privileges required to modify group membership and remediate the initial access vector.
  • Escalate to the incident response team and check other macOS hosts for similar group membership changes.

References

Related rules

to-top