IpSecurityRestriction Class

IP security restriction on an app.

Inheritance
IpSecurityRestriction

Constructor

IpSecurityRestriction(*, ip_address: Optional[str] = None, subnet_mask: Optional[str] = None, vnet_subnet_resource_id: Optional[str] = None, vnet_traffic_tag: Optional[int] = None, subnet_traffic_tag: Optional[int] = None, action: Optional[str] = None, tag: Optional[Union[str, azure.mgmt.web.v2020_09_01.models._web_site_management_client_enums.IpFilterTag]] = None, priority: Optional[int] = None, name: Optional[str] = None, description: Optional[str] = None, headers: Optional[Dict[str, List[str]]] = None, **kwargs)

Parameters

ip_address
str
Required

IP address the security restriction is valid for. It can be in form of pure ipv4 address (required SubnetMask property) or CIDR notation such as ipv4/mask (leading bit match). For CIDR, SubnetMask property must not be specified.

subnet_mask
str
Required

Subnet mask for the range of IP addresses the restriction is valid for.

vnet_subnet_resource_id
str
Required

Virtual network resource id.

vnet_traffic_tag
int
Required

(internal) Vnet traffic tag.

subnet_traffic_tag
int
Required

(internal) Subnet traffic tag.

action
str
Required

Allow or Deny access for this IP range.

tag
str or IpFilterTag
Required

Defines what this IP filter will be used for. This is to support IP filtering on proxies. Possible values include: "Default", "XffProxy", "ServiceTag".

priority
int
Required

Priority of IP restriction rule.

name
str
Required

IP restriction rule name.

description
str
Required

IP restriction rule description.

headers
dict[str, list[str]]
Required

IP restriction rule headers. X-Forwarded-Host (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Host#Examples). The matching logic is ..

  • If the property is null or empty (default), all hosts(or lack of) are allowed.

  • A value is compared using ordinal-ignore-case (excluding port number).

  • Subdomain wildcards are permitted but don't match the root domain. For example,

*<<.contoso.com matches the subdomain foo.contoso.com but not the root domain contoso.com or multi-level foo.bar.contoso.com

  • Unicode host names are allowed but are converted to Punycode for matching.

X-Forwarded-For (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For#Examples). The matching logic is ..

  • If the property is null or empty (default), any forwarded-for chains (or lack of) are

allowed.

  • If any address (excluding port number) in the chain (comma separated) matches the CIDR defined by the property.

X-Azure-FDID and X-FD-HealthProbe. The matching logic is exact match.