Skip to content

Release ContractGuard 2.0 #8

Closed
CodeforGood1 wants to merge 1 commit into
CodeforGood1:mainfrom
Blackplane-Systems:main
Closed

Release ContractGuard 2.0 #8
CodeforGood1 wants to merge 1 commit into
CodeforGood1:mainfrom
Blackplane-Systems:main

Conversation

@CodeforGood1
Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings May 13, 2026 20:34
@gitguardian
Copy link
Copy Markdown

gitguardian Bot commented May 13, 2026

⚠️ GitGuardian has uncovered 2 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

Since your pull request originates from a forked repository, GitGuardian is not able to associate the secrets uncovered with secret incidents on your GitGuardian dashboard.
Skipping this check run and merging your pull request will create secret incidents on your GitGuardian dashboard.

🔎 Detected hardcoded secrets in your pull request
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
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. 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


🦉 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.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-confidence plumbing 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)
Comment on lines +291 to +292
if facts["vulnerabilities"]:
findings = [item for item in findings if item.rule_id == "DEP003"]
Comment on lines +314 to +315
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:
@CodeforGood1 CodeforGood1 marked this pull request as draft May 13, 2026 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants