Thanks for your interest in contributing! GreenGate is a Rust CLI tool — contributions of all kinds are welcome: bug reports, new secret-detection patterns, SAST rules, documentation improvements, and new features.
- Rust 1.85+ (
rustup update stable) - Git
git clone https://github.com/thinkgrid-labs/greengate
cd greengate
cargo buildcargo testAll tests must pass before submitting a pull request.
Open an issue at github.com/ThinkGrid-Labs/greengate/issues and include:
- greengate version (
greengate --version) - OS and architecture
- The command you ran and the full output
- What you expected to happen
GreenGate's built-in patterns live in src/scanner.rs. Each pattern is a named regex. To propose a new one:
- Add the pattern to the
patterns()function with a descriptive name (e.g."Twilio Auth Token") - Add a test in
tests/that exercises the new pattern with both a true-positive and a true-negative fixture - Open a PR describing the secret type, the regex, and any false-positive risk
SAST rules are tree-sitter S-expression queries in src/sast.rs. To add a rule:
- Write and test the query using the tree-sitter playground
- Add it to the
rules()function with aSAST/<RuleId>identifier - Add a fixture file and test case in
tests/
- Fork the repository and create a branch from
main - Make your changes with clear, focused commits
- Ensure
cargo testandcargo clippy -- -D warningsboth pass - Open a pull request against
mainwith a clear description of what changed and why
- Run
cargo fmtbefore committing - Run
cargo clippy -- -D warningsand fix all warnings - Keep unsafe code to zero (the codebase has none)
- Prefer
anyhow::Resultfor error propagation at the top level
src/
main.rs — CLI entry point (clap)
scanner.rs — Secret/PII regex scanner
sast.rs — AST-based SAST engine (tree-sitter)
linter.rs — Kubernetes manifest linter
coverage.rs — LCOV/Cobertura coverage gate
auditor.rs — OSV dependency auditor
lighthouse.rs — PageSpeed Insights gate
reassure.rs — Reassure performance gate
tests/ — Integration tests
By contributing, you agree that your contributions will be licensed under the MIT License.