CG
SkillsBuilding Vulnerability Exception Tracking System
Start Free
Back to Skills Library
Vulnerability Management🟡 Intermediate

Building Vulnerability Exception Tracking System

Build a vulnerability exception and risk acceptance tracking system with approval workflows, compensating controls documentation, and expiration management.

3 min read4 code examples

Prerequisites

  • Python 3.9+ with `flask`, `sqlalchemy`, `requests`, `jinja2`
  • PostgreSQL or SQLite database
  • Email/Slack integration for approval notifications
  • Vulnerability management platform API (DefectDojo, Qualys, Tenable)

Building Vulnerability Exception Tracking System

Overview

A vulnerability exception tracking system manages cases where vulnerabilities cannot be remediated within SLA timelines. It provides structured workflows for requesting exceptions, documenting compensating controls, obtaining risk acceptance approvals, and automatically expiring exceptions when their validity period ends. This ensures organizations maintain visibility into accepted risks while complying with frameworks like PCI DSS, SOC 2, and NIST CSF.

Prerequisites

  • Python 3.9+ with flask, sqlalchemy, requests, jinja2
  • PostgreSQL or SQLite database
  • Email/Slack integration for approval notifications
  • Vulnerability management platform API (DefectDojo, Qualys, Tenable)

Exception Request Workflow

Exception Categories

CategoryDescriptionMax DurationApprover Level
Remediation DelayPatch available but deployment blocked30 daysTeam Lead + Security
No Fix AvailableVendor has not released a patch90 daysSecurity Director
Business CriticalSystem cannot be patched without outage60 daysVP Engineering + CISO
False PositiveFinding is not a real vulnerabilityPermanentSecurity Analyst
Compensating ControlAlternative mitigation in place180 daysSecurity Architect

Required Fields for Exception Request

exception_schema = {
    "cve_id": "CVE-2024-XXXX",
    "finding_id": "unique-finding-reference",
    "asset_hostname": "prod-db-01.corp.local",
    "severity": "high",
    "cvss_score": 8.1,
    "category": "remediation_delay",
    "justification": "Database upgrade required before patch can be applied",
    "compensating_controls": [
        "WAF rule blocking exploit pattern deployed",
        "Network segmentation restricting access to trusted VLANs only",
        "Enhanced monitoring via Splunk alert for exploitation indicators"
    ],
    "requested_expiration": "2024-06-15",
    "requestor_email": "dbadmin@company.com",
    "approver_emails": ["security-lead@company.com", "ciso@company.com"],
    "risk_rating": "medium",
}

Database Schema

CREATE TABLE vulnerability_exceptions (
    id SERIAL PRIMARY KEY,
    cve_id VARCHAR(20) NOT NULL,
    finding_id VARCHAR(100) NOT NULL,
    asset_hostname VARCHAR(255),
    severity VARCHAR(20),
    cvss_score DECIMAL(3,1),
    category VARCHAR(50) NOT NULL,
    justification TEXT NOT NULL,
    compensating_controls TEXT,
    status VARCHAR(20) DEFAULT 'pending',
    requested_by VARCHAR(255) NOT NULL,
    approved_by VARCHAR(255),
    requested_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    approved_at TIMESTAMP,
    expires_at TIMESTAMP NOT NULL,
    expired BOOLEAN DEFAULT FALSE,
    risk_rating VARCHAR(20),
    review_notes TEXT,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

CREATE TABLE exception_audit_log (
    id SERIAL PRIMARY KEY,
    exception_id INTEGER REFERENCES vulnerability_exceptions(id),
    action VARCHAR(50) NOT NULL,
    actor VARCHAR(255) NOT NULL,
    details TEXT,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

CREATE INDEX idx_exception_status ON vulnerability_exceptions(status);
CREATE INDEX idx_exception_expires ON vulnerability_exceptions(expires_at);
CREATE INDEX idx_exception_cve ON vulnerability_exceptions(cve_id);

Implementation

Exception Request API

from flask import Flask, request, jsonify
from datetime import datetime, timezone
import json

app = Flask(__name__)

@app.route("/api/exceptions", methods=["POST"])
def create_exception():
    data = request.json
    required = ["cve_id", "finding_id", "category", "justification", "expires_at", "requestor_email"]
    for field in required:
        if field not in data:
            return jsonify({"error": f"Missing required field: {field}"}), 400

    # Validate expiration does not exceed category maximum
    max_days = {"remediation_delay": 30, "no_fix": 90, "business_critical": 60,
                "false_positive": 365, "compensating_control": 180}
    # Insert into database and notify approvers
    return jsonify({"status": "pending", "id": "exc-12345"})

@app.route("/api/exceptions/<exc_id>/approve", methods=["POST"])
def approve_exception(exc_id):
    approver = request.json.get("approver_email")
    notes = request.json.get("notes", "")
    # Update status to approved, record approver and timestamp
    return jsonify({"status": "approved"})

@app.route("/api/exceptions/<exc_id>/reject", methods=["POST"])
def reject_exception(exc_id):
    reviewer = request.json.get("reviewer_email")
    reason = request.json.get("reason")
    # Update status to rejected, record reviewer and reason
    return jsonify({"status": "rejected"})

Expiration Checker (Daily Cron)

# Check for expired exceptions daily
python3 scripts/process.py --check-expirations

# Generate monthly exception report
python3 scripts/process.py --report --output exception_report.json

Compensating Controls Documentation

For each exception, compensating controls must address:

  1. Detection: How will exploitation attempts be detected?
  2. Prevention: What barriers reduce exploitation likelihood?
  3. Response: What incident response procedures are in place?
  4. Monitoring: What continuous monitoring ensures controls remain effective?

Verification Criteria

Confirm successful execution by validating:

  • [ ] All prerequisite tools and access requirements are satisfied
  • [ ] Each workflow step completed without errors
  • [ ] Output matches expected format and contains expected data
  • [ ] No security warnings or misconfigurations detected
  • [ ] Results are documented and evidence is preserved for audit

Compliance Framework Mapping

This skill supports compliance evidence collection across multiple frameworks:

  • SOC 2: CC7.1 (Monitoring), CC8.1 (Change Management)
  • ISO 27001: A.12.6 (Technical Vulnerability Management)
  • NIST 800-53: RA-5 (Vulnerability Scanning), SI-2 (Flaw Remediation), CM-6 (Configuration Settings)
  • NIST CSF: ID.RA (Risk Assessment), PR.IP (Information Protection)

Claw GRC Tip: When this skill is executed by a registered agent, compliance evidence is automatically captured and mapped to the relevant controls in your active frameworks.

Deploying This Skill with Claw GRC

Agent Execution

Register this skill with your Claw GRC agent for automated execution:

# Install via CLI
npx claw-grc skills add building-vulnerability-exception-tracking-system

# Or load dynamically via MCP
grc.load_skill("building-vulnerability-exception-tracking-system")

Audit Trail Integration

When executed through Claw GRC, every step of this skill generates tamper-evident audit records:

  • SHA-256 chain hashing ensures no step can be modified after execution
  • Evidence artifacts (configs, scan results, logs) are automatically attached to relevant controls
  • Trust score impact — successful execution increases your agent's trust score

Continuous Compliance

Schedule this skill for recurring execution to maintain continuous compliance posture. Claw GRC monitors for drift and alerts when re-execution is needed.

References

  • NIST SP 800-53 Rev 5 - CA-7 Continuous Monitoring
  • PCI DSS v4.0 Compensating Controls
  • CIS Controls v8 - Control 7.7

Use with Claw GRC Agents

This skill is fully compatible with Claw GRC's autonomous agent system. Deploy it to any registered agent via MCP, and every execution will be logged in the tamper-evident audit trail.

// Load this skill in your agent
npx claw-grc skills add building-vulnerability-exception-tracking-system
// Or via MCP
grc.load_skill("building-vulnerability-exception-tracking-system")

Tags

vulnerability-exceptionrisk-acceptancecompensating-controlsexception-trackingvulnerability-managementgovernance

Related Skills

Vulnerability Management

Building Vulnerability Aging and Sla Tracking

5m·intermediate
Vulnerability Management

Building Vulnerability Dashboard with DefectDojo

3m·intermediate
Vulnerability Management

Implementing Patch Management Workflow

5m·intermediate
Vulnerability Management

Implementing Vulnerability Management with Greenbone

3m·intermediate
Vulnerability Management

Implementing Vulnerability Sla Breach Alerting

4m·intermediate
Vulnerability Management

Performing Authenticated Vulnerability Scan

4m·intermediate

Skill Details

Domain
Vulnerability Management
Difficulty
intermediate
Read Time
3 min
Code Examples
4

On This Page

OverviewPrerequisitesException Request WorkflowDatabase SchemaImplementationCompensating Controls DocumentationReferencesVerification CriteriaCompliance Framework MappingDeploying This Skill with Claw GRC

Deploy This Skill

Add this skill to your Claw GRC agent and start automating.

Get Started Free →