ElastAlert Rule Help

623 views
Skip to first unread message

senatorh...@gmail.com

unread,
Jun 25, 2018, 5:51:47 AM6/25/18
to security-onion
Playing with the Elastalert rules.

Does anyone have a sample rule for SMTP alerting on a specific query?
My query would be something like below. But I think it would be a huge help to see a sample, and do some reverse engineering.

index: "*:logstash-*"
filter:
- query:
query_string:

query: "event_type: bro_x509 AND san_dns: \"*somewebpage.com*\"

Thanks guys.


senatorh...@gmail.com

unread,
Jun 26, 2018, 7:13:27 AM6/26/18
to security-onion
Sorry for bumping.

I have been trying for several hours with no luck. I seem to be unable to define a working .yaml rule in SO, for alerting via e-mail.

I am really open to any yaml file, which can help me.

Philip Robson

unread,
Jun 26, 2018, 7:55:14 AM6/26/18
to security-onion
Hi,

Hope this helps as an example.
Drop the file in /etc/elastalert/rules
Filename.yaml
Thing that caught me out is the spacing. Checkout the rules in the above rules folder as well.

es_host: elasticsearch
es_port: 9200
name: Security Log Cleared
index: "*:logstash-beats*"
filter:
- query:
query_string:
query: "event_id: 1102 OR event_id: 104"
type: any
alert:
- "email"
email:
- "t...@domain.com"
smtp_host: "Email server FQDN"
smtp_port: 25
from_addr: "fr...@domain.com"


Phil

Wes Lambert

unread,
Jun 26, 2018, 8:09:19 AM6/26/18
to securit...@googlegroups.com
Also see:


--
Follow Security Onion on Twitter!
https://twitter.com/securityonion
---
You received this message because you are subscribed to the Google Groups "security-onion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to security-onio...@googlegroups.com.
To post to this group, send email to securit...@googlegroups.com.
Visit this group at https://groups.google.com/group/security-onion.
For more options, visit https://groups.google.com/d/optout.


--

Wes Lambert

unread,
Jun 26, 2018, 8:09:37 AM6/26/18
to securit...@googlegroups.com

senatorh...@gmail.com

unread,
Jun 26, 2018, 8:36:07 AM6/26/18
to security-onion
Sorry Wes. I was having a lot of trouble figuring out the filter/queries parameters. The example from Philip put me in the right direction. I am getting some alerts now. Thanks.

Still a bit confused on simple filtering. Like specifying bro_dns and query. But now I should be able to find out.

Philip Robson

unread,
Jun 26, 2018, 9:04:36 AM6/26/18
to security-onion
Hi again, another example for you for Bro. Best thing is to trigger something you might want to look for (ie DNS lookup for a website) find it in the logs then use that to see what to query on. For example message: in my case below, 605004 is a Cisco SYSLOG event id. Ive cut the email portion out.

es_host: elasticsearch
es_port: 9200
name: Cisco SSH Failed Login
index: "*:logstash-bro*"
filter:
- query:
query_string:
query: "message: 605004"
type: any

Reply all
Reply to author
Forward
0 new messages