captainGeech42 / ransomwatch

Ransomware leak site monitoring
MIT License
305 stars 64 forks source link

feat: add telegram/mattermost notif + auto relaunch #61

Open ghost opened 2 years ago

ghost commented 2 years ago

Describe the changes

Related issue(s)

42

How was it tested?

Tested with Telegram/Mattermost notification with fresh DB

ghost commented 2 years ago

Thank you @jychp, great job

ghost commented 2 years ago

I just add Mattermost notification

captainGeech42 commented 2 years ago

Wow, this is awesome! Thanks for putting this together, I will review it ASAP and get this merged in!

Can you rebase to the HEAD commit on main?

ghost commented 2 years ago

Rebase done.

ghost commented 2 years ago

The better way to do this is to rework configuration:

dest1:
  type: slack
  slack:
    url: xxx
#  telegram:
#    apikey: xx
#    chatid: xx
#  other_tool:
#    key1: xx
dest2:
  type: telegram
#  slack:
#    url: xxx
  telegram:
    apikey: xx
    chatid: xx
#  other_tool:
#    key1: xx

This could allow to rewrite Manager in a more generic way:

MAPPING = {'telegram': TelegramNotification, ...}
if not MAPPING[params['type']].send_new_victim_notification(victim, params.get(params['type'], {}):
    logging.error(f"Failed to send new victim notification to {params['type']} \"{dest}\"")
taycom commented 2 years ago

Tested telegram and work perfect!

captainGeech42 commented 2 years ago

Sorry for the delay on this, I have been busy moving and haven't been able to work on this.

Glad some other people have tested the Telegram stuff, that's great! Has anyone else tested the Mattermost one?