Skip to content
This repository has been archived by the owner on Jul 9, 2022. It is now read-only.

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

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

wants to merge 3 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Jul 7, 2021

Describe the changes

  • Add Telegram notification
  • Add Mattermost notification
  • Add Argparse with "delay" argument to allow ransomwatch to loop without cron (the default behavior is unchanged, but you can uncomment line in Dockerfile to let ransomwatch to loop every x seconds)

Related issue(s)

#42

How was it tested?

Tested with Telegram/Mattermost notification with fresh DB

@ghost
Copy link

ghost commented Jul 7, 2021

Thank you @jychp, great job

@ghost ghost changed the title feat: add telegram notif + auto relaunch feat: add telegram/mattermost notif + auto relaunch Jul 7, 2021
@ghost
Copy link
Author

ghost commented Jul 7, 2021

I just add Mattermost notification

@captainGeech42 captainGeech42 self-requested a review July 7, 2021 17:30
@captainGeech42 captainGeech42 self-assigned this Jul 7, 2021
@captainGeech42
Copy link
Owner

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
Copy link
Author

ghost commented Jul 7, 2021

Rebase done.

Copy link

@danieleperera danieleperera left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested telegram and delay features, both are working fine! 👍🏼
I'd suggest only some minor changes on config.yaml.
From telegram_apikey and telegram_chatid to just apikey and chatid.
These modifications should also be done in notification manager.

@ghost
Copy link
Author

ghost commented Jul 9, 2021

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
Copy link

taycom commented Jul 22, 2021

Tested telegram and work perfect!

@captainGeech42
Copy link
Owner

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?

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

Successfully merging this pull request may close these issues.

3 participants