Default Security Rules - Get
Get the specified default network security rule.
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules/{defaultSecurityRuleName}?api-version=2024-03-01
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
default
|
path | True |
string |
The name of the default security rule. |
network
|
path | True |
string |
The name of the network security group. |
resource
|
path | True |
string |
The name of the resource group. |
subscription
|
path | True |
string |
The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. |
api-version
|
query | True |
string |
Client API version. |
Responses
Name | Type | Description |
---|---|---|
200 OK |
Request successful. The operation returns the resulting SecurityRule resource. |
|
Other Status Codes |
Error response describing why the operation failed. |
Security
azure_auth
Azure Active Directory OAuth2 Flow.
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name | Description |
---|---|
user_impersonation | impersonate your user account |
Examples
DefaultSecurityRuleGet
Sample request
Sample response
{
"name": "AllowVnetInBound",
"id": "/subscriptions/subid/resourceGroups/testrg/providers/Microsoft.Network/networkSecurityGroups/nsg1/defaultSecurityRules/AllowVnetInBound",
"properties": {
"provisioningState": "Succeeded",
"description": "Allow inbound traffic from all VMs in VNET",
"protocol": "*",
"sourcePortRange": "*",
"destinationPortRange": "*",
"sourceAddressPrefix": "VirtualNetwork",
"destinationAddressPrefix": "VirtualNetwork",
"access": "Allow",
"priority": 65000,
"direction": "Inbound",
"sourcePortRanges": [],
"destinationPortRanges": [],
"sourceAddressPrefixes": [],
"destinationAddressPrefixes": []
}
}
Definitions
Name | Description |
---|---|
Application |
An application security group in a resource group. |
Cloud |
An error response from the service. |
Cloud |
An error response from the service. |
Provisioning |
The current provisioning state. |
Security |
Network security rule. |
Security |
Whether network traffic is allowed or denied. |
Security |
The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. |
Security |
Network protocol this rule applies to. |
ApplicationSecurityGroup
An application security group in a resource group.
Name | Type | Description |
---|---|---|
etag |
string |
A unique read-only string that changes whenever the resource is updated. |
id |
string |
Resource ID. |
location |
string |
Resource location. |
name |
string |
Resource name. |
properties.provisioningState |
The provisioning state of the application security group resource. |
|
properties.resourceGuid |
string |
The resource GUID property of the application security group resource. It uniquely identifies a resource, even if the user changes its name or migrate the resource across subscriptions or resource groups. |
tags |
object |
Resource tags. |
type |
string |
Resource type. |
CloudError
An error response from the service.
Name | Type | Description |
---|---|---|
error |
Cloud error body. |
CloudErrorBody
An error response from the service.
Name | Type | Description |
---|---|---|
code |
string |
An identifier for the error. Codes are invariant and are intended to be consumed programmatically. |
details |
A list of additional details about the error. |
|
message |
string |
A message describing the error, intended to be suitable for display in a user interface. |
target |
string |
The target of the particular error. For example, the name of the property in error. |
ProvisioningState
The current provisioning state.
Name | Type | Description |
---|---|---|
Deleting |
string |
|
Failed |
string |
|
Succeeded |
string |
|
Updating |
string |
SecurityRule
Network security rule.
Name | Type | Description |
---|---|---|
etag |
string |
A unique read-only string that changes whenever the resource is updated. |
id |
string |
Resource ID. |
name |
string |
The name of the resource that is unique within a resource group. This name can be used to access the resource. |
properties.access |
The network traffic is allowed or denied. |
|
properties.description |
string |
A description for this rule. Restricted to 140 chars. |
properties.destinationAddressPrefix |
string |
The destination address prefix. CIDR or destination IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. |
properties.destinationAddressPrefixes |
string[] |
The destination address prefixes. CIDR or destination IP ranges. |
properties.destinationApplicationSecurityGroups |
The application security group specified as destination. |
|
properties.destinationPortRange |
string |
The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports. |
properties.destinationPortRanges |
string[] |
The destination port ranges. |
properties.direction |
The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. |
|
properties.priority |
integer |
The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule. |
properties.protocol |
Network protocol this rule applies to. |
|
properties.provisioningState |
The provisioning state of the security rule resource. |
|
properties.sourceAddressPrefix |
string |
The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. |
properties.sourceAddressPrefixes |
string[] |
The CIDR or source IP ranges. |
properties.sourceApplicationSecurityGroups |
The application security group specified as source. |
|
properties.sourcePortRange |
string |
The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports. |
properties.sourcePortRanges |
string[] |
The source port ranges. |
type |
string |
The type of the resource. |
SecurityRuleAccess
Whether network traffic is allowed or denied.
Name | Type | Description |
---|---|---|
Allow |
string |
|
Deny |
string |
SecurityRuleDirection
The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic.
Name | Type | Description |
---|---|---|
Inbound |
string |
|
Outbound |
string |
SecurityRuleProtocol
Network protocol this rule applies to.
Name | Type | Description |
---|---|---|
* |
string |
|
Ah |
string |
|
Esp |
string |
|
Icmp |
string |
|
Tcp |
string |
|
Udp |
string |