|
| 1 | +name: Splunk Command and Scripting Interpreter Risky SPL MLTK Baseline |
| 2 | +id: 273df2f7-643a-451a-8d4d-637e39eadc87 |
| 3 | +version: 1 |
| 4 | +date: '2022-05-27' |
| 5 | +author: Abhinav Mishra, Kumar Sharad and Xiao Lin, Splunk |
| 6 | +type: Baseline |
| 7 | +datamodel: |
| 8 | +- Splunk_Audit |
| 9 | +description: 'This search is to build a per user command and scripting risky SPL detection model using MLTK |
| 10 | + DensityFunction algorithm based on audit log data of Splunk apps. The model is built from past 7 days users |
| 11 | + history of running search commands from |
| 12 | + https://docs.splunk.com/Documentation/Splunk/latest/Security/SPLsafeguards#Commands_that_trigger_the_warninga, |
| 13 | + and aggregate the total search run time for each hour as indicator of user behavior. The default threshold of |
| 14 | + outlier boundary is defined as 0.1%, which means that the possibility of search run time exceeding that |
| 15 | + boundary is smaller than 0.1%. This search should be scheduled to run at least as frequently as every 7 days. |
| 16 | + The name of ML model generated is "risky_command_abuse" and should be configured to be globally shared (not |
| 17 | + private) in MLTK app as ducumented here: |
| 18 | + https://docs.splunk.com/Documentation/MLApp/5.3.1/User/Models#Sharing_models_from_other_Splunk_apps |
| 19 | + unless the same account of training this model will be used to perfeorm inference using this model for anomaly |
| 20 | + detection. ' |
| 21 | +search: '| tstats values(Search_Activity.user) as user, sum(Search_Activity.total_run_time) as run_time count |
| 22 | + FROM datamodel=Splunk_Audit.Search_Activity WHERE (Search_Activity.user!="") |
| 23 | + AND (Search_Activity.total_run_time>1) AND (earliest=-7d@d latest=now) |
| 24 | + AND (Search_Activity.search IN ("*| runshellscript *", "*| collect *","*| delete *", "*| fit *", "*| outputcsv *", |
| 25 | + "*| outputlookup *", "*| run *", "*| script *", "*| sendalert *", "*| sendemail *", "*| tscollect *")) |
| 26 | + AND (Search_Activity.search_type=adhoc) AND (Search_Activity.user!=splunk-system-user) |
| 27 | + BY _time, Search_Activity.user span=1h |
| 28 | + | fit DensityFunction "run_time" dist=auto threshold=0.001 show_density=true by "user" into "risky_command_abuse" ' |
| 29 | +how_to_implement: The corresponding detection of using this model is "Splunk Command and Scripting Interpreter Risky |
| 30 | + SPL MLTK". This detection depends on MLTK app which can be hound here - https://splunkbase.splunk.com/app/2890/ |
| 31 | + and it assumes Splunk accelerated audit data model is available. For large enterprises, training the model might |
| 32 | + take significant computing resources. It might requires dedicated search head. The underlined machine learning |
| 33 | + algorithm this detection used is DensityFunction. It might need to incresase its settings default values, such as |
| 34 | + max_fit_time, max_groups, etc. More details of achieving optmal performance abd configuring DensityFunction |
| 35 | + parameters can be found here - https://docs.splunk.com/Documentation/MLApp/5.3.1/User/Configurefitandapply |
| 36 | + Users can modify earliest=-7d@d in the search to other value so that the search can collect enough data points |
| 37 | + to build a good bseline model. Users can also modify list of risky commands in "Search_Activity.search IN" to better |
| 38 | + suit users' violation policy and their usage environment. |
| 39 | +known_false_positives: If the run time of a search exceeds the boundaries of outlier defined by the fitted density |
| 40 | + function model, false positives can occur, incorrectly labeling a long running search as potentially risky. |
| 41 | +references: |
| 42 | +- https://docs.splunk.com/Documentation/Splunk/latest/Security/SPLsafeguards#Commands_that_trigger_the_warning |
| 43 | +tags: |
| 44 | + analytic_story: |
| 45 | + - Splunk Vulnerabilities |
| 46 | + asset_type: Web Server |
| 47 | + cis20: |
| 48 | + - CIS 3 |
| 49 | + - CIS 6 |
| 50 | + confidence: 40 |
| 51 | + cve: |
| 52 | + - CVE-2022-32154 |
| 53 | + context: |
| 54 | + - Source:Endpoint |
| 55 | + dataset: |
| 56 | + - https://github.com/splunk/attack_data/raw/master/datasets/attack_techniques/T1203/search_activity.txt |
| 57 | + impact: 50 |
| 58 | + kill_chain_phases: |
| 59 | + - Actions on Objectives |
| 60 | + message: ML model "risky_command_abuse" training is completed. |
| 61 | + mitre_attack_id: |
| 62 | + - T1059 |
| 63 | + nist: |
| 64 | + - DE.AE |
| 65 | + observable: |
| 66 | + - name: user |
| 67 | + type: User |
| 68 | + role: |
| 69 | + - Victim |
| 70 | + product: |
| 71 | + - Splunk Enterprise |
| 72 | + - Splunk Enterprise Security |
| 73 | + - Splunk Cloud |
| 74 | + required_fields: |
| 75 | + - _time |
| 76 | + - Search_Activity.search |
| 77 | + - Search_Activity.total_run_time |
| 78 | + - Search_Activity.user |
| 79 | + - Search_Activity.search_type |
| 80 | + risk_score: 20 |
| 81 | + security_domain: audit |
| 82 | + detections: |
| 83 | + - Splunk Command and Scripting Interpreter Risky SPL MLTK |
| 84 | + |
0 commit comments