Security

Failed Logins followed by Success Corp Wifi?

ahmar74
Explorer

here is my string i just cant seem to figure out the x number of failures followed by success:

| tstats count values(Authentication.action) as Action, values(Authentication.user) as User, values(Authentication.Calling_Station_ID) as "MAC Address", values(Authentication.src) as Source from datamodel="Authentication"."Authentication" where (index=acs Authentication.action!=success Authentication.src!=10.242.*) by Authentication.user | brain freeze....

Tags (1)
0 Karma
1 Solution

mmontgomery_spl
Splunk Employee
Splunk Employee

There are a few ways, but I like this one as it is a little simpler to modify for other use cases as well:

| from datamodel:"Authentication"."Authentication" | stats values(user) values(Calling_Station_ID) count(eval('action'=="success")) as success, count(eval('action'=="failure")) as failure by src | search success>1 failure>20

View solution in original post

wenthold
Communicator

I don't think tstats is the way to go since you're analyzing data in aggregate. You might want to look at the answer Woodcock posted earlier: https://answers.splunk.com/answers/368521/how-can-i-detect-a-successful-login-after-multiple.html

You could approximate it with tstats, but I don't believe you can account for consecutive events using tstats with something like:

| tstats `summariesonly` count as failure_count from datamodel=Authentication where Authentication.action=failure earliest=-4h@h latest=-5m@m by Authentication.user, Authentication.app, _time
| join type=left Authentication.user, Authentication.app, _time  [| tstats `summariesonly` count as success_count from datamodel=Authentication where Authentication.action=success earliest=-4h@h latest=-5m@m by Authentication.user, Authentication.app, _time]
| where failure_count>3 and success_count>1

.. but this won't account for the sequence of events, it will only find where they occur together, and any sequence spanning one of the time periods won't properly be accounted for.

0 Karma

mmontgomery_spl
Splunk Employee
Splunk Employee

There are a few ways, but I like this one as it is a little simpler to modify for other use cases as well:

| from datamodel:"Authentication"."Authentication" | stats values(user) values(Calling_Station_ID) count(eval('action'=="success")) as success, count(eval('action'=="failure")) as failure by src | search success>1 failure>20
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...