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
-
Dual-Mode Operation
- Source Mode (default when
--distis omitted): Inspects Python source workspaces. Supports modern PEP 621 /uvprojects (pyproject.toml,uv.lock) as well as legacysetuptoolsand pip workspaces (setup.py,setup.cfg,requirements.txt).setup.pyis safely inspected using static Abstract Syntax Tree (AST) parsing without executing untrusted code. Discovers installed package metadata across virtual environments (.venv,venv,env) to separate direct runtime dependencies from development/build tools, 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 aspytest,ruff,mypy,nuitka, andpyinstaller), inspects bundled native shared libraries (.so), and verifies ELF dynamic linkage.
- Source Mode (default when
-
Legal and Licence Compliance
- Parses and normalises
METADATAlicence headers, PEP 639License-Expressionfields, 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) usinglicense-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.sorelinking support.
- Flags strong copyleft (
- Generates a
THIRD_PARTY_NOTICESattribution file containing component inventory, copyright notices,NOTICE/AUTHORSfiles, and verbatim licence texts.
- Parses and normalises
-
ELF Binary and Native Library Inspection
- Parses 32-bit and 64-bit ELF executables and
.solibraries viapyelftoolswith astructfallback 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_NEEDEDshared 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.
- Parses 32-bit and 64-bit ELF executables and
-
Security Vulnerability Auditing
- Integrates
pip-audit(OsvServiceandResolvedDependency) 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
cvssand summarises findings by severity (CRITICAL,HIGH,MEDIUM,LOW) with fixed version recommendations.
- Integrates
-
Standards-Compliant SBOMs and CLI Exit Codes
- Generates CycloneDX 1.5 JSON (via
cyclonedx-python-libandpackageurl-python) and SPDX 2.3 JSON SBOMs. - Provides a typed CLI built with
typerand deterministic exit codes for CI/CD enforcement.
- Generates CycloneDX 1.5 JSON (via
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. Policy Controls, Internal Packages, and pyproject.toml Configuration
Rhada supports turnkey policy configuration via CLI options or centrally via [tool.rhada] in your pyproject.toml:
Internal Package Whitelisting (--internal-package / --allow-package)
For projects utilizing in-house or corporate packages (e.g. from private registries or monorepos):
- Matching packages are treated as first-party organization code.
- Exempt from third-party license compliance checks (
LIC-UNKNOWN,LIC-PROPRIETARY,LIC-POLICY-NOT-ALLOWED). - Bypassed from public OSV.dev vulnerability queries (preventing private package name leakage).
- Omitted from
THIRD_PARTY_NOTICES(which are reserved for third-party OSS). - Classified as first-party application code in distribution file accounting.
# Whitelist by pattern or comma-separated names
uv run rhada --project . --internal-package "mycorp-*,internal-auth"
Ignoring Dependencies (--ignore-package)
To completely omit specific packages from audit findings:
uv run rhada --project . --ignore-package "legacy-test-tool,mock-*"
Approved Licences (--allow-licence / --allow-license)
# Approve standard open-source licences alongside internal company or proprietary licences
uv run rhada --project . \
--allow-licence "MIT,Apache-2.0,BSD-3-Clause,0BSD,LicenseRef-AcmeCorp,Proprietary"
Declarative Configuration in pyproject.toml
All policy rules and operational defaults can be declared in [tool.rhada]:
[tool.rhada]
# Whitelist internal corporate packages (supports exact names and wildcards)
internal-packages = [
"mycorp-*",
"internal-security-sdk",
]
# Completely ignore specific dependencies
ignore-packages = [
"legacy-stub",
]
# Approved licenses for your organisation
allowed-licenses = [
"MIT",
"Apache-2.0",
"BSD-3-Clause",
"0BSD",
"Proprietary",
"LicenseRef-Corporate",
]
# Optional audit enforcement defaults
fail-on-severity = "high"
fail-on-license = "high"
allow-unknown-license = false
verbose = false
offline = false
CLI flags supplement and take precedence over pyproject.toml settings.
4. LGPL Source Code Links and Compliance Offers
For packages governed by the GNU Lesser General Public License (LGPL-2.0, LGPL-2.1, LGPL-3.0), Section 4(d) / Section 6 requires that recipients have access to complete corresponding source code and retain the ability to modify and relink the library:
- Rhada resolves upstream repository and release source URLs from package
Project-URLmetadata, PyPI files, or native library registries. - Discovered source links are included directly in
LIC-LGPL-DYNAMICandLIC-LGPL-MONOLITHICcompliance findings and embedded into CycloneDX (vcs) and SPDX (downloadLocation) SBOMs. THIRD_PARTY_NOTICESincludes a dedicated LGPL Compliance & Source Code Offer section providing exact source code download locations and written offer statements.
5. Distribution File Accounting & Inventory (--verbose / --full)
When auditing a compiled distribution directory (--dist), Rhada performs full file inventory accounting to verify that every distributed file is attributed and accounted for:
- Application Binaries (
application-binary): Main entrypoint executables and first-party compiled modules. First-party packages and submodules (configured inpyproject.tomlor discovered in the source tree) are properly recognized as project source rather than flagged as unknown third-party packages. - Python Runtime (
python-runtime): CPython runtime shared libraries (python313.dll,libpython3.so) and standard library C-extensions (select.pyd,_socket.pyd, etc., licensed underPSF-2.0). - Compiler / Platform ABI (
compiler-abi): Standard compiler runtimes and platform ABIs (vcruntime140.dll,msvcp140.dll,ucrtbase.dll,libc.so, etc.). - Native Shared Libraries (
native-library): Discovered or vendored third-party shared libraries (libcrypto,libssl,libopenblas, etc.). - Python Packages (
python-package): Bundled third-party wheels, bytecode, and extension libraries. - Metadata (
data-metadata): Compilation reports, license files, notices, SBOMs, and manifest files. - Unaccounted Files (
unaccounted): Any unrecognized loose file that may require audit or review.
By default, the audit summary reports the overall coverage percentage:
Distribution File Coverage: 100.0% (32/32 files classified: 1 application binary, 25 python runtime, 4 compiler abi, 2 data metadata)
Pass --verbose (or -v, --full) to render the complete line-by-line inventory table detailing the relative file path, category, attributed component, file size, SHA-256 hash, and classification details:
uv run rhada --project . --dist ./dist/my-app.dist --compilation-report ./dist/report.xml --verbose
The complete inventory is also serialized under file_inventory in JSON reports (--format json or --report-json).
6. 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
Legal Disclaimer
Running Tests
uv run pytest -v
Metadata
Release files for rhada 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| rhada-0.0.5.tar.gz | 188.8 kB | With provenance | Details for rhada-0.0.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| rhada-0.0.5-py3-none-any.whl | Python 3 | none | any | Details for rhada-0.0.5-py3-none-any.whl |
Total release size: 289.2 kB
Release files / rhada-0.0.5.tar.gz
| Download URL | rhada-0.0.5.tar.gz |
|---|---|
| Size | 188.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a62dc7c01e11e298fc8116a7cba004161e85c39fe36527545ce5e054e40993cf
|
|
BLAKE2b-256 checksum How to use checksums |
ccd15dd61b035a04c0110e9961522e1d15377cf1b4ef9fef415c0d5df8ac74a8
|
| 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 28, 2026.
Transparency logRelease files / rhada-0.0.5-py3-none-any.whl
| Download URL | rhada-0.0.5-py3-none-any.whl |
|---|---|
| Size | 100.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
31384164f48efa96fb46908ce4f91d97426c06edf2d36f6c2acf8740a3ae50a8
|
|
BLAKE2b-256 checksum How to use checksums |
44437927d5e3679a04f6dca2093c45ddd5be94cffcd280350b7a7d2b610eeebe
|
| 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 28, 2026.
Transparency logSecurity for rhada 0.0.5
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.
Attestation for rhada-0.0.5.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 28, 2026.
Transparency logA 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.