|
| 1 | +# AGENTS.md |
| 2 | + |
| 3 | +## Project overview |
| 4 | +- Entry point: `slips.py` (starts the main process, spawns modules, runs in interactive/daemon modes). |
| 5 | +- Core framework code lives in `slips/`, `slips_files/`, and `managers/`. |
| 6 | +- Detection/analysis modules are in `modules/` (implement the `IModule` interface). |
| 7 | +- Configuration is in `config/` (main config: `config/slips.yaml`). |
| 8 | +- Tests live under `tests/` (unit + integration suites). |
| 9 | +- Documentation is in `docs/` (see `docs/contributing.md` for contribution workflow, branching, and PR expectations). |
| 10 | +- UIs/tools: `SlipsWeb/`, `webinterface/`, `webinterface.sh`, and `kalipso.sh`. |
| 11 | + |
| 12 | +## Build and test commands |
| 13 | +- Run locally (no build step): |
| 14 | + - `./slips.py -e 1 -f dataset/test7-malicious.pcap -o output_dir` |
| 15 | +- Build the Docker image (from `docs/installation.md`): |
| 16 | + - `docker build --no-cache -t slips -f docker/Dockerfile .` |
| 17 | + - If build networking fails: `docker build --network=host --no-cache -t slips -f docker/Dockerfile .` |
| 18 | +- Run the Docker image: |
| 19 | + - `docker run -it --rm --net=host slips` |
| 20 | + |
| 21 | +## Code style guidelines |
| 22 | +- Python formatting is enforced via pre-commit: |
| 23 | + - Black with `--line-length 79` (see `.pre-commit-config.yaml`). |
| 24 | + - Ruff is used for linting and autofixes. |
| 25 | +- Keep docstrings at the top of files where present (pre-commit `check-docstring-first`). |
| 26 | +- Maintain clean whitespace (no trailing whitespace, final newline). |
| 27 | +- Follow existing module patterns (`IModule` in `slips_files/common/abstracts/module.py`). |
| 28 | + |
| 29 | +## Testing instructions |
| 30 | +- The canonical test runner is `tests/run_all_tests.sh` (runs unit tests then integration tests). |
| 31 | +- Equivalent manual sequence (from `tests/run_all_tests.sh`): |
| 32 | + - `./slips.py -cc` |
| 33 | + - `printf "0" | ./slips.py -k` |
| 34 | + - `python3 -m pytest tests/ --ignore="tests/integration_tests" -n 7 -p no:warnings -vvvv -s` |
| 35 | + - `python3 tests/destrctor.py` |
| 36 | + - `./slips.py -cc` |
| 37 | + - `printf "0" | ./slips.py -k` |
| 38 | + - `python3 -m pytest -s tests/integration_tests/test_portscans.py -p no:warnings -vv` |
| 39 | + - `python3 -m pytest -s tests/integration_tests/test_dataset.py -p no:warnings -vv` |
| 40 | + - `python3 -m pytest -s tests/integration_tests/test_config_files.py -p no:warnings -vv` |
| 41 | + - `printf "0" | ./slips.py -k` |
| 42 | + - `./slips.py -cc` |
0 commit comments