Skip to content

Commit

Permalink
pass the info about peer to tanner
Browse files Browse the repository at this point in the history
  • Loading branch information
afeena committed Jun 1, 2016
1 parent bc11830 commit 1e15e68
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion snare.py
Expand Up @@ -129,11 +129,16 @@ def handle_request(self, request, payload):
for key, val in post_data.items():
print('\t- {0}: {1}'.format(key, val))
header = {key: value for (key, value) in request.headers.items()}
peer = dict(
ip=self.transport.get_extra_info('peername')[0],
port=self.transport.get_extra_info('peername')[1]
)
data = dict(
method=request.method,
path=request.path,
headers=header,
uuid=snare_uuid.decode('utf-8')
uuid=snare_uuid.decode('utf-8'),
peer=peer
)
# Submit the event to the TANNER service
event_result = yield from self.submit_data(data)
Expand Down

0 comments on commit 1e15e68

Please sign in to comment.