A vulnerability scan diffing library for container images and SBOMs
Project description
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 using RHACS
- 📊 SBOM Diffing: Direct comparison of SPDX-JSON formatted SBOMs (Trivy only)
- 📄 Flexible Output: Programmatic access to vulnerability data
- 🐍 Python API: Clean, intuitive Python interface
Installation
Prerequisites
- Install the scanner:
- Trivy: Follow the official Trivy installation guide
- RHACS: Follow the official roxctl installation guide
- 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
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 ROX_API_TOKEN environment variables)
acs_differ = VulnerabilityDiffer(
previous_image="nginx:1.20",
next_image="nginx:1.21",
scanner="acs",
scan_type="image"
)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file diffused_lib-0.3.0.tar.gz.
File metadata
- Download URL: diffused_lib-0.3.0.tar.gz
- Upload date:
- Size: 15.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
31dfbf644d4676c43af1f9deaf730c652059c19b656fec5df201fa8a99de451c
|
|
| MD5 |
f95b3f0ab71d833582a214668296d061
|
|
| BLAKE2b-256 |
c79ed3fc024efb6d4603db0fbb2e90a976cf5f54205784c554e3c7a9ce724731
|
Provenance
The following attestation bundles were made for diffused_lib-0.3.0.tar.gz:
Publisher:
release.yml on konflux-ci/diffused
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
diffused_lib-0.3.0.tar.gz -
Subject digest:
31dfbf644d4676c43af1f9deaf730c652059c19b656fec5df201fa8a99de451c - Sigstore transparency entry: 835636627
- Sigstore integration time:
-
Permalink:
konflux-ci/diffused@df3595adfbb3916d1f4b7aac13be07e765da18b6 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/konflux-ci
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@df3595adfbb3916d1f4b7aac13be07e765da18b6 -
Trigger Event:
push
-
Statement type:
File details
Details for the file diffused_lib-0.3.0-py3-none-any.whl.
File metadata
- Download URL: diffused_lib-0.3.0-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
930df735d31ac2464197e65a2fa42b479d0b2dbc6b235341869ca4b81116de08
|
|
| MD5 |
7a737ae8acec7a9ad0ed6da3cf0af4b2
|
|
| BLAKE2b-256 |
4830cd7eb9172e2e4254d4dce4a04086b710e2104a45dfdfb00757a696eab18a
|
Provenance
The following attestation bundles were made for diffused_lib-0.3.0-py3-none-any.whl:
Publisher:
release.yml on konflux-ci/diffused
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
diffused_lib-0.3.0-py3-none-any.whl -
Subject digest:
930df735d31ac2464197e65a2fa42b479d0b2dbc6b235341869ca4b81116de08 - Sigstore transparency entry: 835636628
- Sigstore integration time:
-
Permalink:
konflux-ci/diffused@df3595adfbb3916d1f4b7aac13be07e765da18b6 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/konflux-ci
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@df3595adfbb3916d1f4b7aac13be07e765da18b6 -
Trigger Event:
push
-
Statement type: