Skip to main content

Diffused Library

The core Python library providing vulnerability scanning and diffing functionality for container images and SBOMs (Software Bill of Materials). This library enables programmatic access to vulnerability analysis capabilities.

Features

  • 🔍 Vulnerability Scanning: Automated scanning of SBOMs using Trivy or scanning of container images and SBOMs using RHACS
  • 🔀 Fixed & New Vulnerability Detection: Reports both vulnerabilities fixed and vulnerabilities newly introduced between two versions
  • 📊 SBOM Diffing: Direct comparison of SPDX-JSON formatted SBOMs (Trivy or RHACS)
  • 📄 Flexible Output: Programmatic access to vulnerability data
  • 🐍 Python API: Clean, intuitive Python interface

Note: RHACS SBOM scanning is backed by the roxctl sbom scan DEV PREVIEW feature. It currently matches only purl-identified packages (e.g. PyPI) and does not yet report RPM/OS package vulnerabilities; use image scanning for full coverage.

Installation

Prerequisites

  1. Install the scanner:
    1. Trivy: Follow the official Trivy installation guide
    2. RHACS: Follow the official roxctl installation guide
  2. Python Environment: Ensure Python 3.9+ is installed

From Source

cd diffused
pip install -e .

From PyPI

pip install diffused-lib

Usage

Basic Library Usage

Comparing Container Images

from diffused.differ import VulnerabilityDiffer

# Create a differ instance for container images
vuln_differ = VulnerabilityDiffer(
    previous_image="ubuntu:20.04",
    next_image="ubuntu:22.04",
    scan_type="image"  # Automatically scans images
)

# Retrieve the vulnerabilities diff (list of fixed CVEs)
fixed_vulnerabilities = vuln_differ.vulnerabilities_diff
print(f"Fixed vulnerabilities: {fixed_vulnerabilities}")

# Get detailed information about each fixed vulnerability
detailed_info = vuln_differ.vulnerabilities_diff_all_info

# Retrieve the vulnerabilities introduced in the next image (list of new CVEs)
new_vulnerabilities = vuln_differ.new_vulnerabilities
print(f"New vulnerabilities: {new_vulnerabilities}")

# Get detailed information about each new vulnerability
new_detailed_info = vuln_differ.new_vulnerabilities_all_info

Comparing SBOMs

from diffused.differ import VulnerabilityDiffer

# Create a differ instance for SBOMs
vuln_differ = VulnerabilityDiffer(
    previous_sbom="previous.sbom.json",
    next_sbom="current.sbom.json",
    scan_type="sbom"  # Automatically scans SBOMs
)

# Retrieve the vulnerabilities diff
fixed_vulnerabilities = vuln_differ.vulnerabilities_diff

Using Different Scanners

from diffused.differ import VulnerabilityDiffer

# Use Trivy scanner (default)
trivy_differ = VulnerabilityDiffer(
    previous_image="nginx:1.20",
    next_image="nginx:1.21",
    scanner="trivy",
    scan_type="image"
)

# Use ACS scanner (requires ROX_ENDPOINT and either ROX_API_TOKEN or ROX_CONFIG_DIR)
acs_differ = VulnerabilityDiffer(
    previous_image="nginx:1.20",
    next_image="nginx:1.21",
    scanner="acs",
    scan_type="image"
)

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

diffused_lib-0.5.0.tar.gz (19.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

diffused_lib-0.5.0-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

Details for the file diffused_lib-0.5.0.tar.gz.

File metadata

  • Download URL: diffused_lib-0.5.0.tar.gz
  • Upload date:
  • Size: 19.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for diffused_lib-0.5.0.tar.gz
Algorithm Hash digest
SHA256 678d79b7a799977f8ba6eaae681637ed50b5da24b30779ac1423ec6ca7dafee6
MD5 239595d290f89801be3c54990e3db4a0
BLAKE2b-256 ad1d09199541975d433752454cedea68d871c8b5e68f39f5f9d4ee36a9e55d3a

See more details on using hashes here.

Provenance

The following attestation bundles were made for diffused_lib-0.5.0.tar.gz:

Publisher: release.yml on konflux-ci/diffused

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file diffused_lib-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: diffused_lib-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 11.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for diffused_lib-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1c01e65551532c08eee69a45a4f864d191db152cb327a623b73b341095d8697b
MD5 345aab6bae5f7388409768252e04a496
BLAKE2b-256 beed8ebaac25a2cc7cc65e860f163c26d0fd385d67dfffd0b84046a8c31822f7

See more details on using hashes here.

Provenance

The following attestation bundles were made for diffused_lib-0.5.0-py3-none-any.whl:

Publisher: release.yml on konflux-ci/diffused

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 files

0.4.0

2 files

0.3.0

2 files

0.2.0

2 files

0.1.0

2 files

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