你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Default Security Rules - Get
获取指定的默认网络安全规则。
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules/{defaultSecurityRuleName}?api-version=2023-09-01
URI 参数
名称 | 在 | 必需 | 类型 | 说明 |
---|---|---|---|---|
default
|
path | True |
string |
默认安全规则的名称。 |
network
|
path | True |
string |
网络安全组的名称。 |
resource
|
path | True |
string |
资源组的名称。 |
subscription
|
path | True |
string |
可以唯一标识 Microsoft Azure 订阅的订阅凭据。 此订阅 ID 是每个服务调用的 URI 的一部分。 |
api-version
|
query | True |
string |
客户端 API 版本。 |
响应
名称 | 类型 | 说明 |
---|---|---|
200 OK |
请求成功。 该操作返回生成的 SecurityRule 资源。 |
|
Other Status Codes |
描述操作失败原因的错误响应。 |
安全性
azure_auth
Azure Active Directory OAuth2 Flow。
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
名称 | 说明 |
---|---|
user_impersonation | 模拟用户帐户 |
示例
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": []
}
}
定义
名称 | 说明 |
---|---|
Application |
资源组中的应用程序安全组。 |
Cloud |
来自服务的错误响应。 |
Cloud |
来自服务的错误响应。 |
Provisioning |
当前预配状态。 |
Security |
网络安全规则。 |
Security |
是允许还是拒绝网络流量。 |
Security |
规则的方向。 direction 指定是要针对传入流量还是传出流量评估该规则。 |
Security |
此规则应用到的网络协议。 |
ApplicationSecurityGroup
资源组中的应用程序安全组。
名称 | 类型 | 说明 |
---|---|---|
etag |
string |
一个唯一的只读字符串,每当资源更新时都会更改。 |
id |
string |
资源 ID。 |
location |
string |
资源位置。 |
name |
string |
资源名称。 |
properties.provisioningState |
应用程序安全组资源的预配状态。 |
|
properties.resourceGuid |
string |
应用程序安全组资源的资源 GUID 属性。 它唯一标识资源,即使用户更改其名称或跨订阅或资源组迁移资源也是如此。 |
tags |
object |
资源标记。 |
type |
string |
资源类型。 |
CloudError
来自服务的错误响应。
名称 | 类型 | 说明 |
---|---|---|
error |
云错误正文。 |
CloudErrorBody
来自服务的错误响应。
名称 | 类型 | 说明 |
---|---|---|
code |
string |
错误的标识符。 代码是固定的,旨在以编程方式使用。 |
details |
有关错误的其他详细信息的列表。 |
|
message |
string |
描述错误的消息,该消息适用于在用户界面中显示。 |
target |
string |
特定错误的目标。 例如,属性的名称出错。 |
ProvisioningState
当前预配状态。
名称 | 类型 | 说明 |
---|---|---|
Deleting |
string |
|
Failed |
string |
|
Succeeded |
string |
|
Updating |
string |
SecurityRule
网络安全规则。
名称 | 类型 | 说明 |
---|---|---|
etag |
string |
一个唯一的只读字符串,每当资源更新时都会更改。 |
id |
string |
资源 ID。 |
name |
string |
资源组中唯一的资源的名称。 此名称可用于访问资源。 |
properties.access |
允许或拒绝网络流量。 |
|
properties.description |
string |
此规则的说明。 限制为 140 个字符。 |
properties.destinationAddressPrefix |
string |
目标地址前缀。 CIDR 或目标 IP 范围。 也可以使用星号“*”来匹配所有源 IP。 也可以使用“VirtualNetwork”、“AzureLoadBalancer”和“Internet”等默认标记。 |
properties.destinationAddressPrefixes |
string[] |
目标地址前缀。 CIDR 或目标 IP 范围。 |
properties.destinationApplicationSecurityGroups |
指定为目标的应用程序安全组。 |
|
properties.destinationPortRange |
string |
目标端口或范围。 介于 0 和 65535 之间的整数或范围。 星号“*”也可用于匹配所有端口。 |
properties.destinationPortRanges |
string[] |
目标端口范围。 |
properties.direction |
规则的方向。 direction 指定是要针对传入流量还是传出流量评估该规则。 |
|
properties.priority |
integer |
规则的优先级。 该值可以介于 100 和 4096 之间。 集合中每个规则的优先级编号必须是唯一的。 优先级编号越低,规则优先级越高。 |
properties.protocol |
此规则应用到的网络协议。 |
|
properties.provisioningState |
安全规则资源的预配状态。 |
|
properties.sourceAddressPrefix |
string |
CIDR 或源 IP 范围。 也可以使用星号“*”来匹配所有源 IP。 也可以使用“VirtualNetwork”、“AzureLoadBalancer”和“Internet”等默认标记。 如果这是入口规则,则指定网络流量的来源。 |
properties.sourceAddressPrefixes |
string[] |
CIDR 或源 IP 范围。 |
properties.sourceApplicationSecurityGroups |
指定为源的应用程序安全组。 |
|
properties.sourcePortRange |
string |
源端口或范围。 介于 0 和 65535 之间的整数或范围。 星号“*”也可用于匹配所有端口。 |
properties.sourcePortRanges |
string[] |
源端口范围。 |
type |
string |
资源类型。 |
SecurityRuleAccess
是允许还是拒绝网络流量。
名称 | 类型 | 说明 |
---|---|---|
Allow |
string |
|
Deny |
string |
SecurityRuleDirection
规则的方向。 direction 指定是要针对传入流量还是传出流量评估该规则。
名称 | 类型 | 说明 |
---|---|---|
Inbound |
string |
|
Outbound |
string |
SecurityRuleProtocol
此规则应用到的网络协议。
名称 | 类型 | 说明 |
---|---|---|
* |
string |
|
Ah |
string |
|
Esp |
string |
|
Icmp |
string |
|
Tcp |
string |
|
Udp |
string |