← Back to Pull requests

fix: FIPS-compatible workaround for paramiko MD5 fingerprint issue #6430

Closed
unknown closed this pull request without merging on Oct 05, 2026 17:00 UTC
View on GitHub
unknown unknown commented on Oct 01, 2026 13:41 UTC
Author

##### What this PR does / why we need it:

On FIPS-enabled clusters, the ocp-virt-validation-checkup-rhel9 image uses RHEL 9.8 as base with the system Python interpreter. The system Python links hashlib against RHEL's system OpenSSL, which enforces FIPS mode when the cluster has FIPS enabled (/proc/sys/crypto/fips_enabled = 1).

In FIPS mode, hashlib.md5() without usedforsecurity=False raises UnsupportedDigestmodError, causing all SSH connectivity checks into VMs to fail:

Function: rrmngmnt.host.run_command  Kwargs: {'command': ['exit'], 'tcp_timeout': 60}
Last exception: UnsupportedDigestmodError: [digital envelope routines] unsupported.

Root cause: paramiko.pkey.md5 (imported from hashlib) is called by:

  • PKey.get_fingerprint() — used for display/logging of host key fingerprints in all host key policies (AutoAddPolicy, RejectPolicy, WarningPolicy) and during SSH client auth

  • PKey._read_private_key_pem() — used for password-protected PEM key decryption
  • CI (Jenkins) uses the openshift-virtualization-tests:latest image (Fedora 41 + uv standalone Python) which bundles its own OpenSSL that does not inherit the host FIPS policy — hence no failure there.

    Upstream status: Known paramiko bug (issue #396, open since 2014). Multiple PRs submitted (#1928, #2189, #2496, #2624) — none merged. No fix in paramiko 5.0.0.

    Fix: Patch paramiko.pkey.md5 at import time via vars() to use usedforsecurity=False. This tells OpenSSL FIPS that the MD5 usage is not for security purposes (fingerprint display/logging only).

    Validated on a FIPS-enabled cluster: test_clone_from_block_to_fs_using_dv_template fails without the patch and passes with it on the ocp-virt-validation-checkup-rhel9 image.

    ##### Which issue(s) this PR fixes:

    CNV-98463

    ##### Special notes for reviewer:

    vars(paramiko.pkey).update(...) is used instead of direct attribute assignment to avoid mypy attr-defined/method-assign errors on third-party module patching, without requiring # type: ignore (prohibited by AGENTS.md) or a broad ignore_errors mypy override.

    ##### jira-ticket:

    CNV-98463

    🤖 Generated with Claude Code

    <!-- This is an auto-generated comment: release notes by coderabbit.ai -->

    Summary by CodeRabbit

    Chores
    Improved compatibility for automated test runs in FIPS-enabled environments. Application behavior and user-facing functionality are unchanged; this update affects test setup only and does not alter security protections. No new end-user features or other behavior changes are included.
    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 367 lines (+275 / -92) across 4 files Reviewer: geetikakay Review duration: 5959m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.43) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.43 · 367 lines diff across 4 files
    0.43
    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.353
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #6430"
    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.7% (MEDIUM) · Higher = larger blast radius
    42.7%
    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.9% · Safe to merge
    16.9%