Azure Operator Nexus で NNI に ACL を作成する

Azure Operator Nexus では、ネットワーク間相互接続 (NNI) レベルの Permit および Deny アクションのアクセス制御リスト (ACL) は、管理仮想プライベート ネットワーク (VPN) 上の Secure Shell (SSH) アクセスを保護するのに役立ちます。 NNI リソースを作成する前にイングレス ACL とエグレス ACL を作成し、NNI ペイロードでこれらの ACL を参照します。 ネットワーク ファブリックをプロビジョニングする前に、参照されるイングレスとエグレス ACL を作成する必要があります。

NNI で ACL を作成する手順の概要を次に示します:

  1. NNI のイングレスおよびエグレス ACL を作成します。
  2. 管理 NNI で Azure Resource Manager リソース参照を更新します。
  3. NNI を作成し、ネットワーク ファブリックをプロビジョニングします。

パラメーターの使用に関するガイダンス

パラメーター 説明 例または範囲
defaultAction 実行される既定のアクション。 定義しない場合は、トラフィックが許可されます。 "defaultAction": "Permit"
resource-group ネットワーク ファブリックのリソース グループ。 nfresourcegroup
resource-name ACL の名前。 example-ingressACL
vlanGroups 仮想ローカル エリア ネットワーク (VLAN) グループの一覧。
vlans 一致する必要がある VLAN の一覧。
match-configurations 一致構成の名前。 example_acl スペースとアンパサンド文字 (&) はサポートされていません。
matchConditions 一致する必要がある条件。
ttlValues Time to live (TTL)。 0-255
dscpMarking 照合する必要がある差別化されたサービス コード ポイント (DSCP) マーキング。 0-63
portCondition 一致する必要があるポート条件。
portType 一致する必要があるポートの種類。 例: SourcePort。 使用できる値: DestinationPortSourcePort
protocolTypes 一致する必要があるプロトコル。 [tcp, udp, range[1-2, 1, 2]] プロトコル番号の場合は、1-255 の範囲内である必要があります。
vlanMatchCondition 一致する必要がある VLAN 一致条件。
layer4Protocol レイヤー 4 プロトコル。 TCP または UDP である必要があります。
ipCondition 一致する必要がある IP 条件。
actions 一致条件に基づいて実行されるアクション。 例: permit
configuration-type インラインもしくはファイルの構成の種類。 現時点では、Azure Operator Nexus ではインラインのみがサポートされています。 例: inline

また、次の制限にも注意する必要があります:

  • インライン ポートとインライン VLAN は、azcli を使用してポートまたは VLAN を定義する静的な方法です。
  • portGroupNamesvlanGroupNames は、ポートと VLAN を定義する動的な方法です。
  • インライン ポートと portGroupNames の組み合わせは許可されません。
  • インライン VLAN と vlanGroupNames の組み合わせは許可されません。
  • ipGroupNamesipPrefixValues の組み合わせは許可されません。
  • エグレス ACL は、IP オプション、IP 長さ、フラグメント、EtherType、DSCP マーキング、または TTL 値をサポートしていません。
  • イングレス ACL では、EtherType オプションはサポートされていません。

イングレス ACL を作成する

イングレス ACL を作成するには、次の Azure CLI コマンドを使用できます。 このコマンドは、指定された構成でイングレス ACL を作成し、期待される結果を出力として提供します。 実際のユース ケースに合わせてパラメーターを調整してください。

az networkfabric acl create
--resource-group "example-rg"
--location "eastus2euap"
--resource-name "example-Ipv4ingressACL"
--configuration-type "Inline"
--default-action "Permit"
--dynamic-match-configurations "[{ipGroups:[{name:'example-ipGroup',ipAddressType:IPv4,ipPrefixes:['10.20.3.1/20']}],vlanGroups:[{name:'example-vlanGroup',vlans:['20-30']}],portGroups:[{name:'example-portGroup',ports:['100-200']}]}]"
--match-configurations "[{matchConfigurationName:'example-match',sequenceNumber:123,ipAddressType:IPv4,matchConditions:[{etherTypes:['0x1'],fragments:['0xff00-0xffff'],ipLengths:['4094-9214'],ttlValues:[23],dscpMarkings:[32],portCondition:{flags:[established],portType:SourcePort,layer4Protocol:TCP,ports:['1-20']},protocolTypes:[TCP],vlanMatchCondition:{vlans:['20-30'],innerVlans:[30]},ipCondition:{type:SourceIP,prefixType:Prefix,ipPrefixValues:['10.20.20.20/12']}}],actions:[{type:Count,counterName:'example-counter'}]}]"

