Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aggregation issues with TheHive alerting #2560

Open
emixam3 opened this issue Nov 12, 2019 · 7 comments · Fixed by jertel/elastalert2#142
Open

Aggregation issues with TheHive alerting #2560

emixam3 opened this issue Nov 12, 2019 · 7 comments · Fixed by jertel/elastalert2#142

Comments

@emixam3
Copy link

emixam3 commented Nov 12, 2019

Hi,
I'm trying to use Elastalert to request Suricata alerts in my Elastic to send alerts to TheHive. Standards requests and alerts worked fine, and I've got all my Suricata alerts in TheHive.
But now I'm trying to aggregate these alerts (195 alerts) by signature's names (14 differents names).
This is my rule:

name: ET
type: any
index: logstash*
doc_type: doc


filter:
 - term:
     event_type: "alert"
query:
    query_string:
         query: "_exists_: alert.signature"

query_key: 'alert.signature'

aggregation:
    minutes: 10
aggregation_key: 'alert.signature'
aggregation_by_match_time: true
include:
 - src_ip
 - dest_ip
 - alert.signature

alert: hivealerter

hive_connection:
    hive_host: http:/127.0.0.1:9000
    hive_port: 9000
    hive_apikey: blablabla

hive_alert_config:
    title: '{match[alert][signature]}'
    type: 'NIDS'
    source: 'elastalert'
    description: 'Signature: {match[alert][signature]}'
    severity: 3
    tags : ['{match[src_ip]}']
    tlp: 3
    status: 'New'
    follow: True

hive_observable_data_mapping:
- ip: "{match[src_ip]}"
- ip: "{match[dest_ip]}"

Even with my 10 minutes aggregation time, all my 195 alerts are sent every 2 minutes (my request time). With --verbose, I see all aggregations ID and some adding in, so I think aggregation is quite good, but not alerting in TheHive.

Thanks

@emixam3
Copy link
Author

emixam3 commented Nov 12, 2019

In elastalert logs, I can see that all aggregation alerts are not sent to TheHive.

alert_sent: false

@emixam3
Copy link
Author

emixam3 commented Nov 12, 2019

#2263 Maybe?
@agix

@agix
Copy link

agix commented Nov 13, 2019

You can try it using this tag https://github.com/agix/elastalert/releases/tag/v0.2.1-agix-2

pip install git+https://github.com/agix/[email protected]

@emixam3
Copy link
Author

emixam3 commented Nov 18, 2019

You can try it using this tag https://github.com/agix/elastalert/releases/tag/v0.2.1-agix-2

pip install git+https://github.com/agix/[email protected]

And how looks like the alert with your version @agix?
Like in #2263, without hive description field?

@agix
Copy link

agix commented Nov 18, 2019 via email

@emixam3
Copy link
Author

emixam3 commented Nov 18, 2019

Ok, work in progress...
Can you change alert's title? Whatever I defined, it stays as my alert name. The title: '{match[alert][signature]}' doesn't seem to work.

@emixam3
Copy link
Author

emixam3 commented Nov 18, 2019

Ok, work in progress...
Can you change alert's title? Whatever I defined, it stays as my alert name. The title: '{match[alert][signature]}' doesn't seem to work.

Find : use alert_subject and alert_subject_args, and not alert's title.
I do some tests and I will post my rule later.
But with your elastalert, @agix , it works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants