{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://github.com/api-evangelist/ubuntu/blob/main/json-schema/ubuntu-cve-schema.json",
  "title": "Ubuntu CVE",
  "description": "Schema for a CVE entry in the Ubuntu security database.",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^CVE-\\d{4}-\\d{4,}$",
      "description": "CVE identifier (e.g., CVE-2024-1234)."
    },
    "published": {
      "type": "string",
      "format": "date-time",
      "description": "Date the CVE was published."
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "description": "Date the CVE was last updated."
    },
    "description": {
      "type": "string",
      "description": "Official CVE description."
    },
    "ubuntu_description": {
      "type": "string",
      "description": "Ubuntu-specific vulnerability description."
    },
    "priority": {
      "type": "string",
      "enum": ["critical", "high", "medium", "low", "negligible"],
      "description": "Ubuntu priority level."
    },
    "cvss3": {
      "type": "number",
      "minimum": 0,
      "maximum": 10,
      "description": "CVSS v3 score."
    },
    "status": {
      "type": "string",
      "description": "Current fix status."
    },
    "mitigation": {
      "type": "string",
      "description": "Available mitigation steps."
    },
    "references": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uri"
      },
      "description": "External references."
    },
    "packages": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": { "type": "string" },
          "source": { "type": "string" },
          "statuses": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "release_codename": { "type": "string" },
                "status": { "type": "string" },
                "description": { "type": "string" }
              }
            }
          }
        }
      },
      "description": "Affected packages and their fix status per release."
    }
  }
}
