diff --git a/docs/experimental-machine-learning/readme.md b/docs/experimental-machine-learning/readme.md index 82ad7750eae..75abf7dd641 100644 --- a/docs/experimental-machine-learning/readme.md +++ b/docs/experimental-machine-learning/readme.md @@ -7,6 +7,7 @@ This repo contains some additional information and files to use experimental[*]( * [ProblemChild](problem-child.md) * [HostRiskScore](host-risk-score.md) * [URLSpoof](url-spoof.md) +* [UserRiskScore](user-risk-score.md) * [experimental detections](experimental-detections.md) ## Releases diff --git a/docs/experimental-machine-learning/user-risk-score.md b/docs/experimental-machine-learning/user-risk-score.md new file mode 100644 index 00000000000..72735a92860 --- /dev/null +++ b/docs/experimental-machine-learning/user-risk-score.md @@ -0,0 +1,170 @@ +# User Risk Score + +The User Risk Score feature highlights risky usernames from within your environment. It utilizes a transform with a scripted metric aggregation to calculate user risk scores based on alerts that were generated within the past three months. The transform runs hourly to update the score as new alerts are generated. Each alert's contribution to the user risk score is based on the alert's risk score (`signal.rule.risk_score`). The risk score is calculated using a weighted sum where rules with higher time-corrected risk scores also have higher weights. Each risk score is normalized to a scale of 0 to 100. + +User Risk Score is an experimental feature that assigns risk scores to usernames in a given Kibana space. Risk scores are calculated for each username by utilizing transforms on the alerting indices. The transform updates the score as new alerts are generated. The User Risk Score [package](https://github.com/elastic/detection-rules/releases/tag/ML-UserRiskScore-20220628-1) contains all of the required artifacts for setup. The User Risk Score feature provides Lens dashboards for viewing summary and detailed username risk score information. The detail view dashboard - Drilldown of User Risk Score - presents detail on why a username has been given a high risk score. In addition, user risk scores are presented in the detailed view for a username in the Elastic Security App. + + +### On Usernames and Risk Scores + + Many alerts contain usernames which were present in the original log or event documents that alert rules, or anomaly rules, matched. These are discrete usernames, not (yet) pointers to a user *entity*. In most environments, each human user has multiple usernames across the various applications and systems they use. In order to investigate a user, it may be necessary to add each of their usernames to the list of usernames being used to filter the output of the detail dashboard. + +In some cases, there are certain usernames that are not readily individuated. The Local System, or SYSTEM account, under Windows, for example, has the same name and the same SID (security identifier) on every Windows host. In order to individuate a particular Local System user account, it is necessary to add its hostname as a filter. The user risk score detail dashboard contains tables of alerts by hostname, in addition to username, in order to help identify the hostname(s) associated with a local user that has been given a risk score. + +## Setup Instructions + + 1. [Obtain artifacts](#obtain-artifacts) + 2. [Upload scripts](#upload-scripts) + 3. [Upload ingest pipeline](#upload-ingest-pipeline) + 4. [Upload and start the `pivot` transform](#upload-start-pivot) + 5. [Create the User Risk Score index](#user-risk-index) + 6. [Upload and start the `latest` transform](#upload-start-latest) + 7. [Import dashboards](#import-dashboards) + 8. [(Optional) Enable Kibana features](#enable-kibana) + +
python ml_userriskscore_generate_scripts.py --space default
+
+PUT _scripts/ml_userriskscore_levels_script_<your-space-name>
+{contents of ml_userriskscore_levels_script.json file}
+
+PUT _scripts/ml_userriskscore_map_script_<your-space-name>
+{contents of ml_userriskscore_map_script.json file}
+
+PUT _scripts/ml_userriskscore_reduce_script_<your-space-name>
+{contents of ml_userriskscore_reduce_script.json file}
+
+PUT _scripts/ml_userriskscore_init_script_<your-space-name>
+{contents of ml_userriskscore_init_script.json file}
+
PUT _ingest/pipeline/ml_usertriskscore_ingest_pipeline_<your-space-name>
+{contents of ml_userriskscore_ingest_pipeline.json file}
+
pivot
transformPUT _transform/ml_userriskscore_pivot_transform_<your-space-name>
+{contents of ml_userriskscore_pivot_transform.json file}
+
GET ml_user_risk_score_<your-space-name>/_search
+
PUT ml_user_risk_score_latest_<your-space-name>
+{
+ "mappings":{
+ "properties":{
+ "user.name":{
+ "type":"keyword"
+ }
+ }
+ }
+}
+
latest
transformPUT _transform/ml_userriskscore_latest_transform_<your-space-name>
+{contents of ml_userriskscore_latest_transform.json file}
+
GET ml_user_risk_score_latest_<your-space-name>/_search
+