Azure Proactive Resiliency Library v2
Tools Glossary GitHub GitHub Issues Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

networkSecurityGroups

Summary

RecommendationImpactCategoryAutomation AvailablePG Verified
すべてのネットワーク セキュリティ グループの診断設定を構成するMediumMonitoring and AlertingNoVerified
Azure Monitor を使用してネットワーク セキュリティ グループの変更を監視するLowMonitoring and AlertingYesVerified
ネットワーク セキュリティ グループのロックを構成して、偶発的な変更や削除を回避します。LowGovernanceNoVerified
NSGフローログの構成MediumMonitoring and AlertingYesVerified
NSG にはデフォルトのセキュリティ ルールしかありません。必要なルールを必ず設定してください。MediumSecurityYesVerified

Details


すべてのネットワーク セキュリティ グループの診断設定を構成する

Impact:  Medium Category:  Monitoring and Alerting PG Verified:  Verified

Description:

リソース ログは、診断設定を作成して 1 つ以上の場所にルーティングするまで収集および保存されません。

Potential Benefits:

Enhanced monitoring and security insights
Learn More:
Diagnostic settings in Azure Monitor

ARG Query:

Click the Azure Resource Graph tab to view the query

// under-development



Azure Monitor を使用してネットワーク セキュリティ グループの変更を監視する

Impact:  Low Category:  Monitoring and Alerting PG Verified:  Verified

Description:

ネットワーク セキュリティ グループ ルールの作成や更新などの操作に対して Azure Monitor を使用してアラートを作成し、リソースに対する不正な変更や望ましくない変更を捕捉し、ファイアウォールをバイパスしたり、外部からリソースにアクセスしようとする試みを特定します。

Potential Benefits:

Enhanced security and change monitoring
Learn More:
Azure Monitor activity log

ARG Query:

Click the Azure Resource Graph tab to view the query

// Azure Resource Graph Query
// Find all Network Security Groups without alerts for modification configured.
resources
| where type =~ "Microsoft.Network/networkSecurityGroups"
| project name, id, tags, lowerCaseNsgId = tolower(id)
| join kind = leftouter (
    resources
    | where type =~ "Microsoft.Insights/activityLogAlerts" and properties.enabled == true
    | mv-expand scope = properties.scopes
    | where scope has "Microsoft.Network/networkSecurityGroups"
    | project alertName = name, conditionJson = dynamic_to_json(properties.condition.allOf), scope
    | where conditionJson has '"Administrative"' and (
        // Create or Update Network Security Group
        (conditionJson has '"Microsoft.Network/networkSecurityGroups/write"') or
        // All administrative operations
        (conditionJson !has '"Microsoft.Network/networkSecurityGroups/write"' and conditionJson !has '"Microsoft.Network/networkSecurityGroups/delete"' and conditionJson !has '"Microsoft.Network/networkSecurityGroups/join/action"')
        )
    | project lowerCaseNsgIdOfScope = tolower(scope)
    )
    on $left.lowerCaseNsgId == $right.lowerCaseNsgIdOfScope
| where isempty(lowerCaseNsgIdOfScope)
| project recommendationId = "8bb4a57b-55e4-d24e-9c19-2679d8bc779f", name, id, tags, param1 = "ModificationAlert: Not configured/Disabled"



ネットワーク セキュリティ グループのロックを構成して、偶発的な変更や削除を回避します。

Impact:  Low Category:  Governance PG Verified:  Verified

Description:

管理者は、Azure サブスクリプション、リソース グループ、またはリソースをロックして、誤って削除や変更が行われないように保護できます。ロックはユーザー権限をオーバーライドします。ロックは削除または変更を防ぐことができ、ポータルでは削除および読み取り専用として知られています。

Potential Benefits:

Prevents accidental edits/deletions
Learn More:
Lock your resources to protect your infrastructure

ARG Query:

Click the Azure Resource Graph tab to view the query

// under-development



NSGフローログの構成

Impact:  Medium Category:  Monitoring and Alerting PG Verified:  Verified

Description:

ネットワークの監視、管理、理解は、保護と最適化にとって非常に重要です。現在の状態、誰がどこから接続しているか、開いているインターネット ポート、予想される動作や異常な動作、トラフィックの急増などを把握することが不可欠です。

Potential Benefits:

Enhances security and optimizes network
Learn More:
Flow logging for network security groups

ARG Query:

Click the Azure Resource Graph tab to view the query

// Azure Resource Graph Query
// Find all Network Security Groups without NSG Flow logs configured or disabled.
resources
| where type =~ "Microsoft.Network/networkSecurityGroups"
| project name, id, tags, lowerCaseNsgId = tolower(id)
| join kind = leftouter (
    resources
    | where type == "microsoft.network/networkwatchers/flowlogs" and properties.enabled == true
    | project flowLogName = name, lowerCaseTargetNsgId = tolower(properties.targetResourceId)
    )
    on $left.lowerCaseNsgId == $right.lowerCaseTargetNsgId
| where isempty(lowerCaseTargetNsgId)
| project recommendationId = "da1a3c06-d1d5-a940-9a99-fcc05966fe7c", name, id, tags, param1 = "NSGFlowLog: Not configured/Disabled"



NSG にはデフォルトのセキュリティ ルールしかありません。必要なルールを必ず設定してください。

Impact:  Medium Category:  Security PG Verified:  Verified

Description:

Azure ネットワーク セキュリティ グループは、送信元、宛先、ポート、プロトコルに基づいて受信トラフィックまたは送信トラフィックを許可または拒否するセキュリティ ルールを使用して、仮想ネットワーク内のリソース間のネットワーク トラフィックをフィルター処理します。

Potential Benefits:

Enhanced traffic control and security
Learn More:
Security rules

ARG Query:

Click the Azure Resource Graph tab to view the query

// Azure Resource Graph Query
// This query will return all NSGs that have NO security rules
resources
| where type =~ "microsoft.network/networksecuritygroups"
| extend sr = string_size(properties.securityRules)
| where sr <=2 or isnull(properties.securityRules)
| project recommendationId = "8291c1fa-650c-b44b-b008-4deb7465919d", name, id