Alerting

How can I create a brute force alert for Oracle logins?

SplunkLunk
Path Finder

Greetings,

It's been a while since I asked a question. I'm hoping someone can help out. I currently have a brute force alert for ssh attempts that looks for a total of five or more attempts of success or failure within five minutes, where at least four are failures and one is success. It runs every five minutes. Not perfect, but it does what I want. Now I want to do the same for Oracle logins. The ssh search looks like:

host=* sourcetype=linux_secure process=sshd ("tag::action"="success" OR "tag::action"="failure") 
| stats count(action) as Attempts, count(eval(match(action,"failure"))) as Failed, count(eval(match(action,"success"))) as Success by user,src,host 
| where Attempts>=5 AND Success>0 AND Failed>=5
| rename src as Source, user as User, host as Host

For Oracle though I need to look for four error codes:

0=Success
1017=Bad Password
28000=Account is Locked
1005=null password given; logon denied

So I want my search to look for at least four instances of 1017, 28000, or 1005 and at least once instance of 0. Is there a way to flag multiple error codes as "Failure" using the eval function similar to what I'm doing with the ssh search? Any advice would be appreciated.

My current search for a summary of failed logins over a 24 hour period is:

index=[my index] sourcetype="oracle:audit:trail" (RETURN_CODE!=0 OR RETURNCODE!=0)
| eval RETURNCODE=coalesce(RETURN_CODE, RETURNCODE) 
| stats count by HOST, host, source, USERHOST, OS_USERNAME, USERNAME, RETURNCODE
| where count>7
| sort USERNAME, -count 
| lookup oracle_codes.csv oracode as RETURNCODE OUTPUT message as RETURNCODE_DESC 
| table HOST, USERHOST, OS_USERNAME, host, USERNAME, source, RETURNCODE, RETURNCODE_DESC, count
| WHERE RETURNCODE=1017 OR RETURNCODE=28000 OR RETURNCODE=1005
| rename HOST as "Source IP", host as "DB Hostname", USERNAME as "DB Username", source as "DB Audit Source", USERHOST as "User Hostname", OS_USERNAME as "User OS Username", RETURNCODE as "Error Code", RETURNCODE_DESC as "Error Description", count as "Error Count"
0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...