想定される出力

{
    "properties": {
        "lastSyncedTime": "2023-06-17T08:56:23.203Z",
        "configurationState": "Succeeded",
        "provisioningState": "Accepted",
        "administrativeState": "Enabled",
        "annotation": "annotation",
        "configurationType": "File",
        "aclsUrl": "https://ACL-Storage-URL",
        "matchConfigurations": [{
            "matchConfigurationName": "example-match",
            "sequenceNumber": 123,
            "ipAddressType": "IPv4",
            "matchConditions": [{
                "etherTypes": ["0x1"],
                "fragments": ["0xff00-0xffff"],
                "ipLengths": ["4094-9214"],
                "ttlValues": [23],
                "dscpMarkings": [32],
                "portCondition": {
                    "flags": ["established"],
                    "portType": "SourcePort",
                    "l4Protocol": "TCP",
                    "ports": ["1-20"],
                    "portGroupNames": ["example-portGroup"]
                },
                "protocolTypes": ["TCP"],
                "vlanMatchCondition": {
                    "vlans": ["20-30"],
                    "innerVlans": [30],
                    "vlanGroupNames": ["example-vlanGroup"]
                },
                "ipCondition": {
                    "type": "SourceIP",
                    "prefixType": "Prefix",
                    "ipPrefixValues": ["10.20.20.20/12"],
                    "ipGroupNames": ["example-ipGroup"]
                }
            }]
        }],
        "actions": [{
            "type": "Count",
            "counterName": "example-counter"
        }]
    },
    "tags": {
        "keyID": "KeyValue"
    },
    "location": "eastUs",
    "id": "/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/accessControlLists/acl",
    "name": "example-Ipv4ingressACL",
    "type": "microsoft.managednetworkfabric/accessControlLists",
    "systemData": {
        "createdBy": "email@address.com",
        "createdByType": "User",
        "createdAt": "2023-06-09T04:51:41.251Z",
        "lastModifiedBy": "UserId",
        "lastModifiedByType": "User",
        "lastModifiedAt": "2023-06-09T04:51:41.251Z"
    }
}

エグレス ACL を作成する

エグレス ACL を作成するには、次の Azure CLI コマンドを使用できます。 このコマンドは、指定された構成でエグレス ACL を作成し、期待される結果を出力として提供します。 実際のユース ケースに合わせてパラメーターを調整してください。

az networkfabric acl create
--resource-group "example-rg"
--location "eastus2euap"
--resource-name "example-Ipv4egressACL"
--configuration-type "File"
--acls-url "https://ACL-Storage-URL"
--default-action "Permit"
--dynamic-match-configurations "[{ipGroups:[{name:'example-ipGroup',ipAddressType:IPv4,ipPrefixes:['10.20.3.1/20']}],vlanGroups:[{name:'example-vlanGroup',vlans:['20-30']}],portGroups:[{name:'example-portGroup',ports:['100-200']}]}]"

想定される出力

{
    "properties": {
        "lastSyncedTime": "2023-06-17T08:56:23.203Z",
        "configurationState": "Succeeded",
        "provisioningState": "Accepted",
        "administrativeState": "Enabled",
        "annotation": "annotation",
        "configurationType": "File",
        "aclsUrl": "https://ACL-Storage-URL",
        "dynamicMatchConfigurations": [{
            "ipGroups": [{
                "name": "example-ipGroup",
                "ipAddressType": "IPv4",
                "ipPrefixes": ["10.20.3.1/20"]
            }],
            "vlanGroups": [{
                "name": "example-vlanGroup",
                "vlans": ["20-30"]
            }],
            "portGroups": [{
                "name": "example-portGroup",
                "ports": ["100-200"]
            }]
        }]
    },
    "tags": {
        "keyID": "KeyValue"
    },
    "location": "eastUs",
    "id": "/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/accessControlLists/acl",
    "name": "example-Ipv4egressACL",
    "type": "microsoft.managednetworkfabric/accessControlLists",
    "systemData": {
        "createdBy": "email@address.com",
        "createdByType": "User",
        "createdAt": "2023-06-09T04:51:41.251Z",
        "lastModifiedBy": "UserId",
        "lastModifiedByType": "User",
        "lastModifiedAt": "2023-06-09T04:51:41.251Z"
    }
}

