RepoGuard is a lightweight, dependency-free security hygiene scanner for local source repositories. It is designed for maintainers who want a fast pre-commit or CI check for common high-signal mistakes before code is published.
- Private key material accidentally committed to text files
- Common GitHub token formats
- AWS access-key identifiers
- Risky GitHub Actions settings such as
permissions: write-all pull_request_targetworkflows that deserve manual review- Python
subprocessusage withshell=True - Obvious hard-coded password assignments
RepoGuard is intentionally conservative. It is not a replacement for dedicated secret scanners, SAST products, dependency analysis, or code review.
python -m pip install -e .Scan the current repository:
repoguard .JSON output:
repoguard . --format jsonSARIF 2.1.0 output for code-scanning integrations:
repoguard . --format sarif > repoguard.sarifFail when a high-severity finding is present:
repoguard . --fail-on highFormats and exit policy can be combined:
repoguard . --format sarif --fail-on high > repoguard.sarifYou can also run it without installation:
python -m repoguard.cli .HIGH RG001 config/dev.pem:1 Private key material detected
MEDIUM RG101 .github/workflows/release.yml:8 Workflow grants write-all permissions
2 finding(s): 1 high, 1 medium
RepoGuard can be used locally, as a pre-commit-style check, or inside CI. JSON is convenient for custom automation, while SARIF provides a standard interchange format understood by many code-scanning systems. RepoGuard itself does not upload findings anywhere.
The project favors transparent, auditable checks with no network access. Scans remain on the local machine unless a user explicitly runs RepoGuard in their own CI environment.
python -m pip install -e .
python -m unittest discover -s tests -v
repoguard . --fail-on highBug fixes, new high-signal rules, false-positive reductions, tests, documentation, and output-format improvements are welcome. See CONTRIBUTING.md.
Please report vulnerabilities privately as described in SECURITY.md.
MIT License.