{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-azure-firewall/json-schema/microsoft-azure-firewall-firewall-policy-draft-schema.json",
  "title": "FirewallPolicyDraft",
  "description": "FirewallPolicy Resource.",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_superseded/microsoft-azure-firewall-subscriptions-api-openapi.yml#/components/schemas/FirewallPolicyDraft",
  "type": "object",
  "properties": {
    "properties": {
      "$ref": "#/$defs/FirewallPolicyDraftProperties",
      "description": "Properties of the firewall policy.",
      "x-ms-client-flatten": true
    }
  },
  "allOf": [
    {
      "$ref": "./common.json#/definitions/Resource"
    }
  ],
  "$defs": {
    "DnsSettings": {
      "type": "object",
      "description": "DNS Proxy Settings in Firewall Policy.",
      "properties": {
        "servers": {
          "type": "array",
          "description": "List of Custom DNS Servers.",
          "items": {
            "type": "string"
          }
        },
        "enableProxy": {
          "type": "boolean",
          "description": "Enable DNS Proxy on Firewalls attached to the Firewall Policy."
        },
        "requireProxyForNetworkRules": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "FQDNs in Network Rules are supported when set to true."
        }
      }
    },
    "ExplicitProxy": {
      "type": "object",
      "description": "Explicit Proxy Settings in Firewall Policy.",
      "properties": {
        "enableExplicitProxy": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "When set to true, explicit proxy mode is enabled."
        },
        "httpPort": {
          "type": "integer",
          "format": "int32",
          "description": "Port number for explicit proxy http protocol, cannot be greater than 64000.",
          "minimum": 0,
          "maximum": 64000
        },
        "httpsPort": {
          "type": "integer",
          "format": "int32",
          "description": "Port number for explicit proxy https protocol, cannot be greater than 64000.",
          "minimum": 0,
          "maximum": 64000
        },
        "enablePacFile": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "When set to true, pac file port and url needs to be provided."
        },
        "pacFilePort": {
          "type": "integer",
          "format": "int32",
          "description": "Port number for firewall to serve PAC file.",
          "minimum": 0,
          "maximum": 64000
        },
        "pacFile": {
          "type": "string",
          "description": "SAS URL for PAC file."
        }
      }
    },
    "FirewallPolicyDraftProperties": {
      "type": "object",
      "properties": {
        "basePolicy": {
          "$ref": "./common.json#/definitions/SubResource",
          "description": "The parent firewall policy from which rules are inherited."
        },
        "threatIntelMode": {
          "$ref": "./common.json#/definitions/AzureFirewallThreatIntelMode",
          "description": "The operation mode for Threat Intelligence."
        },
        "threatIntelWhitelist": {
          "$ref": "#/$defs/FirewallPolicyThreatIntelWhitelist",
          "description": "ThreatIntel Whitelist for Firewall Policy."
        },
        "insights": {
          "$ref": "#/$defs/FirewallPolicyInsights",
          "description": "Insights on Firewall Policy."
        },
        "snat": {
          "$ref": "#/$defs/FirewallPolicySNAT",
          "description": "The private IP addresses/IP ranges to which traffic will not be SNAT."
        },
        "sql": {
          "$ref": "#/$defs/FirewallPolicySQL",
          "description": "SQL Settings definition."
        },
        "dnsSettings": {
          "$ref": "#/$defs/DnsSettings",
          "description": "DNS Proxy Settings definition."
        },
        "explicitProxy": {
          "$ref": "#/$defs/ExplicitProxy",
          "description": "Explicit Proxy Settings definition."
        },
        "intrusionDetection": {
          "$ref": "#/$defs/FirewallPolicyIntrusionDetection",
          "description": "The configuration for Intrusion detection."
        }
      }
    },
    "FirewallPolicyInsights": {
      "type": "object",
      "description": "Firewall Policy Insights.",
      "properties": {
        "isEnabled": {
          "type": "boolean",
          "description": "A flag to indicate if the insights are enabled on the policy."
        },
        "retentionDays": {
          "type": "integer",
          "format": "int32",
          "description": "Number of days the insights should be enabled on the policy."
        },
        "logAnalyticsResources": {
          "$ref": "#/$defs/FirewallPolicyLogAnalyticsResources",
          "description": "Workspaces needed to configure the Firewall Policy Insights."
        }
      }
    },
    "FirewallPolicyIntrusionDetection": {
      "type": "object",
      "description": "Configuration for intrusion detection mode and rules.",
      "properties": {
        "mode": {
          "$ref": "./common.json#/definitions/FirewallPolicyIntrusionDetectionStateType",
          "description": "Intrusion detection general state. When attached to a parent policy, the firewall's effective IDPS mode is the stricter mode of the two."
        },
        "profile": {
          "$ref": "./common.json#/definitions/FirewallPolicyIntrusionDetectionProfileType",
          "description": "IDPS profile name. When attached to a parent policy, the firewall's effective profile is the profile name of the parent policy."
        },
        "configuration": {
          "$ref": "#/$defs/FirewallPolicyIntrusionDetectionConfiguration",
          "description": "Intrusion detection configuration properties."
        }
      }
    },
    "FirewallPolicyIntrusionDetectionBypassTrafficSpecifications": {
      "type": "object",
      "description": "Intrusion detection bypass traffic specification.",
      "properties": {
        "name": {
          "type": "string",
          "description": "Name of the bypass traffic rule."
        },
        "description": {
          "type": "string",
          "description": "Description of the bypass traffic rule."
        },
        "protocol": {
          "$ref": "./common.json#/definitions/FirewallPolicyIntrusionDetectionProtocol",
          "description": "The rule bypass protocol."
        },
        "sourceAddresses": {
          "type": "array",
          "description": "List of source IP addresses or ranges for this rule.",
          "items": {
            "type": "string"
          }
        },
        "destinationAddresses": {
          "type": "array",
          "description": "List of destination IP addresses or ranges for this rule.",
          "items": {
            "type": "string"
          }
        },
        "destinationPorts": {
          "type": "array",
          "description": "List of destination ports or ranges.",
          "items": {
            "type": "string"
          }
        },
        "sourceIpGroups": {
          "type": "array",
          "description": "List of source IpGroups for this rule.",
          "items": {
            "type": "string"
          }
        },
        "destinationIpGroups": {
          "type": "array",
          "description": "List of destination IpGroups for this rule.",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "FirewallPolicyIntrusionDetectionConfiguration": {
      "type": "object",
      "description": "The operation for configuring intrusion detection.",
      "properties": {
        "signatureOverrides": {
          "type": "array",
          "description": "List of specific signatures states.",
          "items": {
            "$ref": "#/$defs/FirewallPolicyIntrusionDetectionSignatureSpecification"
          }
        },
        "bypassTrafficSettings": {
          "type": "array",
          "description": "List of rules for traffic to bypass.",
          "items": {
            "$ref": "#/$defs/FirewallPolicyIntrusionDetectionBypassTrafficSpecifications"
          },
          "x-ms-identifiers": []
        },
        "privateRanges": {
          "type": "array",
          "description": "IDPS Private IP address ranges are used to identify traffic direction (i.e. inbound, outbound, etc.). By default, only ranges defined by IANA RFC 1918 are considered private IP addresses. To modify default ranges, specify your Private IP address ranges with this property",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "FirewallPolicyIntrusionDetectionSignatureSpecification": {
      "type": "object",
      "description": "Intrusion detection signatures specification states.",
      "properties": {
        "id": {
          "type": "string",
          "description": "Signature id."
        },
        "mode": {
          "$ref": "./common.json#/definitions/FirewallPolicyIntrusionDetectionStateType",
          "description": "The signature state."
        }
      }
    },
    "FirewallPolicyLogAnalyticsResources": {
      "type": "object",
      "description": "Log Analytics Resources for Firewall Policy Insights.",
      "properties": {
        "workspaces": {
          "type": "array",
          "description": "List of workspaces for Firewall Policy Insights.",
          "items": {
            "$ref": "#/$defs/FirewallPolicyLogAnalyticsWorkspace"
          },
          "x-ms-identifiers": []
        },
        "defaultWorkspaceId": {
          "$ref": "./common.json#/definitions/SubResource",
          "description": "The default workspace Id for Firewall Policy Insights."
        }
      }
    },
    "FirewallPolicyLogAnalyticsWorkspace": {
      "type": "object",
      "description": "Log Analytics Workspace for Firewall Policy Insights.",
      "properties": {
        "region": {
          "type": "string",
          "description": "Region to configure the Workspace."
        },
        "workspaceId": {
          "$ref": "./common.json#/definitions/SubResource",
          "description": "The workspace Id for Firewall Policy Insights."
        }
      }
    },
    "FirewallPolicySNAT": {
      "type": "object",
      "description": "The private IP addresses/IP ranges to which traffic will not be SNAT.",
      "properties": {
        "privateRanges": {
          "type": "array",
          "description": "List of private IP addresses/IP address ranges to not be SNAT.",
          "items": {
            "type": "string"
          }
        },
        "autoLearnPrivateRanges": {
          "$ref": "./common.json#/definitions/AutoLearnPrivateRangesMode",
          "description": "The operation mode for automatically learning private ranges to not be SNAT"
        }
      }
    },
    "FirewallPolicySQL": {
      "type": "object",
      "description": "SQL Settings in Firewall Policy.",
      "properties": {
        "allowSqlRedirect": {
          "type": "boolean",
          "description": "A flag to indicate if SQL Redirect traffic filtering is enabled. Turning on the flag requires no rule using port 11000-11999."
        }
      }
    },
    "FirewallPolicyThreatIntelWhitelist": {
      "type": "object",
      "description": "ThreatIntel Whitelist for Firewall Policy.",
      "properties": {
        "ipAddresses": {
          "type": "array",
          "description": "List of IP addresses for the ThreatIntel Whitelist.",
          "items": {
            "type": "string"
          }
        },
        "fqdns": {
          "type": "array",
          "description": "List of FQDNs for the ThreatIntel Whitelist.",
          "items": {
            "type": "string"
          }
        }
      }
    }
  }
}