{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/azure-networking-services/json-schema/azure-networking-services-firewall-policy-schema.json",
  "title": "FirewallPolicy",
  "description": "FirewallPolicy Resource.",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/azure-networking-services-firewallpolicies-api-openapi.yml#/components/schemas/FirewallPolicy",
  "type": "object",
  "properties": {
    "properties": {
      "$ref": "#/$defs/FirewallPolicyPropertiesFormat",
      "description": "Properties of the firewall policy.",
      "x-ms-client-flatten": true
    },
    "etag": {
      "type": "string",
      "description": "A unique read-only string that changes whenever the resource is updated.",
      "readOnly": true
    },
    "identity": {
      "$ref": "#/$defs/ManagedServiceIdentity",
      "description": "The identity of the firewall policy."
    }
  },
  "allOf": [
    {
      "$ref": "#/$defs/Resource"
    }
  ],
  "$defs": {
    "AutoLearnPrivateRangesMode": {
      "type": "string",
      "description": "The operation mode for automatically learning private ranges to not be SNAT",
      "enum": [
        "Enabled",
        "Disabled"
      ],
      "x-ms-enum": {
        "name": "AutoLearnPrivateRangesMode",
        "modelAsString": true,
        "values": [
          {
            "name": "Enabled",
            "value": "Enabled",
            "description": "Enabled"
          },
          {
            "name": "Disabled",
            "value": "Disabled",
            "description": "Disabled"
          }
        ]
      }
    },
    "AzureFirewallThreatIntelMode": {
      "type": "string",
      "description": "The operation mode for Threat Intel.",
      "enum": [
        "Alert",
        "Deny",
        "Off"
      ],
      "x-ms-enum": {
        "name": "AzureFirewallThreatIntelMode",
        "modelAsString": true,
        "values": [
          {
            "name": "Alert",
            "value": "Alert",
            "description": "Alert"
          },
          {
            "name": "Deny",
            "value": "Deny",
            "description": "Deny"
          },
          {
            "name": "Off",
            "value": "Off",
            "description": "Off"
          }
        ]
      }
    },
    "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."
        }
      }
    },
    "FirewallPolicyCertificateAuthority": {
      "type": "object",
      "description": "Trusted Root certificates properties for tls.",
      "properties": {
        "keyVaultSecretId": {
          "type": "string",
          "description": "Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or 'Certificate' object stored in KeyVault."
        },
        "name": {
          "type": "string",
          "description": "Name of the CA certificate."
        }
      }
    },
    "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": "#/$defs/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": "#/$defs/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": "#/$defs/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"
          }
        }
      }
    },
    "FirewallPolicyIntrusionDetectionProfileType": {
      "type": "string",
      "description": "Specifies the Intrusion Detection signature profile to apply.\n\nValues:\n- Off: IDPS profiles disabled; uses the same signature set that existed before profiles.\n- Emerging: Signatures of the newest, most recent threats.\n- Core: Complete, modern, standard set of signatures.\n- Extended: Core signatures plus older legacy signatures for maximum coverage.",
      "enum": [
        "Off",
        "Emerging",
        "Core",
        "Extended"
      ],
      "x-ms-enum": {
        "name": "FirewallPolicyIntrusionDetectionProfileType",
        "modelAsString": true,
        "values": [
          {
            "name": "Off",
            "value": "Off",
            "description": "Off"
          },
          {
            "name": "Emerging",
            "value": "Emerging",
            "description": "Emerging"
          },
          {
            "name": "Core",
            "value": "Core",
            "description": "Core"
          },
          {
            "name": "Extended",
            "value": "Extended",
            "description": "Extended"
          }
        ]
      }
    },
    "FirewallPolicyIntrusionDetectionProtocol": {
      "type": "string",
      "description": "Possible intrusion detection bypass traffic protocols.",
      "enum": [
        "TCP",
        "UDP",
        "ICMP",
        "ANY"
      ],
      "x-ms-enum": {
        "name": "FirewallPolicyIntrusionDetectionProtocol",
        "modelAsString": true,
        "values": [
          {
            "name": "TCP",
            "value": "TCP",
            "description": "TCP"
          },
          {
            "name": "UDP",
            "value": "UDP",
            "description": "UDP"
          },
          {
            "name": "ICMP",
            "value": "ICMP",
            "description": "ICMP"
          },
          {
            "name": "ANY",
            "value": "ANY",
            "description": "ANY"
          }
        ]
      }
    },
    "FirewallPolicyIntrusionDetectionSignatureSpecification": {
      "type": "object",
      "description": "Intrusion detection signatures specification states.",
      "properties": {
        "id": {
          "type": "string",
          "description": "Signature id."
        },
        "mode": {
          "$ref": "#/$defs/FirewallPolicyIntrusionDetectionStateType",
          "description": "The signature state."
        }
      }
    },
    "FirewallPolicyIntrusionDetectionStateType": {
      "type": "string",
      "description": "Possible state values.",
      "enum": [
        "Off",
        "Alert",
        "Deny"
      ],
      "x-ms-enum": {
        "name": "FirewallPolicyIntrusionDetectionStateType",
        "modelAsString": true,
        "values": [
          {
            "name": "Off",
            "value": "Off",
            "description": "Off"
          },
          {
            "name": "Alert",
            "value": "Alert",
            "description": "Alert"
          },
          {
            "name": "Deny",
            "value": "Deny",
            "description": "Deny"
          }
        ]
      }
    },
    "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": "#/$defs/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": "#/$defs/SubResource",
          "description": "The workspace Id for Firewall Policy Insights."
        }
      }
    },
    "FirewallPolicyPropertiesFormat": {
      "type": "object",
      "description": "Firewall Policy definition.",
      "properties": {
        "size": {
          "type": "string",
          "description": "A read-only string that represents the size of the FirewallPolicyPropertiesFormat in MB. (ex 0.5MB)",
          "readOnly": true
        },
        "ruleCollectionGroups": {
          "type": "array",
          "description": "List of references to FirewallPolicyRuleCollectionGroups.",
          "items": {
            "$ref": "#/$defs/SubResource"
          },
          "readOnly": true
        },
        "kubeSelectorGroups": {
          "type": "array",
          "description": "List of references to FirewallPolicyKubeSelectorGroups.",
          "items": {
            "$ref": "#/$defs/SubResource"
          },
          "readOnly": true
        },
        "provisioningState": {
          "$ref": "#/$defs/ProvisioningState",
          "description": "The provisioning state of the firewall policy resource.",
          "readOnly": true
        },
        "basePolicy": {
          "$ref": "#/$defs/SubResource",
          "description": "The parent firewall policy from which rules are inherited."
        },
        "firewalls": {
          "type": "array",
          "description": "List of references to Azure Firewalls that this Firewall Policy is associated with.",
          "items": {
            "$ref": "#/$defs/SubResource"
          },
          "readOnly": true
        },
        "childPolicies": {
          "type": "array",
          "description": "List of references to Child Firewall Policies.",
          "items": {
            "$ref": "#/$defs/SubResource"
          },
          "readOnly": true
        },
        "threatIntelMode": {
          "$ref": "#/$defs/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."
        },
        "transportSecurity": {
          "$ref": "#/$defs/FirewallPolicyTransportSecurity",
          "description": "TLS Configuration definition."
        },
        "sku": {
          "$ref": "#/$defs/FirewallPolicySku",
          "description": "The Firewall Policy SKU."
        },
        "afcManaged": {
          "type": "boolean",
          "description": "Indicates that the Firewall Policy is managed by AFC (Azure Firewall for Containers). When set, the policy is treated as read-only for callers that do not supply the AFC-managed sync marker on write operations.",
          "readOnly": true
        }
      }
    },
    "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": "#/$defs/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."
        }
      }
    },
    "FirewallPolicySku": {
      "type": "object",
      "description": "SKU of Firewall policy.",
      "properties": {
        "tier": {
          "$ref": "#/$defs/FirewallPolicySkuTier",
          "description": "Tier of Firewall Policy."
        }
      }
    },
    "FirewallPolicySkuTier": {
      "type": "string",
      "description": "Tier of Firewall Policy.",
      "enum": [
        "Standard",
        "Premium",
        "Basic"
      ],
      "x-ms-enum": {
        "name": "FirewallPolicySkuTier",
        "modelAsString": true,
        "values": [
          {
            "name": "Standard",
            "value": "Standard",
            "description": "Standard"
          },
          {
            "name": "Premium",
            "value": "Premium",
            "description": "Premium"
          },
          {
            "name": "Basic",
            "value": "Basic",
            "description": "Basic"
          }
        ]
      }
    },
    "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"
          }
        }
      }
    },
    "FirewallPolicyTransportSecurity": {
      "type": "object",
      "description": "Configuration needed to perform TLS termination & initiation.",
      "properties": {
        "certificateAuthority": {
          "$ref": "#/$defs/FirewallPolicyCertificateAuthority",
          "description": "The CA used for intermediate CA generation."
        }
      }
    },
    "ManagedServiceIdentity": {
      "type": "object",
      "description": "Identity for the resource.",
      "properties": {
        "principalId": {
          "type": "string",
          "description": "The principal id of the system assigned identity. This property will only be provided for a system assigned identity.",
          "readOnly": true
        },
        "tenantId": {
          "type": "string",
          "description": "The tenant id of the system assigned identity. This property will only be provided for a system assigned identity.",
          "readOnly": true
        },
        "type": {
          "$ref": "#/$defs/ResourceIdentityType",
          "description": "The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the virtual machine."
        },
        "userAssignedIdentities": {
          "type": "object",
          "description": "The list of user identities associated with resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.",
          "additionalProperties": {
            "$ref": "#/$defs/ManagedServiceIdentityUserAssignedIdentities"
          }
        }
      }
    },
    "ManagedServiceIdentityUserAssignedIdentities": {
      "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
    },
    "ProvisioningState": {
      "type": "string",
      "description": "Provisioning states of a resource.",
      "enum": [
        "Failed",
        "Succeeded",
        "Canceled",
        "Creating",
        "Updating",
        "Deleting"
      ],
      "x-ms-enum": {
        "name": "ProvisioningState",
        "modelAsString": true,
        "values": [
          {
            "name": "Failed",
            "value": "Failed",
            "description": "Failed"
          },
          {
            "name": "Succeeded",
            "value": "Succeeded",
            "description": "Succeeded"
          },
          {
            "name": "Canceled",
            "value": "Canceled",
            "description": "Canceled"
          },
          {
            "name": "Creating",
            "value": "Creating",
            "description": "Creating"
          },
          {
            "name": "Updating",
            "value": "Updating",
            "description": "Updating"
          },
          {
            "name": "Deleting",
            "value": "Deleting",
            "description": "Deleting"
          }
        ]
      }
    },
    "Resource": {
      "type": "object",
      "description": "Common resource representation.",
      "properties": {
        "id": {
          "type": "string",
          "description": "Resource ID."
        },
        "name": {
          "type": "string",
          "description": "Resource name.",
          "readOnly": true
        },
        "type": {
          "type": "string",
          "description": "Resource type.",
          "readOnly": true
        },
        "location": {
          "type": "string",
          "description": "Resource location."
        },
        "tags": {
          "type": "object",
          "description": "Resource tags.",
          "additionalProperties": {
            "type": "string"
          }
        }
      },
      "x-ms-azure-resource": true
    },
    "ResourceIdentityType": {
      "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
    },
    "SubResource": {
      "type": "object",
      "description": "Reference to another subresource.",
      "properties": {
        "id": {
          "type": "string",
          "description": "Resource ID."
        }
      }
    }
  }
}