Skip to main content

Rhada

Rhada is a compliance, Software Bill of Materials (SBOM), binary linkage, and security vulnerability auditor for Python source workspaces and compiled Linux distributions (Nuitka and PyInstaller).

Overview

  1. Dual-Mode Operation

    • Source Mode (default when --dist is omitted): Inspects a uv workspace (pyproject.toml, uv.lock, and .venv/lib/.../site-packages/*.dist-info) to separate transitive runtime dependencies from development and build dependencies, extract SPDX licence metadata, and check for security advisories.
    • Compiled Distribution Mode (--dist <path>): Audits Nuitka and PyInstaller artefacts, including standalone directories (app.dist/, dist/app/) and monolithic single-file binaries (app.bin). Identifies bundled Python modules (excluding build and test tools such as pytest, ruff, mypy, nuitka, and pyinstaller), inspects bundled native shared libraries (.so), and verifies ELF dynamic linkage.
  2. Legal and Licence Compliance

    • Parses and normalises METADATA licence headers, PEP 639 License-Expression fields, Trove classifiers, and verbatim licence texts into canonical SPDX identifiers and compound expressions (MIT OR Apache-2.0, GPL-2.0-only AND BSD-3-Clause) using license-expression.
    • Categorises licence risk (permissive, public-domain, weak-copyleft, strong-copyleft, proprietary, unknown) and evaluates redistribution rules:
      • Flags strong copyleft (GPL-*, AGPL-*, SSPL-1.0) obligations (LIC-COP-STRONG, LIC-COP-NETWORK).
      • Detects LGPL relinking issues (LIC-LGPL-MONOLITHIC) when weak-copyleft libraries are statically compiled or embedded into monolithic binaries without dynamic .so relinking support.
    • Generates a THIRD_PARTY_NOTICES attribution file containing component inventory, copyright notices, NOTICE / AUTHORS files, and verbatim licence texts.
  3. ELF Binary and Native Library Inspection

    • Parses 32-bit and 64-bit ELF executables and .so libraries via pyelftools with a struct fallback for stripped or header-truncated binaries.
    • Extracts DT_NEEDED, DT_SONAME, DT_RPATH, DT_RUNPATH, PT_INTERP, exported symbols (PyInit_*, modulecode_*), and embedded library version strings (OpenSSL, zlib, SQLite, libffi, gmp, readline, etc.).
    • Verifies whether each DT_NEEDED shared library is resolved within the distribution, satisfied by the baseline Linux/glibc ABI, or missing as an unbundled external dependency, and flags insecure RPATH/RUNPATH tokens.
  4. Security Vulnerability Auditing

    • Integrates pip-audit (OsvService and ResolvedDependency) alongside the OSV.dev batch API (/v1/querybatch) and advisory endpoints (/v1/vulns/{id}) for discovered Python packages and versioned native libraries.
    • Calculates CVSS v3.0/v3.1 base scores using cvss and summarises findings by severity (CRITICAL, HIGH, MEDIUM, LOW) with fixed version recommendations.
  5. Standards-Compliant SBOMs and CLI Exit Codes

    • Generates CycloneDX 1.5 JSON (via cyclonedx-python-lib and packageurl-python) and SPDX 2.3 JSON SBOMs.
    • Provides a typed CLI built with typer and deterministic exit codes for CI/CD enforcement.

Installation

Manage and install with uv:

# Install dependencies and synchronise virtual environment
uv sync

# Run via uv
uv run rhada --help

CLI Usage

1. Audit a Python / uv Source Workspace

uv run rhada --project . \
  --sbom sbom.cdx.json \
  --notices THIRD_PARTY_NOTICES

2. Audit a Compiled Nuitka or PyInstaller Distribution

# Standalone directory (Nuitka .dist or PyInstaller folder)
uv run rhada --project . --dist ./build/app.dist \
  --sbom dist-sbom.json \
  --sbom-format cyclonedx \
  --notices dist/THIRD_PARTY_NOTICES \
  --fail-on-linkage

# Monolithic single-file binary (PyInstaller onefile or Nuitka onefile)
uv run rhada --project . --dist ./dist/app-linux-x86_64 \
  --sbom dist-sbom.spdx.json \
  --sbom-format spdx \
  --notices dist/THIRD_PARTY_NOTICES

3. Subcommands

# Generate SBOM to stdout or file
uv run rhada sbom --project . --format spdx --output sbom.spdx.json

# Generate THIRD_PARTY_NOTICES
uv run rhada notices --project . --dist ./build/app.dist --output THIRD_PARTY_NOTICES

# Inspect ELF binaries and DT_NEEDED linkage directly
uv run rhada inspect-elf ./build/app.dist

Exit Codes

Exit Code Enum Name Meaning
0 OK Audit passed all security, licence, and binary linkage policies.
1 VULNERABILITY_FAILURE One or more vulnerabilities met or exceeded --fail-on-severity (default: high).
2 LICENSE_FAILURE One or more licence compliance findings met or exceeded --fail-on-licence / --fail-on-license (default: high).
3 COMBINED_POLICY_FAILURE Both vulnerability and licence compliance thresholds were breached.
4 LINKAGE_FAILURE --fail-on-linkage was set and unbundled external DT_NEEDED libraries or insecure RPATHs were found.
5 USAGE_OR_IO_ERROR Invalid CLI arguments or unreadable target paths.

GitHub Actions CI Example

jobs:
  compliance-and-security-gate:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: astral-sh/setup-uv@v4
      - name: Run Rhada Audit and Generate Release Artefacts
        run: |
          uv run rhada audit \
            --project . \
            --dist ./dist/my-service.dist \
            --sbom ./dist/sbom.cdx.json \
            --notices ./dist/THIRD_PARTY_NOTICES \
            --report-json ./dist/rhada-report.json \
            --fail-on-severity high \
            --fail-on-licence high \
            --fail-on-linkage

Running Tests

uv run pytest -v

Metadata

Release files for rhada 0.0.1

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

Source distribution (sdist)

Source distribution for rhada 0.0.1
File Size Uploaded Provenance Actions
rhada-0.0.1.tar.gz 161.6 kB With provenance Details for rhada-0.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rhada 0.0.1
File Interpreter ABI Platform Actions
rhada-0.0.1-py3-none-any.whl Python 3 none any Details for rhada-0.0.1-py3-none-any.whl

Total release size: 242.7 kB

Release files / rhada-0.0.1.tar.gz

Download URL rhada-0.0.1.tar.gz
Size 161.6 kB
Tags Source
SHA-256 checksum
How to use checksums
1a7b958b72415d7a9e6300e38311f167395a1ad5b70e96671319642ccf0cd0c0
BLAKE2b-256 checksum
How to use checksums
470cb7b8f1d255f4231963e5723b542579ff668ebfa2ee1c1b618154c8f5a081
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Oct 25, 2026.

Transparency log

Release files / rhada-0.0.1-py3-none-any.whl

Download URL rhada-0.0.1-py3-none-any.whl
Size 81.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
601befe428c304dcb686b8218c424b8295598c69ca02a65fdcf847e0f5385d5b
BLAKE2b-256 checksum
How to use checksums
005f642544f908bfc0e782736a44861265b65865b67855a3e819ab9492107d42
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Oct 25, 2026.

Transparency log

Security for rhada 0.0.1

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 rhada-0.0.1.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 Oct 25, 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