Skip to main content

mongo-x-ray-risk

CI PyPI

Known-risks knowledge base for x-ray: a ChromaDB-backed vector search that matches analysis findings against known MongoDB risks.

This is an optional plugin: it ships the ingest command to load the risk register, the search command to look risks up by name, and the analysis plugins (healthcheck, log, gmd) detect it at runtime — when it is installed, their reports are enriched with matched risks; when it is missing, the enrichment is silently skipped.

Install

pip install mongo-x-ray mongo-x-ray-risk

Usage

Load a risk register CSV into the ChromaDB knowledge base:

x-ray ingest risk_register.csv
# start from an empty register, then ingest
x-ray ingest --clear risk_register.csv
# clear the register without ingesting (no CSV needed)
x-ray ingest --clear

Check whether a risk is already known by searching the Name column (case-insensitive substring match). Prints the Name and Risk description of every matching risk; exits 0 when something matches, 1 when nothing does:

x-ray search "Replication Lag"
x-ray search replication

The CSV must have the columns ID, Risk level, Impact, Name, Risk description (UTF-8, a BOM is tolerated; header names are matched case-insensitively). Any other columns, such as Other Notes, are ignored. Rows without an ID or a Name are skipped; entries with an existing ID are replaced. The data is stored under ~/.x-ray/chroma.

Once ingested, the plugin is used automatically by the other plugins — no CLI flags needed. It also exposes a small API for tooling:

from mongo_x_ray_risk import Risk, load_risks_from_csv, ingest_risks, match_risk, enrich_test_results

Security notes

Dependabot reports open advisories against the pinned chromadb version (2 critical, 2 high as of 1.5.9). They all affect the Chroma HTTP server API only:

  • CVE-2026-45829 / CVE-2026-45833 — code injection: an attacker posts a malicious model repository with trust_remote_code set to true to the /api/v2/.../collections endpoints of a running Chroma server.
  • CVE-2026-45830 / CVE-2026-45831 — a Chroma server lets authenticated users read, write or delete data across tenants, databases and collections.

This plugin never runs or connects to a Chroma server. It uses ChromaDB's in-process embedded client on a local path:

chromadb.PersistentClient(path=~/.x-ray/chroma, settings=Settings(anonymized_telemetry=False))

It embeds with the default local embedding function (no remote model is downloaded) and accepts no remote Chroma endpoint, so neither the server API nor its authentication layer is reachable. The advisories were therefore dismissed on GitHub as "vulnerable code is not actually used". chromadb==1.5.9 is also the newest release and no advisory lists a patched version yet, so this cannot be fixed by upgrading; the pin is revisited when a patched release appears.

Development

Requires Python 3.10+, MongoDB 5.0 or later, and the mongo-x-ray core package.

make unit-test   # run the unit tests
make lint        # ruff check + ruff format --check

Metadata

Release files for mongo-x-ray-risk 2.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mongo-x-ray-risk 2.1.0
File Size Uploaded Provenance Actions
mongo_x_ray_risk-2.1.0.tar.gz 14.6 kB With provenance Details for mongo_x_ray_risk-2.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mongo-x-ray-risk 2.1.0
File Interpreter ABI Platform Actions
mongo_x_ray_risk-2.1.0-py3-none-any.whl Python 3 none any Details for mongo_x_ray_risk-2.1.0-py3-none-any.whl

Total release size: 26.0 kB

Release files / mongo_x_ray_risk-2.1.0.tar.gz

Download URL mongo_x_ray_risk-2.1.0.tar.gz
Size 14.6 kB
Tags Source
SHA-256 checksum
How to use checksums
fe3e9ba6e89911cfd1648e11302706b5acd399aa40a2f9f6778fe210a95164fa
BLAKE2b-256 checksum
How to use checksums
f341acfe599c59015af1b4b3ce92e9717353604583f6989107f080e4263dc623
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 10, 2026.

Transparency log

Release files / mongo_x_ray_risk-2.1.0-py3-none-any.whl

Download URL mongo_x_ray_risk-2.1.0-py3-none-any.whl
Size 11.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
550ddf009da5d7c98e88653bc832cbd02f9cd99e919336e20d5dfb992876996a
BLAKE2b-256 checksum
How to use checksums
ce1874c714c2358c3db435683d0a06d5fd5302c6b3676c9c9cd71136e64f9558
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 10, 2026.

Transparency log

Security for mongo-x-ray-risk 2.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for mongo_x_ray_risk-2.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 10, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page