{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Policy",
  "description": "Policy schema from Palo Alto Networks Prisma Cloud CSPM API",
  "$id": "https://raw.githubusercontent.com/api-evangelist/palo-alto-networks/refs/heads/main/json-schema/prisma-cloud-cspm-api-policy-schema.json",
  "type": "object",
  "properties": {
    "policyId": {
      "type": "string",
      "description": "Unique policy identifier."
    },
    "name": {
      "type": "string",
      "description": "Policy name."
    },
    "policyType": {
      "type": "string",
      "enum": [
        "config",
        "network",
        "audit_event",
        "anomaly",
        "data",
        "iam"
      ],
      "description": "Type of policy check."
    },
    "severity": {
      "type": "string",
      "enum": [
        "critical",
        "high",
        "medium",
        "low",
        "informational"
      ],
      "description": "Policy severity level."
    },
    "description": {
      "type": "string",
      "description": "Policy description."
    },
    "recommendation": {
      "type": "string",
      "description": "Recommended remediation for policy violations."
    },
    "cloudType": {
      "type": "string",
      "description": "Cloud provider the policy applies to."
    },
    "enabled": {
      "type": "boolean",
      "description": "Whether the policy is active."
    },
    "systemDefault": {
      "type": "boolean",
      "description": "Whether this is a built-in policy."
    },
    "rule": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "criteria": {
          "type": "string",
          "description": "RQL query string."
        },
        "type": {
          "type": "string"
        }
      }
    },
    "complianceMetadata": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "standardName": {
            "type": "string"
          },
          "requirementId": {
            "type": "string"
          },
          "requirementName": {
            "type": "string"
          },
          "sectionId": {
            "type": "string"
          }
        }
      }
    }
  }
}
