Skip to content

Commit

Permalink
ENH: Add blackhole output bot
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Wagner committed Jul 27, 2018
1 parent a5f191c commit 629329f
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ CHANGELOG

#### Outputs
- added `intelmq.bots.experts.mcafee.output_esm` (1265).
- added `intelmq.bots.outputs.blackhole` (#1279).

### Documentation

Expand Down
14 changes: 14 additions & 0 deletions docs/Bots.md
Original file line number Diff line number Diff line change
Expand Up @@ -1187,6 +1187,20 @@ Note that SIGHUPs and reloads interrupt the sleeping.
<a name="outputs"></a>
## Outputs

### Blackhole

This output bot discards all incoming messages.

#### Information
* `name`: blackhole
* `lookup`: no
* `public`: yes
* `cache`: no
* `description`: discards messages

* * *


### File

#### Information:
Expand Down
5 changes: 5 additions & 0 deletions intelmq/bots/BOTS
Original file line number Diff line number Diff line change
Expand Up @@ -806,6 +806,11 @@
"username": "<your amqp username>"
}
},
"Blackhole": {
"description": "AMQP Topic is the bot responsible to send events to a AMQP topic exchange.",
"module": "intelmq.bots.outputs.blackhole.output",
"parameters": {}
},
"Elasticsearch": {
"description": "Elasticsearch is the bot responsible to send events to a elasticsearch.",
"module": "intelmq.bots.outputs.elasticsearch.output",
Expand Down
Empty file.
12 changes: 12 additions & 0 deletions intelmq/bots/outputs/blackhole/output.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# -*- coding: utf-8 -*-
from intelmq.lib.bot import Bot


class BlackholeOutputBot(Bot):

def process(self):
self.receive_message()
self.acknowledge_message()


BOT = BlackholeOutputBot
Empty file.
21 changes: 21 additions & 0 deletions intelmq/tests/bots/outputs/blackhole/test_output.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
import unittest

import intelmq.lib.test as test
from intelmq.bots.outputs.blackhole.output import BlackholeOutputBot


class TestBlackholeOutputBot(test.BotTestCase, unittest.TestCase):

@classmethod
def set_bot(cls):
cls.bot_reference = BlackholeOutputBot

def test_event(self):
self.run_bot()
self.assertOutputQueueLen(0)



if __name__ == '__main__': # pragma: no cover
unittest.main()

0 comments on commit 629329f

Please sign in to comment.