{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/nessflow-com/json-schema/nessflow-com-security-schema.json",
  "title": "Security",
  "x-generated": "2026-11-19",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/nessflow-com-openapi.json#/components/schemas/Security",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "project_id",
    "status",
    "target",
    "scan",
    "score",
    "counts",
    "findings"
  ],
  "properties": {
    "project_id": {
      "type": "string",
      "format": "uuid"
    },
    "status": {
      "type": "string",
      "description": "`active`, or the reason the analysis cannot run (missing or revoked authorisation, refused target…)."
    },
    "target": {
      "type": [
        "string",
        "null"
      ]
    },
    "scan": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": false,
      "required": [
        "status",
        "running",
        "complete",
        "results_truncated",
        "started_at",
        "finished_at"
      ],
      "properties": {
        "status": {
          "type": "string"
        },
        "running": {
          "type": "boolean"
        },
        "complete": {
          "type": "boolean"
        },
        "results_truncated": {
          "type": "boolean"
        },
        "started_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "finished_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      }
    },
    "score": {
      "type": [
        "integer",
        "null"
      ]
    },
    "counts": {
      "description": "Finding counts of the latest scan; `null` when no scan has ever run (unknown, never zero).",
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": false,
      "required": [
        "problems",
        "informational",
        "fixed",
        "masked",
        "ignored",
        "falsePositive"
      ],
      "properties": {
        "problems": {
          "type": "integer"
        },
        "informational": {
          "type": "integer"
        },
        "fixed": {
          "type": "integer"
        },
        "masked": {
          "type": "integer"
        },
        "ignored": {
          "type": "integer"
        },
        "falsePositive": {
          "type": "integer"
        }
      }
    },
    "findings": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "key",
          "severity",
          "status",
          "location",
          "title",
          "explanation",
          "action",
          "first_seen_at",
          "last_seen_at",
          "fixed_at"
        ],
        "properties": {
          "key": {
            "type": "string"
          },
          "severity": {
            "type": "string",
            "enum": [
              "critical",
              "high",
              "medium",
              "low",
              "informational"
            ]
          },
          "status": {
            "type": "string"
          },
          "location": {
            "type": [
              "string",
              "null"
            ]
          },
          "title": {
            "type": [
              "string",
              "null"
            ]
          },
          "explanation": {
            "type": [
              "string",
              "null"
            ]
          },
          "action": {
            "type": [
              "string",
              "null"
            ]
          },
          "first_seen_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "last_seen_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "fixed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      }
    }
  }
}