Find file History
Latest commit 73a5381 May 21, 2015 @rep Merge pull request #31 from jt6211/user-management
added scripts (simple user management) and a README to aid with hpfeeds broker usage
Permalink
..
Failed to load latest commit information.
README.md added scripts (simple user management) and a README to aid with hpfee… May 6, 2014
add_user.py added scripts (simple user management) and a README to aid with hpfee… May 6, 2014
broker.py
config.py add some debug logging, fix connection leak, fix auth bug, modify sta… Jun 3, 2014
database.py
dump_users.py added scripts (simple user management) and a README to aid with hpfee… May 6, 2014
proto.py add new broker (hpfriends backport) Jun 3, 2014
testbroker.py add some debug logging, fix connection leak, fix auth bug, modify sta… Jun 3, 2014
utils.py add new broker (hpfriends backport) Jun 3, 2014

README.md

hpfeeds broker

Adding a user (new sensor or new client)

The hpfeeds broker stores user credentials in mongodb. The add_user.py and dump_users.py scripts assist in setting up new users and troubleshooting. add_user.py can also be used to update an existing user.

Adding a new sensor (publish only)

$ python add_user.py dionaea.1234 6t5r4e46g7y8j8 dionaea.events,dionaea.capture ""
inserted {'subscribe': [], 'secret': '6t5r4e46g7y8j8', 'identifier': 'dionaea.1234', 'publish': ['dionaea.events', 'dionaea.capture']}

Adding a new client (subscribe only)

$ python add_user.py webapp.4567 p0o9i8u7ycj "" dionaea.events,dionaea.capture
inserted {'subscribe': ['dionaea.events', 'dionaea.capture'], 'secret': 'p0o9i8u7ycj', 'identifier': 'webapp.4567', 'publish': []}

Updating a user:

$ python add_user.py webapp.4567 abc12345678 "" dionaea.events,dionaea.capture,thug.files,kippo.events
updated {'subscribe': ['dionaea.events', 'dionaea.capture', 'thug.files', 'kippo.events'], 'secret': 'abc12345678', 'identifier': 'webapp.4567', 'publish': []}

Dumping the users from mongodb

$ python dump_users.py
{u'subscribe': [], u'secret': u'6t5r4e46g7y8j8', u'_id': ObjectId('5368e587b391d1d314123a33'), u'publish': [u'dionaea.events', u'dionaea.capture'], u'identifier': u'dionaea.1234'}
{u'subscribe': [u'dionaea.events', u'dionaea.capture'], u'secret': u'p0o9i8u7ycj', u'_id': ObjectId('5368e5d7b391d1d314123a34'), u'publish': [], u'identifier': u'webapp.4567'}

Running the Broker

$ python feedbroker.py