-
Entry point:
slips.py- Starts the main process
- Spawns modules
- Supports interactive and daemon modes
-
Core code directories:
slips/slips_files/managers/
-
Detection modules:
- Located in
modules/ - Must implement
IModulefrom:slips_files/common/abstracts/module.py
- Located in
-
Configuration:
- Main file:
config/slips.yaml
- Main file:
-
Tests:
- Located in
tests/ - Includes unit and integration tests
- Located in
-
Documentation:
- Located in
docs/ - Contribution guide:
docs/contributing.md
- Located in
-
UI / tools:
SlipsWeb/webinterface/webinterface.shkalipso.sh
-
Repository root:
- All commands MUST be executed from
StratosphereLinuxIPS/
- All commands MUST be executed from
./slips.py -e 1 -f dataset/test7-malicious.pcap -o output_dir
docker build --no-cache -t slips -f docker/Dockerfile .
- If networking fails:
docker build --network=host --no-cache -t slips -f docker/Dockerfile .
docker run -it --rm --net=host slips
These rules MUST be followed:
- No trailing whitespace
- File must end with a newline
- Docstring must be the first statement in a file (if present)
- Avoid using environment variables, use variables from slips/config.yaml instead.
- Use type annotations for all functions and methods parameters and return types.
- Use utils.start_thread whenever you need to start a new thread.
- NEVER use absolute paths
- ALWAYS use relative paths
- If a non-debug file is created → MUST be added with git add
If a feature is added → MUST update relevant docs in docs/
- Every new function MUST include a docstring Docstrings MUST include:
- Short description
- Parameters (if applicable)
- Return value (if applicable). if the return value is None, it should not be explicitly stated in the docstring, just add it as a type annotation.
- newly added functions in database_manager.py should never have a docstring, and should always have (*args, **kwargs) as args and should always forward these (*args, **kwargs) to the function it calls.
- Canonical test runner tests/run_all_tests.sh
When instructed to "update unit tests", follow EXACTLY:
Step 1 — Run tests
python3 -m pytest tests/unit/
--ignore="tests/integration_tests"
-n 7 -p no:warnings -vvvv -s
Step 2 — Identify failures Collect ALL failing tests
Step 3 — Fix tests Update failing tests ONE BY ONE Do NOT batch fixes
Step 4 — Add missing tests for new files For every new source file in the branch:
-
Mirror its directory under tests/unit/
-
C/reate file: test_.py
-
Add unit tests for that file
Step 5 — Add tests for new functions
- Identify functions added in this branch (not in origin/develop)
- Add unit tests for each new function
Step 6 — Test structure rules
- MUST use @pytest.mark.parametrize when applicable
EACH test MUST: Start with object creation using module_factory
Step 7 — Re-run tests Run the same pytest command again Ensure ALL tests pass
Step 8 — Git tracking If new test files were created → run: git add
Step 9 — Failure fallback If tests are still failing and cannot be fixed: STOP Report the issue
ALSO apply rules from: private/AGENTS.md
If conflicts occur: Prefer private/AGENTS.md