Contributing¶
Thanks for your interest in contributing to IndustrialScanner!
Getting started¶
- Fork the repository
- Clone your fork:
- Set up the development environment:
- Create a branch:
Development workflow¶
Run quality checks before pushing¶
ruff check .
ruff format .
mypy modbus_scanner s7_comm_analyzer dnp3_monitor ics_scanner
pytest --cov=modbus_scanner --cov=s7_comm_analyzer --cov=dnp3_monitor
bandit -r modbus_scanner s7_comm_analyzer dnp3_monitor ics_scanner -c pyproject.toml
Commit style¶
Use Conventional Commits:
feat: add PROFINET parser
fix: correct S7Comm parameter block offset
sec: prevent XSS in DNP3 HTML report
docs: add MITRE ATT&CK mapping reference
ci: add Python 3.13 to test matrix
test: add property-based tests for DNP3 parser
refactor: extract shared security primitives to ics_scanner module
Adding a new protocol parser¶
IndustrialScanner uses a plugin system via setuptools entry points. To add a new protocol:
-
Create a parser module that implements the
ProtocolParserprotocol: -
Register it via entry points in your
pyproject.toml: -
Add tests in
tests/test_profinet_parser.py -
Update the docs with the new protocol page
Testing¶
- Unit tests:
tests/test_*.py - Property-based tests:
tests/test_*_property.py(Hypothesis) - Snapshot tests:
tests/test_html_snapshots.py(useUPDATE_SNAPSHOTS=1to update baselines) - Coverage target: 80%+
Pull request checklist¶
- [ ] Tests pass locally
- [ ] Coverage did not decrease
- [ ]
ruff checkandruff format --checkpass - [ ]
mypypasses - [ ]
banditpasses (no HIGH severity findings) - [ ] Commit messages follow Conventional Commits
- [ ] PR template filled out (including security checklist)
Code of Conduct¶
By participating, you agree to abide by our Code of Conduct.
License¶
By contributing, you agree that your contributions will be licensed under the MIT License.