Contributing¶
PIDSMaker aims to keep up with the latest research on provenance-based and network intrusion detection, and it can only do so with the help of the community. Every contribution is welcome!
-
Talk to us first
Questions, ideas, or a contribution to discuss before starting? Join the Discord.
-
Report a bug
Open an issue on GitHub with the command you ran and the error.
What to contribute¶
- A new system: your published PIDS or NIDS, so that others can benchmark against it. Start with the tutorial.
- New components: encoders, decoders, objectives, featurization methods, provenance or network datasets...
- Fixes to existing systems: some systems may not perfectly reflect their original implementation.
- Bug fixes and optimizations: spotted a slow operation and found a better alternative? Send it!
- Documentation: typos, unclear explanations, missing examples. Every page has an edit button.
Development tips¶
- Install from source
- Clone the repository and install it in editable mode, with the test dependencies:
pip install -e ".[test]"(see Installation). Your changes are used without reinstalling. - Avoid concurrent runs from scratch
- Two runs started at the same time with the same
constructionarguments on the same dataset write to the same folder, which can silently corrupt their outputs. Start the first run, wait until the shared tasks are done, then launch the others. Alternatively, use--restart_from_scratch. See Caching of tasks. - Iterate quickly
- Use a small dataset such as
CLEARSCOPE_E3orCADETS_E3, and--force_restart=TASKto re-run only the task you are changing.
Before opening a pull request¶
- Format the code. The repository uses ruff through pre-commit:
- Run the tests. Functional tests check that changes to one component don't break the others. Update them when you add a component. They run the pipeline in test mode on a small sample of CLEARSCOPE_E3 (
tests/fixtures/), written as a temporary Parquet dataset: they need neither the full datasets nor a database server. === "GPU" === "CPU" === "Full dataset" === "Coverage" The tests also run on CPU with GitHub Actions on every pull request (.github/workflows/tests.yml), on Python 3.9 and 3.11. Seetests/README.mdfor all options. - Update the documentation. If you added or changed arguments in
pidsmaker/config/config.py, regenerate the reference and check the docs locally (see below).
Building the documentation¶
The documentation is built with Zensical from the docs/ folder. Zensical needs Python ≥ 3.10 (≥ 3.11 for the version used by the CI, 0.1.3). With a PIDSMaker environment in Python 3.11, install it there:
With a PIDSMaker environment in Python 3.9 or 3.10, install Zensical in a separate environment with Python ≥ 3.11.
Then, with PIDSMaker installed from source (the argument reference is generated by importing pidsmaker):
cd docs
./build.sh # regenerate the argument reference, then build
zensical serve -a 0.0.0.0:8000 # live preview on http://localhost:8000/PIDSMaker/
Zensical reports broken links and anchors at every build: please fix them before opening your pull request.
| What | Where |
|---|---|
| Pages | docs/docs/**/*.md |
| Navigation, theme, redirects | docs/zensical.toml |
| Styles | docs/docs/stylesheets/extra.css |
| Generated argument lists | docs/scripts/args/, produced by docs/scripts/get_arguments.py |
The site is deployed to GitHub Pages automatically when changes are merged into main.
Releasing a new version¶
Maintainers release a version in two steps:
- In a pull request, set
versioninpyproject.toml(e.g.5.1.0), update the release notes table of the README, and write the notes of the GitHub release in.github/releases/5.1.0.md. - Once it is merged, run the workflow from Actions > publish > Run workflow, on
main, with the version5.1.0.
The workflow (.github/workflows/publish.yml) checks that the version is the one of pyproject.toml and that it is not released yet. Then it builds the package and publishes it to PyPI, creates the tag and the GitHub release (with the notes of .github/releases/<version>.md, or the list of the merged pull requests if there is no such file), and announces it on Discord. PyPI trusts this workflow as a trusted publisher, so no token is stored in the repository.
A release published from the GitHub page, with a tag equal to the version of pyproject.toml, is also published to PyPI.