feat: implement missing features per gap analysis - #69
Merged
Conversation
pixincreate
force-pushed
the
feat/missing-features
branch
from
July 29, 2026 18:09
a49af08 to
95aab1a
Compare
- Improve OpenAI API key regex (word boundaries, 48+ chars) - Add OpenCode API key detector (context-based sk- prefix) - Add 63+ new prefix-based detectors covering: - AI services (Anthropic, Cohere, HuggingFace, Mistral, Groq, Replicate, LangSmith) - Cloud/Infra (Vercel, Netlify, Supabase, Convex) - Monitoring (Datadog, New Relic, PagerDuty, Sentry, Elastic) - DevOps (GitLab PATs, Buildkite, TravisCI, Ngrok) - Messaging (Confluent) - Productivity (Airtable, HashiCorp Vault, Terraform) - Remove redundant context-based 32-hex detectors (covered by GenericKeyValueDetector) - Strip verbose descriptions from detectors.toml - Fix justfile trailing newline Refs: #57
- Add Critical variant to Severity enum - Update from_string() to parse CRITICAL - Update get_severity_counts() to return 4-tuple (critical, high, medium, low) - Update calculate_exit_code() to treat Critical like High in critical mode - Update severity display output to include CRITICAL count - Update tests for new 4-tuple format Fixes part of #68
- Add baseline module (src/baseline.rs) with JSON serialization - Add --baseline <path> flag to suppress known findings - Add --update-baseline flag to write baseline from current scan - Baseline matching uses file_path + line_number + finding_type + plugin_name - Integration tests for filtering, save/load, and from_findings Refs #68
pixincreate
force-pushed
the
feat/missing-features
branch
from
July 29, 2026 18:13
95aab1a to
4a2bbdc
Compare
pixincreate
marked this pull request as ready for review
July 30, 2026 16:05
…ntegration test, graceful git-not-found
pixincreate
force-pushed
the
feat/missing-features
branch
from
July 30, 2026 16:32
30b8b56 to
beee475
Compare
* origin/master: chore(deps): bump toml from 1.1.3+spec-1.1.0 to 1.1.4+spec-1.1.0 (#70)
There was a problem hiding this comment.
Pull request overview
Implements multiple “gap analysis” scanning capabilities in KeyWatch, expanding both the detection configuration model and scan execution modes (stdin, git history, parallel file scanning), while adding suppression workflows (baseline + inline ignore) and new detector metadata (keywords/allowlist/entropy).
Changes:
- Added CRITICAL severity support end-to-end (parsing, reporting, exit code behavior, tests/docs).
- Implemented baseline suppression/update, inline suppression (
keywatch:ignore), and per-detector allowlist/keywords/entropy filtering. - Parallelized file scanning with
rayonand added stdin + git history scanning paths.
Reviewed changes
Copilot reviewed 16 out of 19 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| typos.toml | Adds project-specific typos ignore rules. |
| tests/scanner_tests.rs | Updates scan-args construction; adds new integration tests for inline suppression/stdin/git history. |
| tests/report_tests.rs | Updates severity counting expectations for CRITICAL. |
| tests/detector_tests.rs | Adds tests for allowlist, keyword prefilter, and entropy threshold behavior. |
| tests/baseline_tests.rs | Adds baseline filtering/load/save/update tests (hash-based storage). |
| src/utils.rs | Removes a doc comment. |
| src/scanner.rs | Adds inline suppression, allowlist/keywords/entropy checks, chunked stream scanning, git history/stdin scanning, and rayon-based parallel file scanning. |
| src/report.rs | Adds CRITICAL severity and expands severity counts tuple. |
| src/lib.rs | Applies baseline filtering/update workflow and updates CLI warning output and exit-code logic. |
| src/detector.rs | Extends detector model with allowlist/keywords/entropy and implements keyword/entropy helpers. |
| src/cli.rs | Adds --stdin, --git-history, --baseline, --update-baseline, and scan-args validation. |
| src/baseline.rs | Introduces hashed baseline format with merge/update and filtering. |
| README.md | Documents stdin scan, git history scan, baseline usage, inline suppression, and updated exit-mode semantics. |
| justfile | Minor formatting/line-number normalization. |
| detectors.toml | Adds keywords/entropy metadata, fixes some patterns, and adds many new detectors. |
| CHANGELOG.md | Documents new features/fixes and behavior changes. |
| Cargo.toml | Adds rayon and sha2 dependencies. |
| Cargo.lock | Locks new dependency graph (rayon/sha2 and transitive deps). |
| .gitignore | Ignores /.omo. |
pixincreate
force-pushed
the
feat/missing-features
branch
2 times, most recently
from
August 1, 2026 18:52
b6c143a to
eedadcb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of Change
Description
This PR implements missing features from the original gap analysis against gitleaks/detect-secrets. See #71 for the set of planned features.
New Features
Criticalvariant toSeverityenum (was silently downgraded toLOW)--baseline <path>suppresses known findings;--update-baselinemerges new findings into existing baselinekeywatch:ignorecomments suppress findings on that lineallowlistfield with regex patterns to suppress false positiveskeywordsfield for fast content filtering before regex executionentropy_thresholdfield to filter low-entropy matches on generic patternsrayon--stdinreads from stdin instead of files--git-historyrunsgit log -pand scans patch outputReview Fixes
matched_content_hashinstead of raw secrets (security)find_iter()instead offind()— catches all matches per detector(?s)flag for proper multiline matchingCode Quality
cargo clippy --all-targets --all-features)cargo +nightly fmt --alltests/integration testsContext
Closes #71.
How did you test it?
cargo test— all 78 tests passcargo clippy --all-targets --all-features— zero warningscargo +nightly fmt --all— cleanChecklist
cargo +nightly fmt --allcargo clippy