← Back to Pull requests

security-baseline: check all HTTP URLs in osps-br-03-02 #453

Closed
unknown closed this pull request without merging on Oct 12, 2026 21:50 UTC
View on GitHub
unknown unknown commented on Oct 11, 2026 04:58 UTC
Author

Summary

Fix osps-br-03-02 so that it checks every non-HTTPS URL found in README.md, rather than only inspecting the first regex match.

The previous implementation used regex.find_all_string_submatch_n(...)[0]. The [0] selects the submatch array for the first match, so subsequent http:// URLs were ignored. Because the pattern captured the entire match, the first URL was also evaluated twice.

This change uses regex.find_n(..., -1), which returns all matching URLs directly.

Regression test

Added Starlark tests covering:

  • an HTTPS-only README, which passes;

  • a localhost HTTP URL, which remains permitted;

  • a localhost HTTP URL followed by an external HTTP URL, which must fail.
  • The last case reproduces the bug: before the fix, only the first localhost match is inspected and the rule passes; after the fix, the later external HTTP URL is detected.

    Testing

    mindev test security-baseline/rule-types/common/osps-br.star
    mindev test security-baseline/rule-types/common --coverage
    mindev test security-baseline/rule-types --coverage
    python3 scripts/migrate-rego-v1.py --check .
    git diff --check
    

    Addresses the osps-br-03-02 logic item in #451.

    Diff: 148 lines (+111 / -37) across 1 files Reviewer: dakshhhhh16 Review duration: 2452m
    All Vouch review confidence checks passed
    Residual risk 0.26 = Change Risk (0.56) × (1 − Review Confidence (0.54)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.56 · 148 lines diff across 1 files
    0.56
    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%
    54%
    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.299
    Shallow Review Depth shallow_review_depth
    0.289
    Sensitive Paths sensitive_paths
    0.056
    Real PR Conversation Timeline
    1 comments
    "Review active on #453"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 54.2% 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: 56.1% (MEDIUM) · Higher = larger blast radius
    56.1%
    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: 54.2% · Lower = rushed or shallow review
    54.2%
    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: 25.7% · Safe to merge
    25.7%