|
1 | | -We happily welcome contributions. We accept PRs pursuant to a CLA. |
| 1 | +# Contributing to Security Analysis Tool (SAT) |
| 2 | + |
| 3 | +Thank you for your interest in contributing to the Databricks Security Analysis Tool! We welcome contributions from the community, and we accept PRs pursuant to a CLA. |
| 4 | + |
| 5 | +## Getting Started |
| 6 | + |
| 7 | +Before you begin: |
| 8 | + |
| 9 | +1. **Check existing issues**: Look through [GitHub Issues](https://github.com/databricks-industry-solutions/security-analysis-tool/issues) to see if your bug report or feature request already exists |
| 10 | +2. **Read the documentation**: Familiarize yourself with [SAT Documentation](https://databricks-industry-solutions.github.io/security-analysis-tool/) |
| 11 | +3. **Understand the project structure**: Review the codebase organization |
| 12 | + |
| 13 | +### Project Structure |
| 14 | + |
| 15 | +``` |
| 16 | +security-analysis-tool/ |
| 17 | +├── src/ # Python SDK source code |
| 18 | +│ ├── securityanalysistoolproject/ # Main SAT SDK |
| 19 | +│ └── brickhound/ # Permissions & Resources Analysis |
| 20 | +├── notebooks/ # Databricks notebooks |
| 21 | +│ ├── Setup/ # Installation and configuration |
| 22 | +│ ├── Includes/ # Helper modules |
| 23 | +│ └── brickhound/ # Permissions & Resources Analysis notebooks |
| 24 | +├── app/brickhound/ # Permissions & Resources Analysis web UI |
| 25 | +├── terraform/ # Infrastructure as Code SAT Installation |
| 26 | +├── dabs/ # Databricks Asset Bundles SAT Installation |
| 27 | +├── configs/ # Configuration files |
| 28 | +├── dashboards/ # AI/BI dashboard |
| 29 | +└── docs/ # Documentation site |
| 30 | +``` |
| 31 | + |
| 32 | +## Development Setup |
| 33 | + |
| 34 | +### Prerequisites |
| 35 | + |
| 36 | +- Python 3.8 or higher |
| 37 | +- Access to a Databricks workspace (for testing) |
| 38 | +- Git |
| 39 | + |
| 40 | +### Local Setup |
| 41 | + |
| 42 | +1. **Clone the repository**: |
| 43 | +```bash |
| 44 | +git clone https://github.com/databricks-industry-solutions/security-analysis-tool.git |
| 45 | +cd security-analysis-tool |
| 46 | +``` |
| 47 | + |
| 48 | +2. **Set up Python environment**: |
| 49 | +```bash |
| 50 | +python -m venv .venv |
| 51 | +source .venv/bin/activate # On Windows: .venv\Scripts\activate |
| 52 | + |
| 53 | +# Install SDK in development mode |
| 54 | +cd src/securityanalysistoolproject |
| 55 | +pip install -e . |
| 56 | +``` |
| 57 | + |
| 58 | +3. **Install development dependencies**: |
| 59 | +```bash |
| 60 | +pip install pytest |
| 61 | +``` |
| 62 | + |
| 63 | +## How to Contribute |
| 64 | + |
| 65 | +### Types of Contributions |
| 66 | + |
| 67 | +We welcome: |
| 68 | + |
| 69 | +1. **Bug Fixes** - Fix issues in existing code |
| 70 | +2. **New Features** - Add new security checks or analysis capabilities |
| 71 | +3. **Documentation** - Improve or add documentation |
| 72 | +4. **Testing** - Add or improve test coverage |
| 73 | + |
| 74 | +### Reporting Bugs |
| 75 | + |
| 76 | +When reporting bugs, please include: |
| 77 | + |
| 78 | +- Clear description of what happened vs. what you expected |
| 79 | +- Steps to reproduce the issue |
| 80 | +- Environment details (Databricks runtime, cloud provider, SAT version) |
| 81 | +- Error messages and stack traces |
| 82 | +- Screenshots if applicable |
| 83 | + |
| 84 | +**Security vulnerabilities** should be reported to `bugbounty@databricks.com` (see [SECURITY.md](SECURITY.md)) |
| 85 | + |
| 86 | +### Suggesting Features |
| 87 | + |
| 88 | +When suggesting features, explain: |
| 89 | + |
| 90 | +- The use case and why it would be useful |
| 91 | +- How you envision it working |
| 92 | +- Who would benefit from it |
| 93 | + |
| 94 | +## Pull Request Process |
| 95 | + |
| 96 | +### Branch Naming |
| 97 | + |
| 98 | +Use descriptive branch names: |
| 99 | +- `feature/add-azure-security-check` |
| 100 | +- `bugfix/fix-aws-credential-scan` |
| 101 | +- `docs/update-installation-guide` |
| 102 | + |
| 103 | +### Submitting a Pull Request |
| 104 | + |
| 105 | +1. **Fork the repository** and create your branch from `main`: |
| 106 | +```bash |
| 107 | +git checkout -b feature/your-feature-name |
| 108 | +``` |
| 109 | + |
| 110 | +2. **Make your changes**: |
| 111 | + - Write clear, readable code |
| 112 | + - Add tests for new functionality |
| 113 | + - Update documentation as needed |
| 114 | + |
| 115 | +3. **Commit your changes**: |
| 116 | +```bash |
| 117 | +git commit -m "Add new Azure security check for Key Vault |
| 118 | +
|
| 119 | +- Added check for Key Vault soft delete |
| 120 | +- Added unit tests |
| 121 | +- Updated documentation" |
| 122 | +``` |
| 123 | + |
| 124 | +4. **Push to your fork** and open a Pull Request with a clear description |
| 125 | + |
| 126 | +### Commit Message Format |
| 127 | + |
| 128 | +Use clear, descriptive commit messages: |
| 129 | + |
| 130 | +- `feat: add new feature` |
| 131 | +- `fix: resolve bug` |
| 132 | +- `docs: update documentation` |
| 133 | +- `test: add tests` |
| 134 | + |
| 135 | +### Pull Request Review |
| 136 | + |
| 137 | +- At least one maintainer must approve the PR |
| 138 | +- All tests must pass |
| 139 | +- Documentation must be updated if needed |
| 140 | + |
| 141 | +## Testing |
| 142 | + |
| 143 | +Run tests before submitting: |
| 144 | + |
| 145 | +```bash |
| 146 | +cd src/securityanalysistoolproject |
| 147 | +pytest |
| 148 | +``` |
| 149 | + |
| 150 | +## Documentation |
| 151 | + |
| 152 | +### Updating Documentation |
| 153 | + |
| 154 | +When making changes: |
| 155 | + |
| 156 | +1. Update inline documentation (docstrings) |
| 157 | +2. Update user-facing docs in `docs/sat/docs/` if needed |
| 158 | +3. Update README if necessary |
| 159 | +4. Update CHANGELOG.md |
| 160 | + |
| 161 | +### Preview Documentation |
| 162 | + |
| 163 | +```bash |
| 164 | +cd docs/sat |
| 165 | +npm install |
| 166 | +npm start |
| 167 | +``` |
| 168 | + |
| 169 | +## Versioning |
| 170 | + |
| 171 | +SAT follows **Semantic Versioning** (SemVer): `MAJOR.MINOR.PATCH` |
| 172 | + |
| 173 | +- **MAJOR**: Incompatible API changes |
| 174 | +- **MINOR**: New features (backward-compatible) |
| 175 | +- **PATCH**: Bug fixes (backward-compatible) |
| 176 | + |
| 177 | +See [VERSIONING.md](VERSIONING.md) for detailed guidelines. |
| 178 | + |
| 179 | +### Branch Strategy |
| 180 | + |
| 181 | +- `main`: Stable production releases |
| 182 | +- `release/x.x.x`: Release preparation branches |
| 183 | +- `feature/*`: New features |
| 184 | +- `bugfix/*`: Bug fixes |
| 185 | + |
| 186 | +## Code Style |
| 187 | + |
| 188 | +- Follow PEP 8 conventions |
| 189 | +- Use meaningful variable and function names |
| 190 | +- Add docstrings to public functions |
| 191 | +- Handle errors appropriately |
| 192 | +- Don't commit sensitive data (credentials, tokens, etc.) |
| 193 | + |
| 194 | +## License and CLA |
| 195 | + |
| 196 | +By contributing to this project, you agree to the Contributor License Agreement (CLA). All pull requests require CLA acceptance before merging. |
| 197 | + |
| 198 | +This project is licensed under the Databricks License. See [LICENSE](LICENSE) for details. |
| 199 | + |
| 200 | +## Getting Help |
| 201 | + |
| 202 | +- **Documentation**: https://databricks-industry-solutions.github.io/security-analysis-tool/ |
| 203 | +- **GitHub Issues**: For bug reports and feature requests |
| 204 | +- **Security Issues**: bugbounty@databricks.com |
| 205 | + |
| 206 | +## Recognition |
| 207 | + |
| 208 | +Contributors are recognized in release notes and CHANGELOG.md. |
| 209 | + |
| 210 | +Thank you for contributing to SAT! 🔒 |
0 commit comments