diff --git a/bot/mozdefbot.py b/bot/mozdefbot.py index c8d8b9a5..8107b014 100755 --- a/bot/mozdefbot.py +++ b/bot/mozdefbot.py @@ -327,7 +327,14 @@ class alertConsumer(ConsumerMixin): if len(bodyDict['summary']) > 450: sys.stdout.write('alert is more than 450 bytes, truncating\n') bodyDict['summary'] = bodyDict['summary'][:450] + ' truncated...' - self.ircBot.client.msg(ircchannel, formatAlert(bodyDict)) + + #if the alert has a 'severity', only publish the alert if the severity is not NOTICE or INFO + if 'severity' in bodyDict.keys(): + if not ((bodyDict['severity'] == 'NOTICE') or (bodyDict['severity'] == 'INFO')): + self.ircBot.client.msg(ircchannel, formatAlert(bodyDict)) + #if the alert does not have a severity for some reason, go ahead and publish it + else + self.ircBot.client.msg(ircchannel, formatAlert(bodyDict)) message.ack() except ValueError as e: