|
| 1 | +name: MacOS Account Created |
| 2 | +id: 491004ae-694f-453e-b1e0-fc1e65daeea1 |
| 3 | +version: 1 |
| 4 | +date: '2026-02-26' |
| 5 | +author: Raven Tait, Splunk |
| 6 | +status: production |
| 7 | +type: Anomaly |
| 8 | +description: |- |
| 9 | + The following analytic detects the creation of a new local user account on a MacOS system. It leverages osquery logs to identify this activity. |
| 10 | + Monitoring the creation of local accounts is crucial for a SOC as it can indicate unauthorized access or lateral movement within the network. |
| 11 | + If confirmed malicious, this activity could allow an attacker to establish persistence, escalate privileges, or gain unauthorized access to sensitive systems and data. |
| 12 | +data_source: |
| 13 | + - Osquery Results |
| 14 | +search: |- |
| 15 | + | tstats `security_content_summariesonly` |
| 16 | + count min(_time) as firstTime |
| 17 | + max(_time) as lastTime |
| 18 | + from datamodel=Endpoint.Processes where |
| 19 | +
|
| 20 | + ( |
| 21 | + Processes.process = "*sysadminctl" |
| 22 | + Processes.process = "*-addUser*" |
| 23 | + ) |
| 24 | + OR |
| 25 | + ( |
| 26 | + Processes.process = "*createhomedir*" |
| 27 | + Processes.process = "*-u*" |
| 28 | + ) |
| 29 | + OR |
| 30 | + ( |
| 31 | + Processes.process = "*dseditgroup*" |
| 32 | + Processes.process IN ( |
| 33 | + "*edit*", |
| 34 | + "*-a*" |
| 35 | + ) |
| 36 | + ) |
| 37 | + OR |
| 38 | + ( |
| 39 | + Processes.process = "*dscl*" |
| 40 | + Processes.process = "*-create*" |
| 41 | + ) |
| 42 | +
|
| 43 | + by Processes.dest Processes.original_file_name Processes.parent_process_id |
| 44 | + Processes.process Processes.process_exec Processes.process_guid |
| 45 | + Processes.process_hash Processes.process_id |
| 46 | + Processes.process_current_directory Processes.process_name |
| 47 | + Processes.process_path Processes.user Processes.user_id |
| 48 | + Processes.vendor_product |
| 49 | +
|
| 50 | + | `drop_dm_object_name(Processes)` |
| 51 | + | `security_content_ctime(firstTime)` |
| 52 | + | `security_content_ctime(lastTime)` |
| 53 | + | `macos_account_created_filter` |
| 54 | +how_to_implement: |- |
| 55 | + This detection uses osquery and endpoint security on MacOS. Follow the link in references, which describes how to setup process auditing in MacOS with endpoint security and osquery. |
| 56 | + Also the [TA-OSquery](https://splunkbase.splunk.com/app/8574) must be deployed across your indexers and universal forwarders in order to have the osquery data populate the data models. |
| 57 | +known_false_positives: |- |
| 58 | + Creating new accounts after initial endpoint management should be rare in most environments. Investigate and tune as needed. |
| 59 | +references: |
| 60 | + - https://osquery.readthedocs.io/en/stable/deployment/process-auditing/ |
| 61 | + - https://ss64.com/mac/sysadminctl.html |
| 62 | + - https://ss64.com/mac/dseditgroup.html |
| 63 | + - https://ss64.com/mac/dscl.html |
| 64 | +drilldown_searches: |
| 65 | + - name: View the detection results for - "$user$" and "$dest$" |
| 66 | + search: '%original_detection_search% | search user = "$user$" dest = "$dest$"' |
| 67 | + earliest_offset: $info_min_time$ |
| 68 | + latest_offset: $info_max_time$ |
| 69 | + - name: View risk events for the last 7 days for - "$user$" and "$dest$" |
| 70 | + search: '| from datamodel Risk.All_Risk | search normalized_risk_object IN ("$user$", "$dest$") starthoursago=168 | stats count min(_time) as firstTime max(_time) as lastTime values(search_name) as "Search Name" values(risk_message) as "Risk Message" values(analyticstories) as "Analytic Stories" values(annotations._all) as "Annotations" values(annotations.mitre_attack.mitre_tactic) as "ATT&CK Tactics" by normalized_risk_object | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)`' |
| 71 | + earliest_offset: $info_min_time$ |
| 72 | + latest_offset: $info_max_time$ |
| 73 | +rba: |
| 74 | + message: New local account created on $dest$ by $user$ via $process$ |
| 75 | + risk_objects: |
| 76 | + - field: user |
| 77 | + type: user |
| 78 | + score: 20 |
| 79 | + - field: dest |
| 80 | + type: system |
| 81 | + score: 20 |
| 82 | + threat_objects: |
| 83 | + - field: process |
| 84 | + type: process |
| 85 | +tags: |
| 86 | + analytic_story: |
| 87 | + - MacOS Persistence Techniques |
| 88 | + asset_type: Endpoint |
| 89 | + mitre_attack_id: |
| 90 | + - T1136 |
| 91 | + product: |
| 92 | + - Splunk Enterprise |
| 93 | + - Splunk Enterprise Security |
| 94 | + - Splunk Cloud |
| 95 | + security_domain: endpoint |
| 96 | +tests: |
| 97 | + - name: True Positive Test |
| 98 | + attack_data: |
| 99 | + - data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1136/osquery_account_creation/osquery.log |
| 100 | + source: osquery |
| 101 | + sourcetype: osquery:results |
0 commit comments