Resource Manager リファレンスを更新する

この手順を実行すると、NNI リソースの作成時に ACL (参照が指定されている場合はイングレスとエグレス) を作成できます。 NNI を作成した後、ネットワーク ファブリックをプロビジョニングする前に、NNI に再配置を実行できます。

  • ingressAclId: イングレス ACL の参照 ID。
  • egressAclId: エグレス ACL の参照 ID。

Resource Manager リソース ID を取得するには、使用しているサブスクリプションのリソース グループに移動します。

次のコマンドは、指定されたイングレスとエグレス ACL を関連付けることで、NNI リソースの Resource Manager 参照を更新します。 実際のユース ケースに合わせてパラメーターを調整してください。

az networkfabric nni create
--resource-group "example-rg"
--fabric "example-fabric"
--resource-name "example-nniwithACL"
--nni-type "CE"
--is-management-type "True"
--use-option-b "True"
--layer2-configuration "{interfaces:['/subscriptions/xxxxx-xxxx-xxxx-xxxx-xxxxx/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/networkDevices/example-networkDevice/networkInterfaces/example-interface'],mtu:1500}"
--option-b-layer3-configuration "{peerASN:28,vlanId:501,primaryIpv4Prefix:'10.18.0.124/30',secondaryIpv4Prefix:'10.18.0.128/30',primaryIpv6Prefix:'10:2:0:124::400/127',secondaryIpv6Prefix:'10:2:0:124::402/127'}"
--ingress-acl-id "/subscriptions/xxxxx-xxxx-xxxx-xxxx-xxxxx/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accesscontrollists/example-Ipv4ingressACL"
--egress-acl-id "/subscriptions/xxxxx-xxxx-xxxx-xxxx-xxxxx/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accesscontrollists/example-Ipv4egressACL"

ACL の詳細を表示する

指定した ACL の詳細を表示するには、次のコマンドを使用します:

az networkfabric acl show --resource-group "example-rg" --resource-name "example-acl"

ACL の一覧を表示する

指定したリソース グループ内のすべての ACL を一覧表示するには、次のコマンドを使用します:

az networkfabric acl list --resource-group "ResourceGroupName"

ISD 外部ネットワークに ACL を作成する

分離ドメイン (ISD) 外部ネットワークのイングレスとエグレス ACL を作成するには、次の情報を使用します。 次に、外部ネットワークの Resource Manager リソース参照を更新します。

ISD 外部ネットワークのエグレス ACL を作成する

指定された構成で指定された ISD 外部ネットワークのエグレス ACL を作成するには、次のコマンドを使用します。 実際のユース ケースに合わせてパラメーターを調整してください。

az networkfabric acl create
--resource-group "example-rg"
--location "eastus2euap"
--resource-name "example-Ipv4egressACL"
--annotation "annotation"
--configuration-type "Inline"
--default-action "Deny"
--match-configurations "[{matchConfigurationName:'L3ISD_EXT_OPTA_EGRESS_ACL_IPV4_CE_PE',sequenceNumber:1110,ipAddressType:IPv4,matchConditions:[{ipCondition:{type:SourceIP,prefixType:Prefix,ipPrefixValues:['10.18.0.124/30','10.18.0.128/30','10.18.30.16/30','10.18.30.20/30']}},{ipCondition:{type:DestinationIP,prefixType:Prefix,ipPrefixValues:['10.18.0.124/30','10.18.0.128/30','10.18.30.16/30','10.18.30.20/30']}}],actions:[{type:Count}]}]"

想定される出力

正常に実行されると、作成された ACL に関する情報は、コマンドから次の形式で返されます。 この出力には、構成と状態に関する詳細が含まれます。

