{
  "$defs": {
    "AuditCoverage": {
      "additionalProperties": false,
      "properties": {
        "finding_limit": {
          "default": 50,
          "title": "Finding Limit",
          "type": "integer"
        },
        "total_findings": {
          "title": "Total Findings",
          "type": "integer"
        },
        "returned_findings": {
          "title": "Returned Findings",
          "type": "integer"
        },
        "truncated": {
          "title": "Truncated",
          "type": "boolean"
        },
        "scope": {
          "default": "stored_findings_and_public_html_core",
          "title": "Scope",
          "type": "string"
        },
        "completeness_note": {
          "default": "Finding coverage is not a claim that the whole website was crawled.",
          "title": "Completeness Note",
          "type": "string"
        }
      },
      "required": [
        "total_findings",
        "returned_findings",
        "truncated"
      ],
      "title": "AuditCoverage",
      "type": "object"
    },
    "AuditFinding": {
      "additionalProperties": false,
      "properties": {
        "finding_id": {
          "maxLength": 160,
          "title": "Finding Id",
          "type": "string"
        },
        "finding_type": {
          "maxLength": 120,
          "title": "Finding Type",
          "type": "string"
        },
        "title": {
          "maxLength": 500,
          "title": "Title",
          "type": "string"
        },
        "severity": {
          "enum": [
            "critical",
            "high",
            "medium",
            "low",
            "info"
          ],
          "title": "Severity",
          "type": "string"
        },
        "confidence": {
          "default": "unknown",
          "enum": [
            "high",
            "medium",
            "low",
            "unknown"
          ],
          "title": "Confidence",
          "type": "string"
        },
        "evidence": {
          "$ref": "#/$defs/FindingEvidence"
        },
        "provenance": {
          "$ref": "#/$defs/FindingProvenance"
        },
        "remediation": {
          "$ref": "#/$defs/FindingRemediation"
        },
        "affected_urls": {
          "items": {
            "type": "string"
          },
          "maxItems": 20,
          "title": "Affected Urls",
          "type": "array"
        },
        "impact_basis": {
          "enum": [
            "estimate",
            "qualitative"
          ],
          "title": "Impact Basis",
          "type": "string"
        }
      },
      "required": [
        "finding_id",
        "finding_type",
        "title",
        "severity",
        "evidence",
        "provenance",
        "remediation",
        "impact_basis"
      ],
      "title": "AuditFinding",
      "type": "object"
    },
    "FindingEvidence": {
      "additionalProperties": false,
      "properties": {
        "status": {
          "default": "unavailable",
          "enum": [
            "available",
            "partial",
            "unavailable"
          ],
          "title": "Status",
          "type": "string"
        },
        "source": {
          "default": "unknown",
          "maxLength": 120,
          "title": "Source",
          "type": "string"
        },
        "observed": {
          "anyOf": [
            {
              "maxLength": 1000,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Observed"
        },
        "expected": {
          "anyOf": [
            {
              "maxLength": 1000,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Expected"
        },
        "coverage_note": {
          "anyOf": [
            {
              "maxLength": 500,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Coverage Note"
        }
      },
      "title": "FindingEvidence",
      "type": "object"
    },
    "FindingProvenance": {
      "additionalProperties": false,
      "properties": {
        "rule_id": {
          "anyOf": [
            {
              "maxLength": 120,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Rule Id"
        },
        "rule_version": {
          "anyOf": [
            {
              "maxLength": 32,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Rule Version"
        },
        "ruleset_id": {
          "anyOf": [
            {
              "maxLength": 120,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Ruleset Id"
        },
        "ruleset_version": {
          "anyOf": [
            {
              "maxLength": 32,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Ruleset Version"
        },
        "fact_ids": {
          "items": {
            "type": "string"
          },
          "maxItems": 8,
          "title": "Fact Ids",
          "type": "array"
        }
      },
      "title": "FindingProvenance",
      "type": "object"
    },
    "FindingRemediation": {
      "additionalProperties": false,
      "properties": {
        "summary": {
          "maxLength": 500,
          "title": "Summary",
          "type": "string"
        },
        "steps": {
          "items": {
            "type": "string"
          },
          "maxItems": 5,
          "title": "Steps",
          "type": "array"
        },
        "effort": {
          "default": "unknown",
          "enum": [
            "low",
            "medium",
            "high",
            "unknown"
          ],
          "title": "Effort",
          "type": "string"
        }
      },
      "required": [
        "summary"
      ],
      "title": "FindingRemediation",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "properties": {
    "schema_version": {
      "const": "scanthelink.audit.v1",
      "default": "scanthelink.audit.v1",
      "title": "Schema Version",
      "type": "string"
    },
    "scan_id": {
      "title": "Scan Id",
      "type": "string"
    },
    "target_url": {
      "title": "Target Url",
      "type": "string"
    },
    "scan_type": {
      "title": "Scan Type",
      "type": "string"
    },
    "scan_depth": {
      "title": "Scan Depth",
      "type": "string"
    },
    "status": {
      "title": "Status",
      "type": "string"
    },
    "observed_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Observed At"
    },
    "coverage": {
      "$ref": "#/$defs/AuditCoverage"
    },
    "findings": {
      "items": {
        "$ref": "#/$defs/AuditFinding"
      },
      "maxItems": 50,
      "title": "Findings",
      "type": "array"
    }
  },
  "required": [
    "scan_id",
    "target_url",
    "scan_type",
    "scan_depth",
    "status",
    "observed_at",
    "coverage"
  ],
  "title": "AuditReport",
  "type": "object",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://scanthelink.com/audit-result-schema.json"
}
