{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-azure-sql-database/json-schema/microsoft-azure-sql-database-security-event-collection-schema.json",
  "title": "SecurityEventCollection",
  "description": "A list of security events.",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/microsoft-azure-sql-database-manageddatabasesecurityevents-api-openapi.yml#/components/schemas/SecurityEventCollection",
  "type": "object",
  "properties": {
    "value": {
      "type": "array",
      "description": "The SecurityEvent items on this page",
      "items": {
        "$ref": "#/$defs/SecurityEvent"
      }
    },
    "nextLink": {
      "type": "string",
      "format": "uri",
      "description": "The link to the next page of items"
    }
  },
  "required": [
    "value"
  ],
  "$defs": {
    "ProxyResource": {
      "type": "object",
      "title": "Proxy Resource",
      "description": "The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location",
      "allOf": [
        {
          "$ref": "#/$defs/Resource"
        }
      ]
    },
    "Resource": {
      "type": "object",
      "description": "Referenced by this document but never defined in it. API Evangelist added this empty placeholder so the document resolves; the shape is unknown and is NOT a claim about the API.",
      "x-ae-placeholder": true
    },
    "SecurityEvent": {
      "type": "object",
      "description": "A security event.",
      "properties": {
        "properties": {
          "$ref": "#/$defs/SecurityEventProperties",
          "description": "Resource properties.",
          "x-ms-client-flatten": true
        }
      },
      "allOf": [
        {
          "$ref": "#/$defs/ProxyResource"
        }
      ]
    },
    "SecurityEventProperties": {
      "type": "object",
      "description": "The properties of a security event.",
      "properties": {
        "eventTime": {
          "type": "string",
          "format": "date-time",
          "description": "The time when the security event occurred.",
          "readOnly": true
        },
        "securityEventType": {
          "$ref": "#/$defs/SecurityEventType",
          "description": "The type of the security event.",
          "readOnly": true
        },
        "subscription": {
          "type": "string",
          "description": "The subscription name",
          "readOnly": true
        },
        "server": {
          "type": "string",
          "description": "The server name",
          "readOnly": true
        },
        "database": {
          "type": "string",
          "description": "The database name",
          "readOnly": true
        },
        "clientIp": {
          "type": "string",
          "description": "The IP address of the client who executed the statement.",
          "readOnly": true
        },
        "applicationName": {
          "type": "string",
          "description": "The application used to execute the statement.",
          "readOnly": true
        },
        "principalName": {
          "type": "string",
          "description": "The principal user who executed the statement",
          "readOnly": true
        },
        "securityEventSqlInjectionAdditionalProperties": {
          "$ref": "#/$defs/SecurityEventSqlInjectionAdditionalProperties",
          "description": "The sql injection additional properties, populated only if the type of the security event is sql injection.",
          "readOnly": true
        }
      }
    },
    "SecurityEventSqlInjectionAdditionalProperties": {
      "type": "object",
      "description": "The properties of a security event sql injection additional properties.",
      "properties": {
        "threatId": {
          "type": "string",
          "description": "The threat ID.",
          "readOnly": true
        },
        "statement": {
          "type": "string",
          "description": "The statement",
          "readOnly": true
        },
        "statementHighlightOffset": {
          "type": "integer",
          "format": "int32",
          "description": "The statement highlight offset",
          "readOnly": true
        },
        "statementHighlightLength": {
          "type": "integer",
          "format": "int32",
          "description": "The statement highlight length",
          "readOnly": true
        },
        "errorCode": {
          "type": "integer",
          "format": "int32",
          "description": "The sql error code",
          "readOnly": true
        },
        "errorSeverity": {
          "type": "integer",
          "format": "int32",
          "description": "The sql error severity",
          "readOnly": true
        },
        "errorMessage": {
          "type": "string",
          "description": "The sql error message",
          "readOnly": true
        }
      }
    },
    "SecurityEventType": {
      "type": "string",
      "description": "The type of the security event.",
      "enum": [
        "Undefined",
        "SqlInjectionVulnerability",
        "SqlInjectionExploit"
      ],
      "x-ms-enum": {
        "name": "SecurityEventType",
        "modelAsString": false,
        "values": [
          {
            "name": "Undefined",
            "value": "Undefined",
            "description": "Undefined"
          },
          {
            "name": "SqlInjectionVulnerability",
            "value": "SqlInjectionVulnerability",
            "description": "SqlInjectionVulnerability"
          },
          {
            "name": "SqlInjectionExploit",
            "value": "SqlInjectionExploit",
            "description": "SqlInjectionExploit"
          }
        ]
      }
    }
  }
}