{
    "administrativeState": "Disabled",
    "annotation": "annotation",
    "configurationState": "Succeeded",
    "configurationType": "Inline",
    "defaultAction": "Deny",
    "id": "/subscriptions/xxxxx-xxxx-xxxx-xxxx-xxxxx/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-Ipv4egressACL",
    "location": "eastus2euap",
    "matchConfigurations": [
        {
            "actions": [
                {
                    "type": "Count"
                }
            ],
            "ipAddressType": "IPv4",
            "matchConditions": [
                {
                    "ipCondition": {
                        "ipPrefixValues": [
                            "10.18.0.124/30",
                            "10.18.0.128/30",
                            "10.18.30.16/30",
                            "10.18.30.20/30"
                        ],
                        "prefixType": "Prefix",
                        "type": "SourceIP"
                    }
                },
                {
                    "ipCondition": {
                        "ipPrefixValues": [
                            "10.18.0.124/30",
                            "10.18.0.128/30",
                            "10.18.30.16/30",
                            "10.18.30.20/30"
                        ],
                        "prefixType": "Prefix",
                        "type": "DestinationIP"
                    }
                }
            ],
            "matchConfigurationName": "L3ISD_EXT_OPTA_EGRESS_ACL_IPV4_CE_PE",
            "sequenceNumber": 1110
        }
    ],
    "name": "example-Ipv4egressACL",
    "provisioningState": "Succeeded",
    "resourceGroup": "example-rg",
    "systemData": {
        "createdAt": "2023-09-11T10:20:20.2617941Z",
        "createdBy": "email@address.com",
        "createdByType": "User",
        "lastModifiedAt": "2023-09-11T10:20:20.2617941Z",
        "lastModifiedBy": "email@address.com",
        "lastModifiedByType": "User"
    },
    "type": "microsoft.managednetworkfabric/accesscontrollists"
}

ISD 外部ネットワークのイングレス ACL を作成する

指定された構成で指定された ISD 外部ネットワークのイングレス ACL を作成するには、次のコマンドを使用します。 実際のユース ケースに合わせてパラメーターを調整してください。

az networkfabric acl create
--resource-group "example-rg"
--location "eastus2euap"
--resource-name "example-Ipv4ingressACL"
--annotation "annotation"
--configuration-type "Inline"
--default-action "Deny"
--match-configurations "[{matchConfigurationName:'L3ISD_EXT_OPTA_INGRESS_ACL_IPV4_CE_PE',sequenceNumber:1110,ipAddressType:IPv4,matchConditions:[{ipCondition:{type:SourceIP,prefixType:Prefix,ipPrefixValues:['10.18.0.124/30','10.18.0.128/30','10.18.30.16/30','10.18.30.20/30']}},{ipCondition:{type:DestinationIP,prefixType:Prefix,ipPrefixValues:['10.18.0.124/30','10.18.0.128/30','10.18.30.16/30','10.18.30.20/30']}}],actions:[{type:Count}]}]"

想定される出力

正常に実行されると、作成された ACL に関する情報は、コマンドから次の形式で返されます。 この出力には、構成と状態に関する詳細が含まれます。

{
    "administrativeState": "Disabled",
    "annotation": "annotation",
    "configurationState": "Succeeded",
    "configurationType": "Inline",
    "defaultAction": "Deny",
    "id": "/subscriptions/xxxxx-xxxx-xxxx-xxxx-xxxxx/resourceGroups/example-rg/providers/Microsoft.ManagedNetworkFabric/accessControlLists/example-Ipv4ingressACL",
    "location": "eastus2euap",
    "matchConfigurations": [
        {
            "actions": [
                {
                    "type": "Count"
                }
            ],
            "ipAddressType": "IPv4",
            "matchConditions": [
                {
                    "ipCondition": {
                        "ipPrefixValues": [
                            "10.18.0.124/30",
                            "10.18.0.128/30",
                            "10.18.30.16/30",
                            "10.18.30.20/30"
                        ],
                        "prefixType": "Prefix",
                        "type": "SourceIP"
                    }
                },
                {
                    "ipCondition": {
                        "ipPrefixValues": [
                            "10.18.0.124/30",
                            "10.18.0.128/30",
                            "10.18.30.16/30",
                            "10.18.30.20/30"
                        ],
                        "prefixType": "Prefix",
                        "type": "DestinationIP"
                    }
                }
            ],
            "matchConfigurationName": "L3ISD_EXT_OPTA_INGRESS_ACL_IPV4_CE_PE",
            "sequenceNumber": 1110
        }
    ],
    "name": "example-Ipv4ingressACL",
    "provisioningState": "Succeeded",
    "resourceGroup": "example-rg",
    "systemData": {
        "createdAt": "2023-09-11T10:20:20.2617941Z",
        "createdBy": "email@address.com",
        "createdByType": "User",
        "lastModifiedAt": "2023-09-11T10:27:27.2317467Z",
        "lastModifiedBy": "email@address.com",
        "lastModifiedByType": "User"
    },
    "type": "microsoft.managednetworkfabric/accesscontrollists"
}