A Python library for generating, parsing, and validating CSAF VEX files.
pip install csaf-vexFor development:
git clone https://github.com/RedHatProductSecurity/csaf-vex.git
cd csaf-vex
uv sync --devRead and parse a CSAF VEX file:
csaf-vex read tests/test_files/sample-vex.jsonDisable verification:
csaf-vex read --no-verify tests/test_files/minimal-vex.jsonfrom csaf_vex.models import CSAFVEXDocument
# Load from dictionary
with open("vex-file.json") as f:
data = json.load(f)
csaf_vex = CSAFVEXDocument.from_dict(data)
# Access document metadata
print(csaf_vex.document.title)
print(csaf_vex.document.tracking_id)
# Access vulnerabilities and product tree
print(f"Vulnerabilities: {len(csaf_vex.vulnerabilities)}")
print(f"Products: {len(csaf_vex.product_tree)}")
# Disable verification
csaf_vex = CSAFVEXDocument.from_dict(data, verify=False)# Check linting issues
uv run ruff check .
# Auto-fix linting issues
uv run ruff check --fix .
# Format code
uv run ruff format .src/csaf_vex/cli.py- CLI entrypointsrc/csaf_vex/models/csafvex.py- CSAFVEXDocument and Document classessrc/csaf_vex/validation/- Validation logic (future)src/csaf_vex/verification/- Verification logic (future)tests/test_files/- Test CSAF VEX filestests/- Tests (future)
MIT License - see LICENSE file for details.
- Jakub Frejlach ([email protected])
- Juan Perez de Algaba ([email protected])
- George Vauter ([email protected])
Developed by Red Hat Product Security.