Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

vulnerability-csv-reporting

БесплатноБез исполняемых скриптовНе проверен

Generate structured CSV security audit reports from vulnerability data with proper filtering and formatting. This skill covers CSV schema design for security…

benchflow-aiот benchflow-ai★ 1 941 звезда на GitHub

Об этом скилле

Vulnerability CSV Report Generation

This skill provides guidance on generating structured CSV reports from vulnerability scan data—a common format for security audits and compliance reporting.

Overview

CSV (Comma-Separated Values) is a widely-used format for security reports because it's:

  • Human-readable: Can be opened in Excel, Google Sheets
  • Machine-parseable: Easy to process programmatically
  • Universal: Supported by all data analysis tools
  • Lightweight: Smaller than JSON/XML formats

When to Use CSV Reports

Ideal Use Cases

  • Compliance audits requiring tabular data
  • Executive summaries for non-technical stakeholders
  • Integration with ticketing systems (Jira, ServiceNow)
  • Automated vulnerability tracking pipelines
  • Data analysis in spreadsheet tools

Limitations

  • No hierarchical data (flat structure only)
  • Limited support for nested information
  • No standard for binary data

Alternative formats: JSON (for APIs), PDF (for formal reports), HTML (for dashboards)

CSV Schema Design for Security Reports

Essential Fields

A well-designed vulnerability report CSV should include:

Field Type Description Example
Package String Vulnerable package name express
Version String Installed version 4.17.1
CVE_ID String Vulnerability identifier CVE-2022-24999
Severity Enum Risk level CRITICAL, HIGH
CVSS_Score Float/String Numeric severity score 9.8 or N/A
Fixed_Version String Patched version 4.18.0 or N/A
Title String Brief description XSS in Express.js
Url String Reference link https://nvd.nist.gov/...

Design Principles

  1. Use descriptive column names: Package not pkg, CVE_ID not id
  2. Handle missing data: Use N/A for unavailable fields, not empty strings
  3. Consistent data types: Ensure all rows have same format
  4. Include metadata: Consider adding scan date, target, tool version

Python CSV Generation with DictWriter

Why DictWriter?

Python's csv.DictWriter is ideal for structured reports:

  • Type-safe: Column names defined upfront
  • Readable: Use dictionary keys instead of indices
  • Maintainable: Easy to add/remove columns
  • Automatic header generation: No manual header writing

Basic Usage

import csv

# Define schema
headers = ["Package", "Version", "CVE_ID", "Severity", "CVSS_Score", 
           "Fixed_Version", "Title", "Url"]

# Prepare data
vulnerabilities = [
    {
        "Package": "minimist",
        "Version": "1.2.5",
        "CVE_ID": "CVE-2021-44906",
        "Severity": "CRITICAL",
        "CVSS_Score": 9.8,
        "Fixed_Version": "1.2.6",
        "Title": "Prototype Pollution",
        "Url": "https://avd.aquasec.com/nvd/cve-2021-44906"
    }
]

# Write CSV
with open('security_audit.csv', 'w', newline='', encoding='utf-8') as f:
    writer = csv.DictWriter(f, fieldnames=headers)
    writer.writeheader()  # Write column names
    writer.writerows(vulnerabilities)  # Write all rows

Important parameters:

  • newline='': Prevents extra blank lines on Windows
  • encoding='utf-8': Handles special characters in descriptions

Severity-Based Filtering

Why Filter by Severity?

Security teams prioritize based on risk. Filtering ensures reports focus on critical issues:

Severity Action Required Typical SLA
CRITICAL Immediate patch 24 hours
HIGH Urgent patch 7 days
MEDIUM Scheduled patch 30 days
LOW Optional patch 90 days

Implementation

def filter_high_severity(vulnerabilities, min_severity=['HIGH', 'CRITICAL']):
    """
    Filter vulnerabilities by severity level.
    
    Args:
        vulnerabilities: List of vulnerability dictionaries
        min_severity: List of severity levels to include
        
    Returns:
        Filtered list containing only specified severity levels
    """
    filtered = []
    for vuln in vulnerabilities:
        if vuln.get('Severity') in min_severity:
            filtered.append(vuln)
    return filtered

# Usage
all_vulns = [...]  # From scanner
critical_vulns = filter_high_severity(all_vulns, ['CRITICAL', 'HIGH'])

Field Mapping from JSON to CSV

Extracting Fields from Scanner Output

import json

def parse_trivy_json_to_csv_records(json_file):
    """
    Parse Trivy JSON output and extract CSV-ready records.
    
    Returns list of dictionaries, one per vulnerability.
    """
    with open(json_file, 'r', encoding='utf-8') as f:
        data = json.load(f)
    
    records = []
    
    if 'Results' in data:
        for result in data['Results']:
            target = result.get('Target', 'Unknown')
            
            for vuln in result.get('Vulnerabilities', []):
                # Map JSON fields to CSV fiel
Полный SKILL.md на GitHub

Установить vulnerability-csv-reporting в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл vulnerability-csv-reporting?

Generate structured CSV security audit reports from vulnerability data with proper filtering and formatting. This skill covers CSV schema design for security reports, using Python csv.DictWriter, severity-based filtering, and field mapping from JSON to tabular format.

Как установить скилл vulnerability-csv-reporting?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл vulnerability-csv-reporting запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить vulnerability-csv-reporting с