This is a Python client API for Docket which is a RESTful API for Stenographer.
This library is primarily for use with ROCK NSM to easily automate retrieval of network traffic for post-process analysis.
pip install docketapi --user
fromdocketapiimportDocketClient# create a clientdocket=DocketClient('https://rock_nsm_url', 'username', 'password', verify=False)
# perform a querymy_query=docket.query(
after='2019-04-20T21:07:59.689Z',
before='2019-04-30T21:07:59.689Z',
host=['151.101.68.223'],
proto_name='TCP',
port=['443']
)
# retrieve pcappcap=docket.get_pcap(my_query)
# save pcapdocket.save_pcap(pcap, filename='my_traffic.pcap')See the Docs on RTD for full documentation.