|
| 1 | +Metadata-Version: 2.4 |
| 2 | +Name: openaudit |
| 3 | +Version: 0.1.0 |
| 4 | +Summary: Offline-first security audit tool (secrets & config scanning) for local codebases. |
| 5 | +Author-email: OpenAuditKit Team <info@openauditkit.org> |
| 6 | +License: MIT |
| 7 | +Classifier: Programming Language :: Python :: 3 |
| 8 | +Classifier: License :: OSI Approved :: MIT License |
| 9 | +Classifier: Operating System :: OS Independent |
| 10 | +Requires-Python: >=3.9 |
| 11 | +Description-Content-Type: text/markdown |
| 12 | +License-File: LICENSE |
| 13 | +Requires-Dist: typer>=0.9.0 |
| 14 | +Requires-Dist: pyyaml>=6.0 |
| 15 | +Requires-Dist: rich>=13.0.0 |
| 16 | +Requires-Dist: pydantic>=2.0.0 |
| 17 | +Requires-Dist: pathspec>=0.11.0 |
| 18 | +Dynamic: license-file |
| 19 | + |
| 20 | +# OpenAuditKit |
| 21 | + |
| 22 | +OpenAuditKit is an open-source CLI security audit tool designed to scan your codebase for secrets and configuration vulnerabilities. It emphasizes offline capability, modular design, and secure handling of sensitive data (secret masking). |
| 23 | + |
| 24 | +## Features |
| 25 | +- **Secret Scanning**: Detects API keys and secrets using regex and entropy checks. |
| 26 | +- **Config Scanning**: Identifies misconfigurations in deployment files (e.g., .env, Dockerfile). |
| 27 | +- **Secure**: Secrets are masked in outputs; offline-first design. |
| 28 | +- **Backend Ready**: Feature-based architecture with Pydantic models for easy integration into dashboards or APIs. |
| 29 | +- **Customizable**: Add your own rules! See [Rule Documentation](rules/README.md). |
| 30 | + |
| 31 | +## 🛡️ Why OpenAuditKit? |
| 32 | + |
| 33 | +Often, security tools are either too simple (grep) or too complex (enterprise SAST). OpenAuditKit bridges the gap: |
| 34 | + |
| 35 | +| Feature | OpenAuditKit | Gitleaks | TruffleHog | |
| 36 | +| :--- | :---: | :---: | :---: | |
| 37 | +| **Secret Scanning** | ✅ | ✅ | ✅ | |
| 38 | +| **Config Scanning** | ✅ | ❌ | ❌ | |
| 39 | +| **Offline First** | ✅ | ✅ | ❌ (Often requires API) | |
| 40 | +| **Custom Rules** | ✅ (YAML) | ✅ (TOML) | ✅ (Detectors) | |
| 41 | +| **Backend Integration** | ✅ (Pydantic Models) | ❌ | ❌ | |
| 42 | +| **Configuration Check** | ✅ (.env, Docker) | ❌ | ❌ | |
| 43 | + |
| 44 | +### Security Philosophy |
| 45 | +1. **Offline First**: No data leaves your machine. Your code is yours. |
| 46 | +2. **Confidence > Noise**: We use entropy checks and specific regexes to minimize false positives. |
| 47 | +3. **Actionable**: Every finding comes with a remediation step. |
| 48 | + |
| 49 | +## Installation |
| 50 | +```bash |
| 51 | +pip install -r requirements.txt |
| 52 | +``` |
| 53 | + |
| 54 | +## Usage |
| 55 | +```bash |
| 56 | +# Basic Scan |
| 57 | +python -m openaudit.main . |
| 58 | + |
| 59 | +# With specific rules |
| 60 | +python -m openaudit.main . --rules-path ./my-rules |
| 61 | + |
| 62 | +# JSON Output |
| 63 | +python -m openaudit.main . --format json --output report.json |
| 64 | +``` |
| 65 | + |
| 66 | +**Ignoring Files:** |
| 67 | +Create a `.oaignore` or `.openauditignore` file in your root directory to exclude files/folders from the scan (uses .gitignore syntax). |
| 68 | + |
| 69 | +Example `.oaignore`: |
| 70 | +```text |
| 71 | +node_modules/ |
| 72 | +dist/ |
| 73 | +tests/ |
| 74 | +*.log |
| 75 | +``` |
| 76 | + |
| 77 | +## 🚀 CI/CD Integration |
| 78 | + |
| 79 | +OpenAuditKit is designed to run in CI/CD pipelines. Use the `--ci` flag to enable CI mode (exit code 1 on failure, no interactive elements). |
| 80 | + |
| 81 | +### GitHub Actions Example |
| 82 | + |
| 83 | +Create `.github/workflows/audit.yml`: |
| 84 | + |
| 85 | +```yaml |
| 86 | +name: Security Audit |
| 87 | +on: [push, pull_request] |
| 88 | + |
| 89 | +jobs: |
| 90 | + openaudit: |
| 91 | + runs-on: ubuntu-latest |
| 92 | + steps: |
| 93 | + - uses: actions/checkout@v3 |
| 94 | + - uses: actions/setup-python@v4 |
| 95 | + with: |
| 96 | + python-version: '3.10' |
| 97 | + - run: pip install openaudit |
| 98 | + - run: openaudit . --ci --fail-on high |
| 99 | +``` |
| 100 | + |
| 101 | +### Exit Codes |
| 102 | +- `0`: No issues found (or issues below threshold). |
| 103 | +- `1`: Issues found matching or exceeding severity threshold. |
| 104 | + |
| 105 | +## 🛠 Development & Testing |
| 106 | + |
| 107 | +Run the test suite with coverage: |
| 108 | +```bash |
| 109 | +python -m pytest tests --cov=openaudit |
| 110 | +``` |
| 111 | + |
| 112 | +We enforce a 90% test coverage threshold. |
0 commit comments