Thank you for your interest in contributing to Cyntrisec! We welcome contributions from the community to help make cloud security more accessible and effective.
- Safety First: Cyntrisec is designed to be a read-only tool by default. Any code that modifies AWS state must be gated behind explicit user opt-in flags and the
--enable-unsafe-write-modeglobal flag. - Privacy: We do not send data to external servers. All analysis happens locally.
- Correctness: Attack paths should be deterministic and verifiable. We prioritize low false positives.
Cyntrisec requires Python 3.11 or higher. We recommend using a virtual environment.
-
Clone the repository:
git clone https://github.com/cyntrisec/cyntrisec.git cd cyntrisec -
Create a virtual environment:
python -m venv .venv # Windows .\.venv\Scripts\activate # Linux/MacOS source .venv/bin/activate
-
Install dependencies: Install the package in editable mode with development and MCP dependencies:
pip install -e ".[dev,mcp]"
We use Ruff for linting and formatting, and mypy for static type checking.
# Run linter
ruff check .
# Fix linting issues automatically
ruff check --fix .
# Run type checker
mypy srcWe use pytest for testing. Please ensure all tests pass before submitting a PR.
# Run all tests
pytest
# Run tests with coverage
pytest --cov=src
# Run a specific test file
pytest tests/unit/test_graph_builder.pysrc/cyntrisec/core/: proper graph logic, schema definitions, and analysis algorithms.src/cyntrisec/aws/: AWS collectors and data normalization.src/cyntrisec/cli/: Typer-based CLI interface commands.src/cyntrisec/mcp/: Model Context Protocol server implementation.tests/: Unit and integration tests.
- Fork the repository and create a feature branch.
- Write code adhering to the style guides.
- Add tests for your new functionality.
- Run checks: Ensure
ruff,mypy, andpytestall pass. - Update Documentation: If you changed CLI commands or logic, update
README.md. - Changelog: Add a note to
CHANGELOG.mdunder the[Unreleased]section if the change is user-facing. - Submit a Pull Request: Describe your changes and the problem they solve.
If you are modifying the capability graph (e.g., adding a new EdgeKind or IAM permission):
- Update
src/cyntrisec/core/schema.pyif a new enum is needed. - Update
src/cyntrisec/aws/relationship_builder.pyto implement the logic. - Crucial: Add a test case in
tests/unit/test_relationship_builder.pyverifying the edge creation and properties. - Verify impact on attack paths by running
pytest tests/integration/test_attack_path_scenarios.py.
By contributing, you agree that your contributions will be licensed under its Apache License 2.0.