← Back to Pull requests

[security] Resolve Bandit findings in CI and analysis tooling #8876

Closed
unknown closed this pull request without merging on Oct 09, 2026 19:28 UTC
View on GitHub
unknown unknown commented on Oct 08, 2026 21:36 UTC
Author

Motivation

  • Progress on https://github.com/ROCm/TheRock/issues/8272
  • This resolves 21 Bandit findings (18 low, 3 medium) in CI tooling.

    Technical Details

    | Plugin | Findings resolved | Change |
    | --- | ---: | --- |
    | B101: assert_used | 4 | Replace assertions with explicit checks for required inputs, GitHub CLI availability, and workflow-summary data. |
    | B105: hardcoded_password_string | 4 | Retain token_key and document suppressions: these strings select entries in the tokens dictionary and are not literal credentials. |
    | B110: try_except_pass | 8 | Narrow exception handling, report filesystem failures, and remove the unnecessary catch around os.cpu_count(), retaining its Unknown fallback. |
    | B113: request_without_timeout | 1 | Add an explicit timeout to the bump-automation HTTP request. |
    | B310: urllib_urlopen | 2 | Validate GitHub API URLs before sending credentials and document the fixed HTTPS ccache download endpoint with targeted suppressions. |
    | B311: random | 2 | Use SystemRandom for weighted GPU-family selection and UUIDs for resource-log filenames. |

    Test Plan

    CI builds and tests should still work, unit tests should still pass.

    Submission Checklist

  • Look over the contributing guidelines at https://github.com/ROCm/TheRock/blob/main/CONTRIBUTING.md.
  • Diff: 232 lines (+174 / -58) across 2 files Reviewer: geomin12 Review duration: 1312m
    All Vouch review confidence checks passed
    Residual risk 0.24 = Change Risk (0.60) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.60 · 232 lines diff across 2 files
    0.60
    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.326
    Shallow Review Depth shallow_review_depth
    0.289
    Sensitive Paths sensitive_paths
    0.060
    Real PR Conversation Timeline
    1 comments
    "Review active on #8876"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed sensitive_module
    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: 60.2% (MEDIUM) · Higher = larger blast radius
    60.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: 23.8% · Safe to merge
    23.8%
    Repository