Thank you for your interest in contributing to the K8s Exploit Toolkit! This document provides guidelines and information for contributors.
This project adheres to a code of conduct. By participating, you are expected to uphold this code.
As this is a security-focused project, please keep in mind:
- All contributions must be for educational and defensive purposes only
- Include proper documentation explaining the security implications
- Follow responsible disclosure practices
- Search existing issues to avoid duplicates
- Use the bug report template when creating new issues
- Provide detailed information:
- Kubernetes version
- Python version
- Complete error messages
- Steps to reproduce
- Check existing feature requests first
- Create a detailed proposal including:
- Educational value
- Security relevance
- Implementation approach
- Potential risks
-
Fork and clone the repository:
git clone https://github.com/yourusername/k8s-exploit-toolkit cd k8s-exploit-toolkit -
Install uv (if not already installed):
curl -LsSf https://astral.sh/uv/install.sh | sh -
Install dependencies:
uv sync
-
Run tests to ensure everything works:
uv run pytest
- Follow PEP 8 style guidelines
- Use type hints where appropriate
- Write comprehensive docstrings for all public functions
- Add unit tests for new functionality
- Update documentation as needed
When adding new container security exploits:
- Educational Focus: Ensure the exploit teaches important security concepts
- Safety First: Include proper safety mechanisms and warnings
- Documentation: Provide clear explanations of the vulnerability
- Remediation: Always include corresponding security fixes
- Testing: Add comprehensive test coverage
Example structure:
class NewExploit(BaseExploit):
name = "Descriptive Exploit Name"
risk_level = "HIGH" # LOW, MEDIUM, HIGH, CRITICAL
vulnerability_type = "container-security"
description = "Clear explanation of what this demonstrates"
def get_vulnerable_patch(self) -> List[Dict]:
"""Return JSON patches to make service vulnerable."""
pass
def get_secure_patch(self) -> List[Dict]:
"""Return JSON patches to secure the service."""
pass
def run_exploit(self) -> ExploitResult:
"""Demonstrate the security vulnerability safely."""
pass- Use clear, concise language
- Include practical examples
- Explain security implications
- Provide remediation steps
- Update README if needed
Run the full test suite before submitting:
# Unit tests
uv run pytest tests/
# Integration tests (requires K8s cluster)
uv run pytest tests/integration/
# Code coverage
uv run pytest --cov=k8s_exploit_toolkit
# Code quality checks
uv run black k8s_exploit_toolkit/
uv run ruff check k8s_exploit_toolkit/
uv run mypy k8s_exploit_toolkit/-
Create a feature branch:
git checkout -b feature/your-feature-name
-
Make your changes following the guidelines above
-
Commit with descriptive messages:
git commit -m "feat: add new privilege escalation demo - Implement container escape demonstration - Add corresponding security remediation - Include comprehensive documentation"
-
Push to your fork:
git push origin feature/your-feature-name
-
Create a Pull Request with:
- Clear title and description
- Reference to any related issues
- Screenshots or demo output if applicable
- Keep changes focused - one feature/fix per PR
- Update tests for any new functionality
- Update documentation if needed
- Ensure CI passes before requesting review
- Be responsive to reviewer feedback
k8s-exploit-toolkit/
├── k8s_exploit_toolkit/ # Main package
│ ├── container/ # Container security modules
│ │ ├── assessment/ # Security assessment tools
│ │ ├── exploits/ # Exploit implementations
│ │ ├── remediations/ # Security fix implementations
│ │ └── core/ # Shared utilities
│ └── cli.py # Command-line interface
├── tests/ # Test suite
│ ├── unit/ # Unit tests
│ └── integration/ # Integration tests
├── docs/ # Documentation
└── examples/ # Usage examplesContributors will be acknowledged in:
- CHANGELOG.md for significant contributions
- Project documentation where appropriate
- Special thanks in release notes
- GitHub Issues: For bugs and feature requests
- GitHub Discussions: For questions and general discussion
- Security Issues: Please report privately via email
By contributing, you agree that:
- Your contributions will be licensed under the Apache 2.0 License
- You have the right to contribute the code
- Your contributions are for educational and defensive purposes only