Skip to content

About

A CVE reporting tool that uses SUSE's OVAL information files

Resources

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

SUSE CVE Reporter

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.


Features

  • Multiple Data Sources: Process data directly from a URL or a local file.
  • Compressed File Support: Automatically handles .gz and .bz2 compressed XML files.
  • Advanced Filtering:
    • By product using CPE strings (e.g., sles:15:sp4).
    • By minimum CVSS score.
    • By a specific date range.
  • 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.

Requirements

Before running the script, you need to install the required Python libraries.

pip install requests pandas weasyprint

Data Source

This tool is designed to work with the OVAL data files provided by SUSE. You can download them from the official SUSE FTP server:

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.

Usage

The script is run from the command line with various options to control its behavior.

Basic Syntax

./cve_analyzer.py --file <path_to_file> [OPTIONS]
# or
./cve_analyzer.py --url [URL_to_file] [OPTIONS]

Arguments

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%.

Examples

Example 1: Quick On-Screen View

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

Example 2: Comprehensive PDF Report

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:sp3 with a CVSS score >= 9.0 since a specific date.

  • Sets a custom output filename.

  • Generates a pdf.

  • Sorts by release date.

  • Excludes the Affected CPEs column.

  • Truncates the Description and Affected Packages columns.

  • Creates a dynamic title and footer using variables.

  • Adds a local logo and displays the total count.

Example 3: Single-Page PDF for On-Screen Viewing

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

Example 4: A4 Landscape PDF, customized everything

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

About

A CVE reporting tool that uses SUSE's OVAL information files

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages