Cve Management Workflow

Production-grade guide to cve management workflow covering architecture patterns, implementation strategies, testing approaches, and operational best practices for enterprise engineering teams.

Cve Management Workflow is the systematic process of identifying, assessing, prioritizing, remediating, and verifying security vulnerabilities in software artifacts across the development lifecycle. It matters when a team must respond to new CVEs—often dozens per week—across hundreds of services, containers, and dependencies, ensuring that each vulnerability is tracked from discovery to closure, with clear ownership, SLAs, and audit trails. This workflow is active during every release cycle, incident response, and security review, and it becomes critical when a high-severity CVE like Log4Shell or Spring4Shell triggers an enterprise-wide patching campaign.

Vulnerability Ingestion

New CVEs enter the system through automated and manual channels. The primary ingestion path is a continuous feed from public vulnerability databases—NVD, GitHub Advisory, OSV, and Syft-generated SBOMs—into a central vulnerability database. The process begins with a script that polls the NVD API every 15 minutes to fetch new and updated CVEs.

curl -s "https://services.nvd.nist.gov/rest/json/cves/2.0?resultsPerPage=100&lastModStartDate=2024-04-01T00:00:00.000Z" \
  | jq -c '.result.CVEItems[] | { id: .cve.cveMetadata.cveId, published: .cve.cveMetadata.lastModified, description: .cve.description.descriptionData[0].value }'

Each CVEItem is normalized into a common schema in a PostgreSQL table:

CREATE TABLE vulnerabilities (
    id TEXT PRIMARY KEY,
    title TEXT,
    description TEXT,
    published TIMESTAMP WITH TIME ZONE,
    last_modified TIMESTAMP WITH TIME ZONE,
    severity TEXT CHECK (severity IN ('LOW', 'MEDIUM', 'HIGH', 'CRITICAL')),
    cvss_score NUMERIC(3,2),
    references JSONB,
    metadata JSONB
);

A worker process listens to a Kafka topic vulnerabilities.new and inserts or updates records in this table using COPY for high-throughput ingestion.

A second ingestion path occurs when dependency scans emit SBOMs (Software Bill of Materials) in JSON format via Syft:

{
  "sbom": {
    "metadata": {
      "name": "my-app",
      "version": "1.2.0",
      "created": "2024-04-05T12:00:00Z"
    },
    "components": [
      {
        "name": "express",
        "version": "4.18.2",
        "purl": "pkg:npm/[email protected]",
        "vulnerabilities": [
          {
            "id": "CVE-2023-24581",
            "cvss": 7.5,
            "description": "Missing input validation in Express.js middleware.",
            "source": "npm"
          }
        ]
      }
    ]
  }
}

A parse-sbom.sh script parses the SBOM and enriches each component with its CVEs from the central database:

#!/bin/bash
set -euo pipefail

while IFS= read -r -d '' file; do
  jq -r '.sbom.components[].purl' "$file" | \
  while IFS= read -r purl; do
    # Extract package name and version from purl
    pkg_name=$(echo "$purl" | cut -d'/' -f3 | cut -d'@' -f1)
    pkg_version=$(echo "$purl" | cut -d'/' -f4 | cut -d'@' -f2)

    # Query for all CVEs affecting this package version
    psql -c "
      SELECT id, title, cvss_score, description
      FROM vulnerabilities
      WHERE id IN (
        SELECT cve_id FROM cve_package_mapping
        WHERE package_name = $1 AND version = $2
      )
      ORDER BY cvss_score DESC
    " "$pkg_name" "$pkg_version" | \
    jq -c --argjson pkg "$(jq -n --arg name "$pkg_name" --arg version "$pkg_version" '{name: $name, version: $version, vulnerabilities: []}')" '
      . + {vulnerabilities: [inputs]}
    '
  done
done < <(find /sboms -name "*.json" -print0)

Prioritization and Triage

Once vulnerabilities are ingested, they are evaluated for priority using a risk-based scoring system. The primary driver is CVSS (Common Vulnerability Scoring System), but the team extends it with a custom formula:

priority_score = 0.6 * cvss_score
               + 0.2 * (10 - age_in_days)
               + 0.2 * (1 if affected_in_production else 0)

A nightly job runs this calculation:

CREATE MATERIALIZED VIEW vulnerability_priorities AS
SELECT
  v.id,
  v.title,
  v.cvss_score,
  EXTRACT(EPOCH FROM (NOW() - v.published)) / 86400 AS age_days,
  CASE WHEN EXISTS (
    SELECT 1 FROM deployments d
    WHERE d.service_id = v.service_id AND d.environment = 'production'
  ) THEN 1 ELSE 0 END AS in_production,
  (0.6 * v.cvss_score + 0.2 * (10 - EXTRACT(EPOCH FROM (NOW() - v.published)) / 86400) + 0.2 * (CASE WHEN EXISTS (...) THEN 1 ELSE 0 END)) AS priority_score
FROM vulnerabilities v
ORDER BY priority_score DESC;

This view powers a triage dashboard. Engineers review the top 20 new high-priority CVEs each Monday, using a simple interface that allows them to:

The triage process is recorded in a triage_events table:

CREATE TABLE triage_events (
    id SERIAL PRIMARY KEY,
    vulnerability_id TEXT REFERENCES vulnerabilities(id),
    action TEXT CHECK (action IN ('created', 'assigned', 'investigating', 'approved', 'blocked', 'reviewed')),
    assigned_to TEXT,
    notes TEXT,
    timestamp TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
    metadata JSONB
);

A common failure mode: engineers mark a CVE as “investigating” but forget to update it when the investigation concludes. This leads to stale entries, where CVEs remain in limbo. A monitoring alert detects any “investigating” CVE older than 7 days with no activity.

Remediation and Patching

Remediation begins when an engineer assigns a CVE to a team. The team decides on the patching strategy: patch the service, upgrade a dependency, or create a security hotfix.

For dependency vulnerabilities, the team uses renovate.json to configure automated dependency updates with security priority:

{
  "extends": [
    "config:base"
  ],
  "packageRules": [
    {
      "packagePatterns": ["^express$", "^react$", "^@types/react$"],
      "groupName": "Frontend Dependencies",
      "schedule": ["weekly"],
      "automerge": true,
      "automergeType": "pr"
    },
    {
      "packagePatterns": ["^express"],
      "severity": "high",
      "groupName": "Security Dependencies",
      "automerge": true,
      "automergeType": "pr",
      "automergeStrategy": "squash"
    }
  ],
  "labels": {
    "pr": ["security", "dependencies"],
    "branch": ["security"]
  }
}

When a dependency update PR is created, it includes a changelog snippet from changelog.json:

{
  "CVE-2023-24581": {
    "title": "Express.js: Missing input validation in middleware",
    "cvss": 7.5,
    "description": "Input validation in Express.js middleware is missing, allowing arbitrary data injection.",
    "references": [
      "https://github.com/expressjs/express/issues/4789",
      "https://nvd.nist.gov/vuln/detail/CVE-2023-24581"
    ]
  }
}

For service-level vulnerabilities, the team creates a security-remediation.yml GitHub Actions workflow:

name: Security Remediation
on:
  workflow_dispatch:
    inputs:
      cve_id:
        description: "CVE ID to remediate"
        required: true
        default: "CVE-2023-24581"
      target_branch:
        description: "Branch to target"
        default: "main"
  pull_request:
    types: [opened, synchronize]

jobs:
  patch:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          ref: ${{ github.event.pull_request.head.ref }}

      - name: Apply CVE fix
        run: |
          echo "Applying fix for ${{ github.inputs.cve_id }}"
          # Generate patch from CVE metadata
          cat <<EOF > patches/${{ github.inputs.cve_id }}.patch
          diff -u src/app.js.orig src/app.js
          --- src/app.js.orig   2024-04-05 10:00:00
          +++ src/app.js        2024-04-05 10:05:00
          @@ -12,6 +12,10 @@
           app.use(express.json());
          +app.use((req, res, next) => {
          +  if (!req.body || typeof req.body !== 'object') {
          +    return res.status(400).json({ error: 'Invalid JSON' });
          +  }
          +  next();
          +});
           app.use('/api', apiRoutes);
          EOF

          git add .
          git commit -m "security: fix ${{ github.inputs.cve_id }}"
          git push origin HEAD

      - name: Create PR
        id: create-pr
        run: |
          gh pr create \
            --title "security: fix ${{ github.inputs.cve_id }}" \
            --body "Fixes ${{ github.inputs.cve_id }}. Closes #${{ github.event.pull_request.number }}" \
            --base ${{ github.inputs.target_branch }} \
            --label "security, patch"

      - name: Notify Slack
        uses: slackapi/[email protected]
        with:
          payload: |
            {
              "text": "Security patch submitted for ${{ github.inputs.cve_id }}",
              "attachments": [
                {
                  "title": "PR Created",
                  "title_link": "${{ steps.create-pr.outputs.pr_url }}",
                  "text": "Patch applied and PR created for ${{ github.inputs.cve_id }}."
                }
              ]
            }
        env:
          SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

