Skip to content

About

PowerShell-based CVE exception file parser with input validation, error handling, and structured JSON/CSV output for vulnerability management workflows.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

CVE Exception File Parser - PowerShell

Problem Statement

Develop a PowerShell script to parse .cveignore files containing CVE exception rules.

The parser should:

  • Accept a file path or a directory path.
  • Ignore comments and blank lines.
  • Parse records using the format CVE|LibraryVersions|AllowedReason|AllowedExpiry.
  • Validate CVE identifiers, library/version combinations, required fields, and optional expiry dates.
  • Exclude invalid rules and return all valid rules as structured PowerShell objects.

Solution

The implementation is available in Parse-CVEIgnore.ps1.

The script validates each record, generates warnings for invalid entries, and continues processing the remaining records.

How to Run

Run the parser against the sample input:

$rules = @(.\Parse-CVEIgnore.ps1 -Path .\.cveignore)
$rules.Count

Alternatively, pass the current directory:

.\Parse-CVEIgnore.ps1 -Path .

Test Results

The sample .cveignore dataset contains 24 CVE records.

  • 23 valid records returned.
  • 1 invalid record rejected due to a malformed expiry date.
  • Invalid records generate warnings without stopping the parser.

Environment: Tested using Windows PowerShell 5.1.

About

PowerShell-based CVE exception file parser with input validation, error handling, and structured JSON/CSV output for vulnerability management workflows.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages