Thank you for your interest in contributing to Sieve! We welcome contributions, especially new secret detection patterns and improvements to the TUI.
Sieve is built with Rust (core logic) and wrapped in Node.js for easy distribution.
- Clone the repository:
git clone https://github.com/09Catho/Sieve.git cd Sieve - Build the project:
cargo build
- Run the tool locally:
# Scan the current directory cargo run -- check --full
src/scanner.rs: The core detection engine. Contains all Regex patterns (FMT_*) and scoring logic.src/fixer.rs: Handles the logic forsieve check --repair.src/ui.rs: The TUI implementation usingratatui.src/git.rs: Logic for parsinggit diffoutput.npm/: The Node.js wrapper that downloads the binary.
If Sieve is missing a detection rule (e.g., a specific API key format), follow these steps:
- Open
src/scanner.rs. - Add your Regex pattern to the
lazy_static!block using theFMT_prefix convention:static ref FMT_NEW_SERVICE: Regex = Regex::new(r"(?i)new_service_key_[a-zA-Z0-9]+").unwrap();
- Update the
scan_line()function to check your new pattern:if FMT_NEW_SERVICE.is_match(content) { score = 90; // High confidence rule_id = "NEW_SERVICE_KEY".to_string(); // ... set reasons and extracted_value }
- Add a Test: Scroll to the
mod testsmodule at the bottom ofsrc/scanner.rsand add a unit test to verify your pattern works and doesn't flag false positives.
Before submitting a Pull Request, ensure all tests pass:
cargo testIf you modified the TUI, manually verify it by running:
cargo run -- check --fullReleases are automated via GitHub Actions.
- Bump the version in
Cargo.tomlandnpm/package.json. - Push a new tag:
git tag v0.X.X && git push origin v0.X.X. - CI will build binaries and publish the release.