A sharp edge: when a PR is merged, the security-remediation.yml workflow is triggered again, but only for the pull_request event. If the workflow_dispatch is used for initial triage, the PR creation step is skipped. Engineers discover this when a CVE is merged but no PR is created.

Verification and Closure

After a patch is deployed, verification ensures the CVE is truly resolved. The team uses a verify-cve.sh script that runs against production environments:

#!/bin/bash
set -euo pipefail

CVE_ID="${1:-CVE-2023-24581}"
ENV="${2:-production}"


DEPLOYMENT_ID=$(curl -s "http://deployments.example.com/v1/deployments?service=web&environment=$ENV&limit=1" | jq -r '.[0].id')

# Retrieve the service logs for that deployment
LOGS=$(curl -s "http://logs.example.com/v1/logs?service=web&deployment=$DEPLOYMENT_ID&since=1h")

# Check for CVE-specific log entries
if echo "$LOGS" | grep -q "$CVE_ID"; then
  echo "✅ CVE $CVE_ID verified in $ENV"
  # Update the vulnerability status
  curl -X PUT \
    -H "Content-Type: application/json" \
    -d '{"status": "verified", "verified_at": "'"$(date -Iseconds)"'"}' \
    "http://vulnerability-db.example.com/v1/vulnerabilities/$CVE_ID"
else
  echo "❌ CVE $CVE_ID not verified in $ENV"
  # Alert Slack
  curl -X POST \
    -H "Content-Type: application/json" \
    -d '{
      "text": "CVE Verification Failed",
      "blocks": [
        {
          "type": "section",
          "text": {
            "type": "mrkdwn",
            "text": "*CVE $CVE_ID failed verification in $ENV*\nCheck logs at <http://logs.example.com>"
          }
        }
      ]
    }' \
    "https://hooks.slack.com/services/abc123/def456/ghi789"
fi

Verification is triggered by a cron job that runs every 30 minutes, checking for new deployments and verifying all CVEs assigned to that service.

Once verified, the CVE is closed. A final audit step runs a monthly script that compares all open CVEs against a list of services and their current dependencies. If a dependency is upgraded and a CVE is no longer applicable, it is marked as “resolved” and archived.

A failure mode: a CVE is marked as “verified” but the associated PR is merged into the wrong branch. The verification script checks the logs from the main branch, but the deployment was from staging. This leads to false positives. The solution is to enrich the deployment metadata with branch, commit, and deployment_id, and to validate that the logs contain the correct commit hash.

Tracking and Reporting

The final component is a unified view of all CVEs across the organization. A cve-dashboard.html page uses a simple fetch call to retrieve the current state:

async function loadCveDashboard() {
  const res = await fetch('/api/v1/vulnerabilities?status=active');
  const data = await res.json();

  const table = document.getElementById('cve-table');
  table.innerHTML = '';

  data.forEach(vuln => {
    const row = document.createElement('tr');
    row.innerHTML = `
      <td><a href="/cve/${vuln.id}">${vuln.id}</a></td>
      <td>${vuln.title}</td>
      <td>${vuln.cvss_score}</td>
      <td>${vuln.assigned_to || '—'}</td>
      <td>${vuln.status}</td>
    `;
    table.appendChild(row);
  });
}

// Run on page load
loadCveDashboard();

This dashboard is used during weekly security meetings and incident reviews. It reveals trends: how long CVEs take to triage, which teams are most effective, and which services are most vulnerable.

The workflow is now complete: a CVE is discovered, prioritized, fixed, verified, and closed—each step recorded, monitored, and auditable. The system is resilient, but its success depends on consistent execution across all teams, and on engineers remembering to update the state of a CVE after a meeting, a deployment, or a review.

This page was rewritten on 12 October 2026. It replaced a templated version that was not specific to its own title. How these pages are written and checked. If anything here is wrong, tell us at [email protected] and we will correct it.