az network firewall policy rule-collection-group collection

注意

此參考是 Azure CLI 的 azure 防火牆延伸模組的一部分(2.55.0 版或更高版本)。 擴充功能會在您第一次執行 az network firewall policy rule-collection-group collection 命令時自動安裝。 深入了解擴充功能。

在規則集合群組中管理及設定 Azure 防火牆原則規則集合。

目前,Azure 防火牆 原則支援兩種規則集合,也就是 Filter 集合和 NAT 集合。 有三種規則是應用程式規則、網路規則和 nat 規則。 NAT 集合支援具有 nat 規則的清單。 篩選集合支援,包括其中的規則清單(網路規則或應用程式規則)。 但所有規則都應該是相同的類型。

命令

名稱 Description 類型 狀態
az network firewall policy rule-collection-group collection add-filter-collection

將篩選集合新增至 Azure 防火牆原則規則集合群組。

副檔名 預覽
az network firewall policy rule-collection-group collection add-nat-collection

將 NAT 集合新增至 Azure 防火牆原則規則集合群組。

副檔名 預覽
az network firewall policy rule-collection-group collection list

列出 Azure 防火牆原則規則集合群組的所有規則集合。

副檔名 預覽
az network firewall policy rule-collection-group collection remove

從 Azure 防火牆原則規則集合群組中移除規則集合。

副檔名 預覽
az network firewall policy rule-collection-group collection rule

在 Azure 防火牆原則的規則集合群組中管理及設定篩選集合的規則。

副檔名 GA
az network firewall policy rule-collection-group collection rule add

將規則新增至 Azure 防火牆原則規則集合。

副檔名 預覽
az network firewall policy rule-collection-group collection rule remove

從 Azure 防火牆原則規則集合中移除規則。

副檔名 預覽
az network firewall policy rule-collection-group collection rule update

更新 Azure 防火牆原則規則集合的規則。

副檔名 預覽

az network firewall policy rule-collection-group collection add-filter-collection

預覽

此命令處於預覽狀態,且正在開發中。 參考和支援層級: https://aka.ms/CLI_refstatus

將篩選集合新增至 Azure 防火牆原則規則集合群組。

az network firewall policy rule-collection-group collection add-filter-collection --collection-priority
                                                                                  --name
                                                                                  --policy-name
                                                                                  --rcg-name
                                                                                  --resource-group
                                                                                  [--action {Allow, Deny}]
                                                                                  [--add]
                                                                                  [--description]
                                                                                  [--dest-addr]
                                                                                  [--dest-ipg]
                                                                                  [--destination-fqdns]
                                                                                  [--destination-ports]
                                                                                  [--enable-tls-insp {0, 1, f, false, n, no, t, true, y, yes}]
                                                                                  [--force-string {0, 1, f, false, n, no, t, true, y, yes}]
                                                                                  [--fqdn-tags]
                                                                                  [--ip-protocols]
                                                                                  [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                                                                                  [--protocols]
                                                                                  [--remove]
                                                                                  [--rule-name]
                                                                                  [--rule-type {ApplicationRule, NatRule, NetworkRule}]
                                                                                  [--set]
                                                                                  [--source-addresses]
                                                                                  [--source-ip-groups]
                                                                                  [--target-fqdns]
                                                                                  [--target-urls]
                                                                                  [--web-categories]

範例

使用網路規則將篩選集合新增至規則集合群組

az network firewall policy rule-collection-group collection add-filter-collection -g {rg}
--policy-name {policy} --rule-collection-group-name {collectiongroup} --name
filter_collection --action Allow --rule-name network_rule --rule-type NetworkRule
--description "test" --destination-addresses "202.120.36.15" --source-addresses
"202.120.36.13" "202.120.36.14" --destination-ports 12003 12004 --ip-protocols TCP UDP
--collection-priority 11002

使用應用程式規則將篩選集合新增至規則集合群組

az network firewall policy rule-collection-group collection add-filter-collection -g {rg}
--policy-name {policy} --rule-collection-group-name {collectiongroup} --name
filter_collection --action Allow --rule-name application_rule --rule-type ApplicationRule
--description "test" --destination-addresses "202.120.36.15" "202.120.36.16" --source-
addresses "202.120.36.13" "202.120.36.14" --protocols Http=12800 Https=12801 --fqdn-tags
AzureBackup HDInsight --collection-priority 11100

必要參數

--collection-priority

防火牆原則規則集合群組中規則的優先順序。

--name -n

防火牆原則規則集合組的名稱。

--policy-name

防火牆原則的名稱。

--rcg-name --rule-collection-group-name

防火牆原則規則集合組的名稱。

--resource-group -g

資源群組的名稱。 您可以使用 來設定預設群組 az configure --defaults group=<name>

選擇性參數

--action

規則集合的動作類型。

接受的值: Allow, Deny
--add

藉由指定路徑和索引鍵值組,將物件加入物件清單。 範例:--add property.listProperty <key=value、string 或 JSON 字串>。

--description

規則的描述。

--dest-addr --destination-addresses

目的地IP位址的空間分隔清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--dest-ipg --destination-ip-groups

以空格分隔的目的地 IpGroups 名稱或資源識別碼清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--destination-fqdns

目的地 FQDN 的空間分隔清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--destination-ports

目的地埠的空間分隔清單。 Nat 和網路規則支援此自變數。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--enable-tls-insp --enable-tls-inspection
預覽

啟用旗標以終止此規則的 TLS 連線。

接受的值: 0, 1, f, false, n, no, t, true, y, yes
預設值: False
--force-string

使用 'set' 或 'add' 時,請保留字串常值,而不是嘗試轉換成 JSON。

接受的值: 0, 1, f, false, n, no, t, true, y, yes
--fqdn-tags

此規則的 FQDN 標籤以空白分隔的清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--ip-protocols

以空格分隔的IP通訊協定清單。 Nat 和網路規則支援此自變數。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--no-wait

請勿等候長時間執行的作業完成。

接受的值: 0, 1, f, false, n, no, t, true, y, yes
--protocols

以 PROTOCOL=PORT 格式使用之通訊協定和埠號碼的空間分隔清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--remove

從清單中移除屬性或專案。 範例:--remove property.list OR --remove 屬性ToRemove。

--rule-name

規則的名稱。

--rule-type

規則的類型。

接受的值: ApplicationRule, NatRule, NetworkRule
--set

指定要設定的屬性路徑和值,以更新物件。 範例:--set property1.property2=。

--source-addresses

來源IP ddresses的空間分隔清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--source-ip-groups

以空格分隔的來源 IpGroups 名稱或資源識別碼清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--target-fqdns

此規則的空間分隔 FQDN 清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--target-urls
預覽

此規則之目標 URL 的空間分隔清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--web-categories

此規則的 Web 類別空間分隔清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az network firewall policy rule-collection-group collection add-nat-collection

預覽

此命令處於預覽狀態,且正在開發中。 參考和支援層級: https://aka.ms/CLI_refstatus

將 NAT 集合新增至 Azure 防火牆原則規則集合群組。

az network firewall policy rule-collection-group collection add-nat-collection --collection-priority
                                                                               --ip-protocols
                                                                               --name
                                                                               --policy-name
                                                                               --rcg-name
                                                                               --resource-group
                                                                               [--action {DNAT, SNAT}]
                                                                               [--add]
                                                                               [--description]
                                                                               [--dest-addr]
                                                                               [--destination-ports]
                                                                               [--force-string {0, 1, f, false, n, no, t, true, y, yes}]
                                                                               [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                                                                               [--remove]
                                                                               [--rule-name]
                                                                               [--set]
                                                                               [--source-addresses]
                                                                               [--source-ip-groups]
                                                                               [--translated-address]
                                                                               [--translated-fqdn]
                                                                               [--translated-port]

範例

將 NAT 集合新增至規則集合群組

az network firewall policy rule-collection-group collection add-nat-collection -n
nat_collection --collection-priority 10003 --policy-name {policy} -g {rg} --rule-collection-
group-name {collectiongroup} --action DNAT --rule-name network_rule --description "test"
--destination-addresses "202.120.36.15" --source-addresses "202.120.36.13" "202.120.36.14"
--translated-address 128.1.1.1 --translated-port 1234 --destination-ports 12000 12001 --ip-
protocols TCP UDP

必要參數

--collection-priority

防火牆原則規則集合群組中規則的優先順序。

--ip-protocols

以空格分隔的IP通訊協定清單。 Nat 和網路規則支援此自變數。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--name -n

防火牆原則規則集合組的名稱。

--policy-name

防火牆原則的名稱。

--rcg-name --rule-collection-group-name

防火牆原則規則集合組的名稱。

--resource-group -g

資源群組的名稱。 您可以使用 來設定預設群組 az configure --defaults group=<name>

選擇性參數

--action

規則集合的動作類型。

接受的值: DNAT, SNAT
--add

藉由指定路徑和索引鍵值組,將物件加入物件清單。 範例:--add property.listProperty <key=value、string 或 JSON 字串>。

--description

規則的描述。

--dest-addr --destination-addresses

目的地IP位址的空間分隔清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--destination-ports

目的地埠的空間分隔清單。 Nat 和網路規則支援此自變數。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--force-string

使用 'set' 或 'add' 時,請保留字串常值,而不是嘗試轉換成 JSON。

接受的值: 0, 1, f, false, n, no, t, true, y, yes
--no-wait

請勿等候長時間執行的作業完成。

接受的值: 0, 1, f, false, n, no, t, true, y, yes
--remove

從清單中移除屬性或專案。 範例:--remove property.list OR --remove 屬性ToRemove。

--rule-name

規則的名稱。

--set

指定要設定的屬性路徑和值,以更新物件。 範例:--set property1.property2=。

--source-addresses

來源IP ddresses的空間分隔清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--source-ip-groups

以空格分隔的來源 IpGroups 名稱或資源識別碼清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

--translated-address

此 NAT 規則集合的翻譯位址。

--translated-fqdn

此 NAT 規則集合的已翻譯 FQDN。

--translated-port

此 NAT 規則集合的轉譯埠。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az network firewall policy rule-collection-group collection list

預覽

此命令處於預覽狀態,且正在開發中。 參考和支援層級: https://aka.ms/CLI_refstatus

列出 Azure 防火牆原則規則集合群組的所有規則集合。

az network firewall policy rule-collection-group collection list --policy-name
                                                                 --rcg-name
                                                                 --resource-group

必要參數

--policy-name

防火牆原則的名稱。

--rcg-name --rule-collection-group-name

防火牆原則規則集合組的名稱。

--resource-group -g

資源群組的名稱。 您可以使用 來設定預設群組 az configure --defaults group=<name>

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az network firewall policy rule-collection-group collection remove

預覽

此命令處於預覽狀態,且正在開發中。 參考和支援層級: https://aka.ms/CLI_refstatus

從 Azure 防火牆原則規則集合群組中移除規則集合。

az network firewall policy rule-collection-group collection remove --name
                                                                   --policy-name
                                                                   --rcg-name
                                                                   --resource-group
                                                                   [--add]
                                                                   [--force-string {0, 1, f, false, n, no, t, true, y, yes}]
                                                                   [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                                                                   [--remove]
                                                                   [--set]

必要參數

--name -n

防火牆原則規則集合組的名稱。

--policy-name

防火牆原則的名稱。

--rcg-name --rule-collection-group-name

防火牆原則規則集合組的名稱。

--resource-group -g

資源群組的名稱。 您可以使用 來設定預設群組 az configure --defaults group=<name>

選擇性參數

--add

藉由指定路徑和索引鍵值組,將物件加入物件清單。 範例:--add property.listProperty <key=value、string 或 JSON 字串>。

--force-string

使用 'set' 或 'add' 時,請保留字串常值,而不是嘗試轉換成 JSON。

接受的值: 0, 1, f, false, n, no, t, true, y, yes
--no-wait

請勿等候長時間執行的作業完成。

接受的值: 0, 1, f, false, n, no, t, true, y, yes
--remove

從清單中移除屬性或專案。 範例:--remove property.list OR --remove 屬性ToRemove。

--set

指定要設定的屬性路徑和值,以更新物件。 範例:--set property1.property2=。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。