Skip to content

amjcyber/Elastic-Alerts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Elastic-Alerts

There are more and better projects to send detection alerts to Telegram. But sometimes one likes just to code.

This script should be ran in cron. For example every 5 minutes:

*/5 * * * * /location/elastic_alert.py

Configuration

Install dependencies

pip3 install -r requirements.txt

Environment variables

Create a .env file:

ELASTIC_HOST = ""
token = ""
chat_id = ""
api_key = ""
message_thread_id = ""

Create your Telegram bot

Check: From BotFather to 'Hello World'

Telegram Group

I configured it to send messages to a Thread in a Telegram Group

How it works

  1. Connects to your Elastic
  2. Checks for open alerts in the last day
  3. Checks processed_ids.txt to not repeat alerts
  4. Sends alert

About

Send Elastic Security detections to Telegram

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages