Development

If you are interested in contributing to the project please read through the following sections.

Websnort API

The codebase is quite simple with the execution logic defined in websnort.runner:

websnort.runner.is_pcap(pcap)[source]

Simple test for pcap magic bytes in supplied file.

Parameters:pcap – File path to Pcap file to check
Returns:True if content is pcap (magic bytes present), otherwise False.
websnort.runner.run(pcap)[source]

Runs all configured IDS instances against the supplied pcap.

Parameters:pcap – File path to pcap file to analyse
Returns:Dict with details and results of run/s

Bottle App

And the web handling, bottle routes defined in websnort.web:

websnort.web.home()[source]

Main page, displays a submit file form.

websnort.web.api_submit()[source]

Blocking POST handler for file submission. Runs snort on supplied file and returns results as json text.

websnort.web.submit_and_render()[source]

Blocking POST handler for file submission. Runs snort on supplied file and returns results as rendered html.

IDS Plugins

Interfacing with other IDS systems is possible by implementing a new plugin. The plugin can either be statically registered in websnort.plugins.registry or hooked in at install time by defining the correct setuptools entrypoint in your project.

See websnort.runner.IDSRunner for expected class API.

class websnort.plugins.IDSRunner(conf)[source]
run(pcap)[source]

Run the IDS over the supplied pcap.

Parameters:pcap – File path to Pcap for analysis.
Returns:A tuple of version, alerts list.

Pull Requests

If you wish to contribute a bug fix or feature, please open a pull request on the GitHub project page for discussion/review. While not strictly enforced, the code-style should follow python PEP8 standard.

Licensing

All contributions to the project are to be made under the terms of the GNU Public License v3.

Copyright of any contributions remain the property of the original authors. If there are significant community contributions to the project we will look at updating the copyright headers of the project to make it clear that the project copyright and ownership is that of all said community developers.

Issues

If you have encountered a problem or need help in some aspect of the project you are probably not alone. Please raise an issue in the issue tracker on the project’s GitHub page so other users can benefit from the answers too.