219 lines
4.6 KiB
JSON
219 lines
4.6 KiB
JSON
{
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
"$id": "https://stellaops.io/schemas/golden-pair-v1.schema.json",
|
|
"title": "GoldenPairMetadata",
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"cve",
|
|
"name",
|
|
"severity",
|
|
"artifact",
|
|
"original",
|
|
"patched",
|
|
"patch",
|
|
"expectedDiff",
|
|
"createdAt",
|
|
"createdBy"
|
|
],
|
|
"properties": {
|
|
"cve": {
|
|
"type": "string",
|
|
"pattern": "^CVE-\\d{4}-\\d{4,}$"
|
|
},
|
|
"name": {
|
|
"type": "string",
|
|
"minLength": 1
|
|
},
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"severity": {
|
|
"type": "string",
|
|
"enum": ["critical", "high", "medium", "low"]
|
|
},
|
|
"artifact": {
|
|
"$ref": "#/$defs/artifactInfo"
|
|
},
|
|
"original": {
|
|
"$ref": "#/$defs/binaryArtifact"
|
|
},
|
|
"patched": {
|
|
"$ref": "#/$defs/binaryArtifact"
|
|
},
|
|
"patch": {
|
|
"$ref": "#/$defs/patchInfo"
|
|
},
|
|
"advisories": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/$defs/advisoryRef"
|
|
},
|
|
"default": []
|
|
},
|
|
"expectedDiff": {
|
|
"$ref": "#/$defs/expectedDiff"
|
|
},
|
|
"createdAt": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"createdBy": {
|
|
"type": "string",
|
|
"minLength": 1
|
|
}
|
|
},
|
|
"$defs": {
|
|
"artifactInfo": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["name", "format", "architecture"],
|
|
"properties": {
|
|
"name": {
|
|
"type": "string",
|
|
"minLength": 1
|
|
},
|
|
"format": {
|
|
"type": "string",
|
|
"enum": ["elf", "pe", "macho"]
|
|
},
|
|
"architecture": {
|
|
"type": "string",
|
|
"minLength": 1
|
|
},
|
|
"os": {
|
|
"type": "string",
|
|
"minLength": 1
|
|
}
|
|
}
|
|
},
|
|
"binaryArtifact": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["package", "version", "distro", "source", "sha256"],
|
|
"properties": {
|
|
"package": {
|
|
"type": "string",
|
|
"minLength": 1
|
|
},
|
|
"version": {
|
|
"type": "string",
|
|
"minLength": 1
|
|
},
|
|
"distro": {
|
|
"type": "string",
|
|
"minLength": 1
|
|
},
|
|
"source": {
|
|
"type": "string",
|
|
"minLength": 1
|
|
},
|
|
"sha256": {
|
|
"type": "string",
|
|
"pattern": "^[a-f0-9]{64}$"
|
|
},
|
|
"buildId": {
|
|
"type": "string",
|
|
"minLength": 1
|
|
},
|
|
"hasDebugSymbols": {
|
|
"type": "boolean"
|
|
},
|
|
"debugSymbolsSource": {
|
|
"type": "string",
|
|
"minLength": 1
|
|
},
|
|
"pathInPackage": {
|
|
"type": "string",
|
|
"minLength": 1
|
|
}
|
|
}
|
|
},
|
|
"patchInfo": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["commit"],
|
|
"properties": {
|
|
"commit": {
|
|
"type": "string",
|
|
"minLength": 6
|
|
},
|
|
"upstream": {
|
|
"type": "string",
|
|
"minLength": 1
|
|
},
|
|
"functionsChanged": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string",
|
|
"minLength": 1
|
|
},
|
|
"default": []
|
|
},
|
|
"filesChanged": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string",
|
|
"minLength": 1
|
|
},
|
|
"default": []
|
|
},
|
|
"summary": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"advisoryRef": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["source", "id", "url"],
|
|
"properties": {
|
|
"source": {
|
|
"type": "string",
|
|
"minLength": 1
|
|
},
|
|
"id": {
|
|
"type": "string",
|
|
"minLength": 1
|
|
},
|
|
"url": {
|
|
"type": "string",
|
|
"minLength": 1
|
|
}
|
|
}
|
|
},
|
|
"expectedDiff": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["verdict"],
|
|
"properties": {
|
|
"sectionsChanged": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string",
|
|
"minLength": 1
|
|
},
|
|
"default": []
|
|
},
|
|
"sectionsIdentical": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string",
|
|
"minLength": 1
|
|
},
|
|
"default": []
|
|
},
|
|
"verdict": {
|
|
"type": "string",
|
|
"enum": ["patched", "vanilla", "unknown"]
|
|
},
|
|
"confidenceMin": {
|
|
"type": "number",
|
|
"minimum": 0,
|
|
"maximum": 1
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|