Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


How to run a script when receiving an email (OVH Anti-DDoS)?
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

How to run a script when receiving an email (OVH Anti-DDoS)?

MrHMrH Member
edited March 2018 in Help

This month I have been receiving small DDoS attacks (15-30 minutes).
I would like to be able to run an .sh when I receive an email from OVH warning about mitigation.
The script simply stops a service and starts it again in another IP previously enabled.

Any idea is welcome :)

Comments

  • 6ixth6ixth Member

    fuck knows mate.

    Thanked by 3Aidan MrH iburger
  • AidanAidan Member
    edited March 2018

    @6ixth said:
    fuck knows mate.

    Have you considered taking up a support position over at

  • FrankZFrankZ Veteran

    In "/etc/aliases" add

    username: | /path/to/your/program

    Thanked by 1MrH
  • GodsGods Member

    @FrankZ said:
    In "/etc/aliases" add

    username: | /path/to/your/program

    Assuming he runs his own mail server...

    Alternatively you can use services such as Zapier.

    Ex:
    When you receive email on Gmail account from OVH anti-ddos, trigger webhook with secret, webhook will execute script

    Thanked by 1MrH
  • First-RootFirst-Root Member, Host Rep

    Doesn't OVH provide an API for their DDoS that can run a webhook upon attack?

    Thanked by 1MrH
  • @FR_Michael said:
    Doesn't OVH provide an API for their DDoS that can run a webhook upon attack?

    Nice one! Not sure if they support webhooks, but at least you can poll: http://docs.ovh.ca/en/api-antiddos.html. Swagger docs: https://eu.api.ovh.com/console/#/ip/{ip}/mitigation#GET

    Thanked by 1MrH
  • MikeAMikeA Member, Patron Provider

    @FR_Michael said:
    Doesn't OVH provide an API for their DDoS that can run a webhook upon attack?

    no, they don't have any way to notify when an attack is detected.

    Thanked by 1MrH
  • @MrH said:
    This month I have been receiving small DDoS attacks (15-30 minutes).
    I would like to be able to run an .sh when I receive an email from OVH warning about mitigation.
    The script simply stops a service and starts it again in another IP previously enabled.

    Any idea is welcome :)]

    wait? Is not OVH sent such email by default?

  • solairesolaire Member
    edited March 2018

    @MikeA said:
    no, they don't have any way to notify when an attack is detected.

    Just create a script to poll their API every 30 seconds or so. Check if state is any different from last time, save new state, repeat. Fire an event (e.g. call a webhook) in case state has changed.

    Thanked by 1MrH
  • MikeAMikeA Member, Patron Provider

    @solaire said:

    @MikeA said:
    no, they don't have any way to notify when an attack is detected.

    Just create a script to poll their API every 30 seconds or so. Check if state is any different from last time, save new state, repeat. Fire an event (e.g. call a webhook) in case state has changed.

    Yeah, that's different from an API sending a notification though.

    Thanked by 1MrH
  • raindog308raindog308 Administrator, Veteran

    FrankZ said: n "/etc/aliases" add

    username: | /path/to/your/program

    Or spend an hour learning procmail. procmail is the swiss army knife of handling incoming mail. You don't necessarily need to run the mail server (you don't have to be root to write procmail recipes for yourself) but it has to be on the mail server, not gmail or something.

    Alternatively, look at IFTTT

    Thanked by 1MrH
  • raindog308raindog308 Administrator, Veteran

    6ixth said: fuck knows mate.

    Hasn't been active since 2013, but let's try...

    @fuck can you help in this thread?

    Thanked by 1MrH
  • raindog308 said: @fuck can you help in this thread?

    He don't give a @fuck

    Thanked by 1MrH
  • NeoonNeoon Community Contributor, Veteran

    OVH has a fat API, just ASK IT, it will respond.

    Thanked by 2MrH FHR
  • MrHMrH Member

    Thank you all!
    I'll try to develop something and I'll share it, just in case it could be useful for someone else here.
    Again, thank you guys :)

    Thanked by 1Aidan
Sign In or Register to comment.