Sending E-mail when IP is added to address list

Hi,

I am trying to make this simple thing (i guess) and have no succes with it. I have firewall rule that detects port scanning. I would like that when another IP is added to dinamic Address list to trigger the Script that notifies me about that activity.

I have this working script allready in but i would like to be trigered when another port scanning attemps is made.

/tool e-mail send to=my.email@whatever.com subject=“Port Scanning” start-tls=yes from=my.gmail@gmail.com password=youwishuknew port=587

I have a feeling im missing something obvius…

i tried this script but with no success.

:foreach i in [/ip firewall address-list find list=port scanners] do={ /tool e-mail send to=my.email@whatever.com subject=“Port Scanning” start-tls=yes from=my.gmail@gmail.com password=youwishuknew port=587 body=("Port scanning From: " . [/ip firewall address-list get $i address])}

Use the log function in the firewall rule and have the action specified as an e-mail.

/ip firewall filter
add action=add-src-to-address-list address-list=PSD (insert matchers here) chain=forward log=yes log-prefix=PSD

/system logging action
add email-to=myaddress@somewhere.com name=emailPSD target=email
/system logging
add action=emailPSD prefix=PSD topics=firewall,info

Whenever a match occurs, you get an e-mail. Hopefully you do not get too many :slight_smile:

Worked like a charm. Thank you !

Excellent :slight_smile: