← Back to Pull requests

maintenance: extend SFTP connection options #4293

Closed
unknown closed this pull request without merging on Aug 26, 2026 16:42 UTC
View on GitHub
unknown unknown commented on Jul 30, 2026 10:26 UTC
Author

Summary

  • Pin SFTP server identity to one or more configured SHA-256 host-key fingerprints.

  • Accept a current and next fingerprint together so operators can rotate host keys without an outage.

  • Use one protocol validation contract for monitor validation and collector pre-check.

  • Reevaluate advanced form dependencies when the SFTP boolean changes, including persisted string values.

  • Bound repeated warnings for the explicit unsafe opt-out and document trusted fingerprint acquisition, upgrade, and rotation in English and Chinese.
  • Upgrade behavior

    This is an intentional fail-closed change for 1.9.0. Existing SFTP monitors are not automatically migrated to skip verification. Before or immediately after upgrading, operators must either:

    1. obtain and verify the server fingerprint through a trusted channel, then configure one or more SHA256:... values; or
    2. explicitly select the dangerous skip-verification option as a short-lived recovery measure.

    Until one of those policies is configured, the affected SFTP monitor reports a configuration error and does not connect. Plain FTP monitors are unchanged.

    ssh-keyscan is documented only as a way to retrieve a key, not as proof of identity. Operators must compare the resulting fingerprint through a trusted channel.

    Regression proof

  • A malformed skip-verification value previously passed collector pre-check when a valid fingerprint was present; it is now rejected by the shared protocol contract.

  • Boolean changes previously did not reevaluate dependent advanced fields, so the fingerprint field could remain hidden; the monitor form now updates visibility and clears hidden values correctly.

  • Persisted "false" strings are normalized as disabled rather than treated as truthy.

  • Protocol serialization does not expose validation helpers as accidental JSON properties.
  • Validation

  • FtpProtocolTest: 10 passed.

  • FtpCollectImplTest: 8 passed.

  • Focused Angular monitor-form tests: 5 passed.

  • Scoped frontend ESLint: passed with zero warnings.

  • ./mvnw -pl hertzbeat-startup -am -DskipTests package: all 24 reactor modules passed.

  • Angular production build: passed (with the repository's existing initial-bundle budget warning).

  • Checkstyle and git diff --check: passed.
  • AI assistance: used for draft implementation and test iteration.
    Human validation: failing-first protocol and UI contracts, focused backend/frontend tests, Checkstyle, ESLint, source package proof, and production frontend build all passed.
    Risk notes: existing SFTP monitors without an explicit policy fail closed after upgrade; the upgrade guide documents the required operator action and temporary recovery option.

    Diff: 336 lines (+252 / -84) across 4 files Reviewer: Duansg Review duration: 39255m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.42) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.42 · 336 lines diff across 4 files
    0.42
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.348
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #4293"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 42.2% (MEDIUM) · Higher = larger blast radius
    42.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 16.7% · Safe to merge
    16.7%