Access Control 목록 만들기 및 구성 예제

이 문서에서는 ACLS(액세스 제어 목록)를 만들고 업데이트하는 방법에 대한 예제를 제공합니다.

ACL 만들기 흐름 개요

NNI(네트워크 간 상호 연결)와 연결된 ACL(액세스 제어 목록)을 만들려면 다음 단계를 수행합니다.

  • Network Fabric 리소스를 만들고 NNI 자식 리소스를 추가합니다.

  • 명령을 사용하여 수신 및 송신 ACL 리소스를 만듭니다 az networkfabric acl create . ACL에 대한 일치 구성 및 기본 작업을 제공할 수 있습니다. 인라인 또는 Azure Storage 계정 Blob 컨테이너에 저장된 파일에서 동적 일치 구성을 제공할 수도 있습니다.

  • 명령을 사용하여 수신 및 송신 ACL ID로 NNI 리소스를 az networkfabric nni update 업데이트합니다. 및 --egress-acl-id 매개 변수에 유효한 ACL 리소스 ID를 --ingress-acl-id 제공해야 합니다.

  • 명령을 사용하여 Network Fabric 리소스를 프로비전합니다 az networkfabric fabric provision . 이렇게 하면 ACL에 대한 기본 구성 및 동적 일치 구성이 생성되고 디바이스로 전송됩니다.

ACL 업데이트 흐름 개요

  • 이전 섹션에서 설명한 대로 수신 및 송신 ACL 리소스 az networkfabric acl create 를 만듭니다.

  • 명령을 사용하여 수신 또는 송신 ACL을 업데이트합니다 az networkfabric acl update .

  • ACL의 구성 상태가 .인지 확인합니다 accepted.

  • 패브릭의 구성 상태가 .인지 accepted확인합니다.

  • 패브릭 커밋을 실행하여 ACL을 업데이트합니다.

명령 예

네트워크 간 상호 연결의 액세스 제어 목록

이 예제에서는 수신용 ACL과 송신용 ACL의 두 가지 ACL을 사용하여 NNI를 만드는 방법을 보여줍니다.

Network Fabric을 프로비전하기 전에 ACL을 적용해야 합니다. 이 제한은 일시적이며 향후 릴리스에서 제거될 예정입니다. 수신 및 송신 ACL은 NNI 리소스 이전에 만들어지고 NNI가 생성될 때 참조되며, 이는 ACL 생성을 트리거합니다. 이 구성은 네트워크 패브릭을 프로비전하기 전에 수행해야 합니다.

수신 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'}]}]"

송신 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']}]}]"

격리의 Access Control List do기본 외부 네트워크

명령을 az networkfabric acl create 사용하여 외부 네트워크에 대한 수신 및 송신 ACL을 만듭니다. 이 예제에서는 리소스 그룹, 이름, 위치, 네트워크 패브릭 ID, 외부 네트워크 ID 및 기타 매개 변수를 지정합니다. 및 매개 변수를 사용하여 --match ACL 규칙에 대한 일치 조건 및 --action 작업을 지정할 수도 있습니다.

이 명령은 모든 원본에서 외부 네트워크로의 ICMP 트래픽을 허용하는 수신 ACL을 acl-ingress 만듭니다.

az networkfabric acl create \
    --resource-group myResourceGroup \
    --name acl-ingress \
    --location eastus \
    --network-fabric-id /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.NetworkFabric/networkFabrics/myNetworkFabric \
    --external-network-id /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.NetworkFabric/externalNetworks/ext-net \
    --match "ip protocol icmp" \
    --action allow

명령을 az networkfabric externalnetwork update 사용하여 리소스 그룹, 이름 및 네트워크 패브릭 ID로 외부 네트워크를 업데이트합니다. 또한 및 매개 변수를 사용하여 수신 및 송신 ACL ID를 --ingress-acl-id --egress-acl-id 지정해야 합니다. 예를 들어 다음 명령은 이름이 지정된 ext-net 외부 네트워크를 업데이트하여 수신 ACL을 acl-ingress참조합니다.

az networkfabric externalnetwork update \
    --resource-group myResourceGroup \
    --name ext-net \
    --network-fabric-id /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.NetworkFabric/networkFabrics/myNetworkFabric \
    --ingress-acl-id /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.NetworkFabric/acls/acl-ingress

추가 예제 시나리오 및 명령

HTTP 및 HTTPS를 제외한 모든 트래픽을 거부하는 NNI에 대한 송신 ACL을 만들려면 다음 명령을 사용할 수 있습니다.

az networkfabric acl create \
    --name acl-egress \
    --resource-group myResourceGroup \
    --nni-id /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.NetworkFabric/networkInterfaces/myNni \
    --match "ip protocol tcp destination port 80 or 443" \
    --action allow \
    --default-action deny

기존 ACL을 업데이트하여 새 일치 조건 및 작업을 추가하려면 다음 명령을 사용할 수 있습니다.

az networkfabric acl update \
    --name acl-ingress \
    --resource-group myResourceGroup \
    --match "ip protocol icmp" \
    --action allow \
    --append-match-configurations

리소스 그룹의 모든 ACL을 나열하려면 다음 명령을 사용할 수 있습니다.

az networkfabric acl list --resource-group myResourceGroup

특정 ACL의 세부 정보를 표시하려면 다음 명령을 사용할 수 있습니다.

az networkfabric acl show \
    --name acl-ingress \
    --resource-group myResourceGroup

ACL을 삭제하려면 다음 명령을 사용할 수 있습니다.

az networkfabric acl delete \
    --name acl-egress \
    --resource-group myResourceGroup