I am trying to set up a machine learning job to detect when non admin users who normally do not use powershell start powershell.
I already saved a search function that shows powershell started logs, and filters the unimportant users:
event.action: "created-process" and process.name: "powershell.exe" and not related.user: (*$ or adm_*)
Now I thought the way to go is to use the data from the saved search in a machine learning job running a rare detector with related.user as the field. My thinking is that this way it finds when powershell was started, and registers an anomaly when someone runs it who does not usually use powershell. However, searching for rare by "related.user" does not seem to be an option in Elasticsearch. Does anyone have an example of how I could set this up?
It's easiest to call if you go to Dev console in Kibana, which you can get to by clicking "View in Console" on one of the examples on that docs page.
Things might be more complicated if you are searching across many indices and they have different mappings for this field. Which indices is your saved search configured to search?
related.user does not appear in this file. Neither do host.name or user.name. Only username and hostname. but there is no entry for related.user or relateduser.
I think the misunderstanding here is that you do not search for rare by related.user in the actual Elasticsearch query language, you accomplish that bit using an ML job (see rarity analysis article)
So, you need to:
Create a filtered search to come up with a version of the data set that you want - it seems that you've done this part. Save this search as a "Saved Search"
The UI is suggesting you use related.user.keyword (the keyword type version of related.user). This will work for you.
If you did not know this, the index "mappings" are definitions of the fields and their types. A long time ago, string-based fields (like fields that defined the names of things) were replaced with text and keyword types.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.