Skip to main content

yocto-security-tools

CI OpenSSF Best Practices OpenSSF Scorecard PyPI version License: MIT

CVE management tools for Yocto/OpenEmbedded Linux distributions. They find the upstream commits that fix a CVE, apply them to your recipes, and optionally use an AI backend to resolve the conflicts and build failures that follow.

How it works

graph LR
    E["cve-metadata-extractor<br/>Find fix commits"] -->|cve-metadata.json| C["cve-corrector<br/>Apply patches via devtool"]
    C -->|exit code + state| A["cve-agent<br/>AI-assisted resolution"]
    A -->|subprocess| C

Each tool works standalone. Chain them with --cve-info cve-metadata.json.

Requirements

  • Python 3.10+ and Git
  • A sourced Yocto build environment (BBPATH set) for cve-corrector and cve-agent
  • An AI backend for cve-agent — see Modules below

Installation

pip install yocto-security-tools

From source:

git clone https://github.com/Ericsson/yocto-security-tools.git
cd yocto-security-tools
pip install -e .

Quick start

# 1. Find fix commits for the CVEs in a Yocto CVE summary
cve-metadata-extractor --yocto-summary cve-summary.json --output cve-metadata.json

# 2. Source your Yocto build environment
source oe-init-build-env

# 3. Apply one fix
cve-corrector --cve-id CVE-2024-1234 --cve-info cve-metadata.json

# ...or let an AI backend resolve conflicts and build failures for you
cve-agent --cve-id CVE-2024-1234 --cve-info cve-metadata.json

Modules

cve-metadata-extractor

Finds the commits that fix a CVE by querying Debian security-tracker, OSV, CVEList V5, the Ubuntu CVE Tracker, and NVD, then writes a single cve-metadata.json for the other two tools. Accepts a Yocto cve-summary.json (--yocto-summary) or explicit CVE IDs (--cve-id). Optionally checks whether a fix already landed in an OpenEmbedded branch (--check-oe).

→ Full reference

cve-oe-backport

Uses oe-status-cache.json and cve-metadata.json to copy a CVE patch from an existing OpenEmbedded repository clone into your layer and write a version-specific .bbappend. It does not build or validate the result.

→ Build-to-backport guide

cve-corrector

Applies a fix to a recipe using devtool: cherry-picks the upstream commit into the recipe's source tree, builds, runs ptest, and finishes the change into a layer. Stops with a specific exit code when it needs help — conflict, build failure, or ptest failure — so you can fix it by hand and resume with --continue. --fix-url is repeatable and applies two or more commits as one ordered, dependent chain.

→ Full reference

cve-agent

Runs cve-corrector as a subprocess and, on a recoverable exit code, starts a guarded AI session to resolve the conflict or failure, then retries. Backends are interchangeable via --backend:

Backend --backend Needs
Kiro CLI kiro (default) kiro-cli
Claude Code claude Authenticated claude CLI on PATH
Native OpenAI-compatible openai / openai-<profile> A tool-capable OpenAI-compatible endpoint, including local Ollama
Custom plugin your own name A file in extra/ implementing AIBackend

Every backend runs under the same file-scope guard, so the AI can only modify the files the upstream fix touches. Check a backend is installed and responding with cve-agent --backend <name> --verify-backend. Use --cve-list for batch runs.

→ Full reference · OpenAI-compatible/Ollama setup

Documentation

docs/README.md indexes everything: per-tool references, configuration, and the design docs covering the result schema, agent artifacts, preflight checks, the corrector-to-agent handoff, safe patch transfer, semantic security validation, and the evaluation harness.

Plugins

Add a CVE data source or an AI backend by dropping a .py file into extra/ — no existing file needs to change. See extra/README.md for the plugin guide.

Configuration

Data and cache directories follow the XDG base directory spec and are overridable, as are the extractor's config path and the API tokens. See docs/configuration.md.

Development

python3 -m venv venv
source venv/bin/activate
pip install -e ".[dev]"
pytest

See CONTRIBUTING.md for full development guidelines.

License

MIT — see LICENSE

Metadata

Release files for yocto-security-tools 1.3

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

Source distribution (sdist)

Source distribution for yocto-security-tools 1.3
File Size Uploaded Provenance
yocto_security_tools-1.3.tar.gz 396.2 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for yocto-security-tools 1.3
File Interpreter ABI Platform
yocto_security_tools-1.3-py3-none-any.whl Python 3 none any Details

Total release size: 839.3 kB

Release files / yocto_security_tools-1.3.tar.gz

Download URL yocto_security_tools-1.3.tar.gz
Size 396.2 kB
Tags Source
SHA-256 checksum
How to use checksums
4b55d572eff83a089f1bcce7d2b008ca0fdbfda2a16288e18d58c0ad2e7699c0
BLAKE2b-256 checksum
How to use checksums
f27595569a2b51c638dbe46f7d5265e668209d8e1ced976e2ce6251511e28c07
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 Oct 21, 2026.

Transparency log

Release files / yocto_security_tools-1.3-py3-none-any.whl

Download URL yocto_security_tools-1.3-py3-none-any.whl
Size 443.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5f85b71dbb2dd681a21c9d4a47db9e78690f6f2ea539a7ff3c67612d2856da0c
BLAKE2b-256 checksum
How to use checksums
fc1d8365a3f29476167a0c6a051626768d61f4f2257bf214cca8db8090208c2e
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 Oct 21, 2026.

Transparency log

Security for yocto-security-tools 1.3

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

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for yocto_security_tools-1.3.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 21, 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