← Back to Pull requests

chore(security): add scripts and agent skills to triage image vulnerabilities #2412

Closed
unknown closed this pull request without merging on Nov 16, 2026 11:09 UTC
View on GitHub
unknown unknown commented on Nov 16, 2026 06:26 UTC
Author

Summary

Part of #2380. Triaging the critical and high findings of the image scan and keeping .openvex.json current is manual and undocumented today. #2388 did it for every image by hand. This pull request turns that work into scripts and two agent skills.

Scripts in scripts/openvex/

  • scan.sh scans images like the weekly image scan, without and with .openvex.json. For each image it prints the critical and high counts, and the ID and the PURL of each critical or high finding that the document does not cover. It takes the severity from the CVSS score, as the Security tab does.

  • trace.sh runs a Python program in its image and lists the Python distributions and the OS packages (dpkg or apk) that its processes load. A sitecustomize hook records the modules and shared libraries of each process.

  • statements.py:

  • - add merges a list of findings and reasons into the document, with one statement for each vulnerability and justification, and one product for each image.
    - prune removes the packages that the scanned images no longer have. SECURITY.md asks for this, but nobody does it by hand.
    - Both format the document like #2388 and set its version to one more than on origin/main.

    Skills in skills/openvex/

    They follow the layout of the MongoDB migration skills:

  • triage-image-vulnerabilities: find the findings that the document does not cover, read each advisory, collect the evidence for each kind of package, decide, add the statements, and rescan. It stops and asks the maintainer when the vulnerable code runs and an attacker can reach it.

  • prune-openvex-statements: scan the published images and remove the stale statements.
  • Other changes

  • .versions.yaml pins Grype (v0.118.0, the version the scans use now), and the security-scan action passes it to anchore/scan-action. So the scripts and CI report the same findings, and Renovate updates both.

  • SECURITY.md lists the tools. Its Grype example filtered on the severity label of Grype, which can be lower than the CVSS severity in the Security tab, so it now uses scan.sh.
  • Testing

  • statements.py format on the .openvex.json of #2388 gives the same file, byte for byte.

  • statements.py add: rows for new and existing vulnerabilities and images, the same rows twice (no change), and an unknown justification (rejected).

  • statements.py prune on a scan of gpu-reset removes the packages that the scan does not report and keeps the others, and on a real scan of file-server-cleanup removes nothing.

  • The version goes from 1 on main to 2, and stays 2 on a second run.

  • scan.sh on file-server-cleanup:main-6e388be reports 2 critical findings with the PURLs, as the CI scan does, and 0 with the document of #2388.

  • trace.sh on file-server-cleanup:main-6e388be lists click, prometheus_client and the Alpine packages that the process loads.
  • Tests pass locally

  • Manual testing completed

  • No breaking changes (or documented)
  • Type of Change


  • 🐛 Bug fix

  • ✨ New feature

  • 💥 Breaking change

  • 📚 Documentation

  • 🔧 Refactoring

  • 🔨 Build/CI
  • Component(s) Affected


  • Health Monitor

  • Core Service

  • Fault Management

  • Janitor

  • Deployment/Config

  • API/Interface

  • Preflight

  • Plugins

  • Documentation/CI

  • New Component

  • Multiple Components

  • Other
  • Checklist


  • Self-review completed

  • Documentation updated (if needed)

  • Ready for review
  • <!-- This is an auto-generated comment: release notes by coderabbit.ai -->
    <!-- coderabbit-ai-generated:v1 -->

    Summary by CodeRabbit

    New Features
    Added tools to scan container images with and without OpenVEX statements, report uncovered critical and high findings, and save results in JSON and SARIF formats.
    Added tools to trace Python runtime usage and identify packages associated with loaded files.
    Added commands to create, format, and prune OpenVEX statements using scan results.
    Documentation
    Expanded guidance for image scanning, reviewing findings, managing statements, and interpreting CVSS severity scores.
    * Added workflows for pruning OpenVEX statements and triaging image vulnerabilities.
    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 538 lines (+403 / -135) across 6 files Reviewer: KaivalyaMDabhadkar Review duration: 282m
    All Vouch review confidence checks passed
    Residual risk 0.28 = Change Risk (0.71) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.71 · 538 lines diff across 6 files
    0.71
    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.376
    Shallow Review Depth shallow_review_depth
    0.289
    Sensitive Paths sensitive_paths
    0.071
    Real PR Conversation Timeline
    1 comments
    "Review active on #2412"
    general weight: 0.35
    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: 71.1% (HIGH) · Higher = larger blast radius
    71.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: 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: 28.1% · Safe to merge
    28.1%