A powerful command-line tool to download, parse, and generate custom reports from SUSE OVAL vulnerability data files. This script allows you to filter vulnerabilities by CPE/product, CVSS score, and date, and to export the results into multiple formats like CSV, HTML, and professional-looking PDFs with custom branding.
- Multiple Data Sources: Process data directly from a URL or a local file.
- Compressed File Support: Automatically handles
.gzand.bz2compressed XML files. - Advanced Filtering:
- By product using CPE strings (e.g.,
sles:15:sp4). - By minimum CVSS score.
- By a specific date range.
- By product using CPE strings (e.g.,
- Custom Sorting: Sort results by Release Date, Severity, CVE, or CVSS score.
- Flexible Output Formats:
print: Display results directly in the terminal.csv: Export full data for use in spreadsheets.html: Generate a styled HTML report with clickable links.pdf: Create professional PDF reports with custom branding.
- Report Customization:
- Add a custom title and logo (local file or URL).
- Add a custom footer with dynamic variables.
- Exclude specific columns from the report.
- Truncate long text in columns to a specific length.
- Control PDF page size, orientation, and font size.
- User-Friendly:
- Graceful exit on
Ctrl+C. - Clear status messages and error handling.
- Graceful exit on
Before running the script, you need to install the required Python libraries.
pip install requests pandas weasyprintThis tool is designed to work with the OVAL data files provided by SUSE. You can download them from the official SUSE FTP server:
- FTP Directory: https://ftp.suse.com/pub/projects/security/oval/
Two main types of files are available:
-
suse.linux.enterprise.15-affected.xml.bz2: Lists vulnerabilities that affect specific products. -
suse.linux.enterprise.15-patch.xml.bz2: Provides information based on security patches.
You can use either a compressed (.bz2) or uncompressed (.xml) file as input for the script.
The script is run from the command line with various options to control its behavior.
./cve_analyzer.py --file <path_to_file> [OPTIONS]
# or
./cve_analyzer.py --url [URL_to_file] [OPTIONS]
| Argument | Description | Example |
|---|---|---|
--file <path> |
Path to a local OVAL file (.xml, .gz, .bz2). |
--file ./suse.linux.enterprise.15-affected.xml.bz2 |
--url [url] |
URL of the OVAL file. If no URL is given, uses the default. | --url |
--cpe <string> |
Filter by a string in the product name or CPE (e.g., sles, 15, sp4). |
--cpe sles:15:sp4 |
--cvss <score> |
Filter by a minimum CVSS score (0.0-10.0). | --cvss 7.5 |
--start-date <date> |
Set a start date for the filter (YYYY-MM-DD). | --start-date 2025-01-01 |
--end-date <date> |
Set an end date for the filter (YYYY-MM-DD). | --end-date 2025-08-15 |
--sort-by <col> |
Column to sort the results by. | --sort-by "Release Date" |
--sort-order <ord> |
Sort order (asc or desc). Default is desc. |
--sort-order asc |
--output <name> |
Base name for the output file. | --output my-report |
--format <fmts...> |
Output format(s). Can be one or more of print, csv, html, pdf. |
--format html pdf |
--exclude-columns |
List of columns to exclude from the report. | --exclude-columns "Affected CPEs" |
--ellipsize <c> <l> |
Truncate a column <c> to a specific length <l>. Can be used multiple times. |
--ellipsize Description 80 |
--title <string> |
Custom title for the report. Supports variables. | --title "Report for %cpe%" |
--logo <path/url> |
Path or URL to a logo image. | --logo ./logo.png |
--logo-position |
Position of the logo (left, center, right). |
--logo-position left |
--footer <string> |
Custom footer for the PDF report. Supports variables. | --footer "Generated on %today%" |
--pdf-page-size |
Page size for PDF (A4-landscape, A4-portrait, auto). auto creates a single long page. |
--pdf-page-size auto |
--font-size <pts> |
Base font size for the PDF report. | --font-size 8 |
--show-total |
Display the total number of entries at the end of the report. | --show-total |
Note on Variables: The --title and --footer arguments accept the following variables: %today%, %startdate%, %enddate%, %cpe%, %total%.
Quickly find all Critical severity vulnerabilities for SLES 15 SP4 and display them in the terminal.
./cve_analyzer.py --file suse.linux.enterprise.15-affected.xml.bz2 --cpe "sles 15 sp4" --sort-by Severity
This example generates a highly customized PDF report for SLES 15 SP3 vulnerabilities with a CVSS score of 9.0 or higher since May 17, 2025.
./cve_analyzer.py \
--file suse.linux.enterprise.15-affected.xml.bz2 \
--cpe sles:15:sp3 \
--cvss 9.0 \
--start-date 2025-05-17 \
--output cvereport-sles15sp3-since-2025-05-17 \
--format pdf \
--sort-by "Release Date" \
--exclude-columns "Affected CPEs" \
--ellipsize "Description" 100 \
--ellipsize "Affected Packages" 100 \
--title "CVE Report for %cpe% (%total% found) since %startdate%" \
--logo ~/Pictures/mycompanylogo.svg \
--footer "Generated on %today%" \
--pdf-page-size A4-landscape \
--show-total
This command:
-
Uses a local data file.
-
Filters for
sles:15:sp3with a CVSS score>= 9.0since a specific date. -
Sets a custom output filename.
-
Generates a
pdf. -
Sorts by release date.
-
Excludes the
Affected CPEscolumn. -
Truncates the
DescriptionandAffected Packagescolumns. -
Creates a dynamic title and footer using variables.
-
Adds a local logo and displays the total count.
Generate a report of all vulnerabilities for SUSE Manager, using a single, continuous PDF page to avoid content clipping. This is ideal for viewing on a screen, not for printing.
./cve_analyzer.py \
--file suse.linux.enterprise.15-patch.xml.bz2 \
--cpe "suse-manager" \
--format pdf \
--output suse-manager-report \
--pdf-page-size auto \
--font-size 8
Generate a report of all vulnerabilities that were posted after 2025-05-17 for SLES 15 SP3. Use A4 landscape as page format, ellipsize the texts of two specific columns to 100 characters, add a title and footer with variables, sort by Release Date (descending), exclude the column named "Affected CPEs", show the total entries at the end.
./cve_analyzer.py \
--file suse.linux.enterprise.15-affected.xml.bz2 \
--cpe sles:15:sp3 \
--output cvereport-sles15sp3-since-2025-05-17 \
--format pdf \
--sort-by "Release Date" \
--exclude-columns "Affected CPEs" \
--ellipsize "Description" 100 \
--ellipsize "Affected Packages" 100 \
--title "CVE Report for %cpe% (%total% found) since %startdate%" \
--logo ~/Pictures/mylogo.svg \
--footer "Generated on %today%" --start-date 2025-05-17 \
--show-total \
--pdf-page-size A4-landscape