Skip to content

A hypothesis extension which allows for dedicated continuous fuzzing on a separate machine

License

Notifications You must be signed in to change notification settings

hypothesis-imperial/hypothesis-server

Repository files navigation

Hypothesis Server

An addon for the Hypothesis testing library that enables continuous fuzzing tests on a dedicated server.

Getting Started

Install the package:

pip install hypothesisfuzzer

Then, create a server:

from hypothesisfuzzer import FuzzServer

app = FuzzServer(config_path='config.yml')
app.run()

This will automatically start running a server which will read from the supplied config path.

The server does 3 things:

  • When it receives a GitHub webhook HTTP request to its /webhook route, it will (provided the configuration has been set up correctly), it will start running indefinite Hypothesis tests.
  • There is a /get_errors route which will return all the error inputs for the tests which were found through the continuous fuzzing process. You may choose to integrate this with CI and local development testing.
  • Last but not least, there is a front end web UI in React that allows you to see current fuzzing progress, failing test cases for different repos, etc.

Config file

In a YAML configuration file,

repos:
  repo1:
    owner: hypothesis-imperial # Mandatory
    name: fuzzing-sample-product-poc # Mandatory
    git_url: https://github.com/hypothesis-imperial/fuzzing-sample-product-poc.git
    project_root: "" # Optional; Default is just git directory root
    branch: master # optional; Default master
    requirements_file: requirements.txt # Optional: Default in project_root normally; otherwise give path relative to project_root
    tests_folder: tests # Optional: Default is "test" in project_root
    fuzz_on_start: True # Optional: Whether to pull and start fuzzing on server start, Default True

  repo2:
    owner: owner_McOwnerson
    name: not-a-real-repo
    git_url: https://github.com/owner_McOwnerson/not-a-real-repo.git
    project_root: part-one
    branch: develop
    requirements_file: ../requirements.txt
    tests_folder: tests #in part-one
    fuzz_on_start: False

Usage

To get started fuzzing, add a webhook to your GitHub repository pointing to the /webhook route, and push a commit!

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Acknowledgments

  • David MacIver, the original author of Hypothesis, for being so helpful during the development of this project during our third year group project at Imperial College London
  • Robert Chatley, our group project supervisor who gave us invaluable advice and mentorship

About

A hypothesis extension which allows for dedicated continuous fuzzing on a separate machine

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •