注:この質問は、同じシナリオを提示する一連の質問の一部です。シリーズの各質問には、指定された目標を達成する可能性のある独自のソリューションが含まれています。一部の質問セットには複数の正しい解決策がある場合がありますが、他の質問セットには正しい解決策がない場合があります。
このセクションの質問に回答した後は、その質問に戻ることはできません。その結果、これらの質問はレビュー画面に表示されません。
10個の仮想ネットワークを含むAzureサブスクリプションがあります。仮想ネットワークは、個別のリソースグループでホストされます。
別の管理者が、サブスクリプションにいくつかのネットワークセキュリティグループ(NSG)を作成することを計画しています。
NSGが作成されると、仮想ネットワーク間のTCPポート8080が自動的にブロックされるようにする必要があります。
解決策:リソースロックを作成してから、サブスクリプションにロックを割り当てます。
これは目標を達成していますか?
正解:B
No, this does not meet the goal. Creating a resource lock and assigning it to the subscription is not enough to ensure that when an NSG is created, it automatically blocks TCP port 8080 between the virtual networks. This is because a resource lock does not affect the configuration or functionality of a resource, but only prevents it from being deleted or modified1. A resource lock does not apply any security rules to an NSG or a virtual network.
To meet the goal, you need to create a custom policy definition that enforces a default security rule for NSGs. A policy definition is a set of rules and actions that Azure performs when evaluating your resources2. You can use a policy definition to specify the required properties and values for NSGs, such as the direction, protocol, source, destination, and port of the security rule. You can then assign the policy definition to the subscription scope, so that it applies to all the resource groups and virtual networks in the subscription.