Release ContractGuard 2.0 #8
Conversation
|
| GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
|---|---|---|---|---|---|
| - | - | Generic Password | 1c6b392 | tests/test_secrets_analyzer.py | View secret |
| 29427053 | Triggered | Generic Password | 1c6b392 | tests/test_config_analyzer.py | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secrets safely. Learn here the best practices.
- Revoke and rotate these secrets.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
There was a problem hiding this comment.
Pull request overview
This PR is a 2.0.0 release update that adds confidence-aware finding filtering, improves analyzer robustness (per-analyzer runtime isolation), expands dependency scanning coverage, and aligns version metadata across the Python package, VS Code extension, and SARIF output.
Changes:
- Introduces
--min-confidenceplumbing end-to-end (VS Code → bridge/CLI → scan filtering) and assigns low confidence to fixtures/docs/samples. - Improves analyzer fidelity and noise reduction (new file filters, large-file skipping, refined secret/PII heuristics, broader dependency file support).
- Updates versioning to 2.0.0 and makes SARIF report use the package version.
Reviewed changes
Copilot reviewed 24 out of 25 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| vscode-src/pythonBridge.ts | Adds minimumConfidence config and forwards --min-confidence to the Python bridge. |
| tests/test_secrets_analyzer.py | Adds regression tests for new secrets heuristics and confidence behavior. |
| tests/test_scan.py | Adds tests for min-confidence filtering defaults and runtime-error reporting. |
| tests/test_reporter.py | Verifies SARIF tool version is derived from package __version__. |
| tests/test_pii_analyzer.py | Adds regression tests for reduced PII false positives + low-confidence email behavior. |
| tests/test_dependency_analyzer.py | Adds tests for pyproject/npm lock parsing and CVE ID hygiene. |
| tests/test_config_analyzer.py | Adds tests for compose default password and SMTP STARTTLS behavior. |
| src/contractguard/scan.py | Implements min-confidence filtering and converts analyzer runtime failures into findings; adds generated_at. |
| src/contractguard/reporter.py | Uses contractguard.__version__ in SARIF driver metadata. |
| src/contractguard/cli.py | Adds --min-confidence to CLI commands and forwards to scanning. |
| src/contractguard/bridge.py | Adds --min-confidence to bridge endpoints and forwards into ScanTarget. |
| src/contractguard/analyzers/secrets_analyzer.py | Adds confidence assignment, fixture/docs heuristics, large-file skipping, and new SMTP app password pattern. |
| src/contractguard/analyzers/pii_analyzer.py | Adds context-based acceptance rules, Luhn validation, confidence assignment, and broader skip logic. |
| src/contractguard/analyzers/json_analyzer.py | Skips common dependency/config JSONs and respects should_skip_path. |
| src/contractguard/analyzers/file_filters.py | Expands skip dirs, adds fixture/source/doc detection helpers, inline ignore markers, and confidence ordering. |
| src/contractguard/analyzers/dependency_analyzer.py | Adds pyproject.toml + npm dependency parsing, expands DB, and adds fixture confidence lowering. |
| src/contractguard/analyzers/config_analyzer.py | Adds file skipping/size checks, fixture confidence lowering, and refines SSL-disabled detection. |
| src/contractguard/init.py | Bumps package version to 2.0.0. |
| README.md | Documents new default filtering and expanded dependency coverage. |
| pyproject.toml | Bumps Python package version to 2.0.0. |
| package.json | Bumps extension version to 2.0.0, adds minimumConfidence setting, updates packaging output name. |
| package-lock.json | Updates lockfile version metadata to 2.0.0 (but contains an inconsistent dependency entry). |
| INSTRUCTIONS.md | Documents --min-confidence usage examples. |
| DEPLOYMENT.md | Notes runtime model and new 2.0 behavior changes. |
| CAPABILITIES.md | Documents confidence filtering, runtime isolation, and dependency coverage additions. |
Comments suppressed due to low confidence (1)
src/contractguard/analyzers/pii_analyzer.py:293
- When facts["pii_details"] is non-empty, this filters rule-engine findings down to only PII004, which suppresses PII001/PII002/PII003 (including BLOCK-level SSN/credit-card rules). That changes scoring/CI semantics and may under-report severity. Consider keeping the BLOCK/critical rule findings (and only suppressing true duplicates) or upgrading the direct findings to emit equivalent severities (e.g., BLOCK for SSN/credit card).
if is_fixture_path(source):
finding.confidence = "low"
if facts["pii_details"]:
findings = [item for item in findings if item.rule_id == "PII004"]
all_findings.extend(findings)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -63,20 +171,23 @@ def extract_facts(content: str, filename: str = "") -> dict[str, Any]: | |||
| "has_medical_record": False, | |||
| "pii_field_names_count": 0, | |||
| "pii_items": [], # list of (type, line, preview) | |||
| if facts["vulnerabilities"]: | ||
| findings = [item for item in findings if item.rule_id == "DEP003"] |
| if not facts["secret_items"]: | ||
| all_findings.extend(findings) |
| except Exception: | ||
| continue | ||
| elif path.is_file(): | ||
| if should_skip_large_file(path) or path.name.casefold() in _SKIP_CONFIG_NAMES: |
No description provided.