🔔

Defender for Cloud の AWS/GCP コネクタの正常性をチェック

2025/02/07に公開

はじめに

Defender for Cloud では AWS や GCP も保護対象にできるのですが、Azure とは異なり、コネクタを設定して API 経由で接続する形になります。こちらが何らかの原因で接続エラーになった場合の確認方法を整理します。

Azure ポータル

Azure ポータルでは Defender for Cloud の [環境設定] から以下のように確認できます。


[X 件の問題] の箇所をクリックすると、問題の詳細が確認できます。

問題を通知する方法

こちらの情報は Azure Resource Graph から確認できます。

securityresources
| where type == "microsoft.security/healthreports"
| extend scope = properties.healthDataClassification.scope
| extend scope = properties.healthDataClassification.component
| extend status = properties.status.code
| extend statusChangeDate = properties.status.statusChangeDate
| project id,resourceGroup,subscriptionId,scope,status,statusChangeDate
| where scope == "Connectivity"
| where status <> "Healthy"


また Azure Resource Graph で確認できるため、Azure Monitor アラートが使えます。
https://learn.microsoft.com/ja-jp/azure/governance/resource-graph/alerts-query-quickstart?tabs=azure-resource-graph

クエリを少し変更して、特定時間にステータスが Healthy から変更になったコネクタを検出します。こちらをもとに Azure Monitor アラートルールを作成すれば通知することが可能です。

arg("").securityresources
| where type == "microsoft.security/healthreports"
| extend scope = properties.healthDataClassification.scope
| extend scope = properties.healthDataClassification.component
| extend status = properties.status.code
| extend statusChangeDate = properties.status.statusChangeDate
| project id,resourceGroup,subscriptionId,scope,status,statusChangeDate
| where statusChangeDate > ago(1h) // 1 時間ごとに実行する想定
| where scope == "Connectivity"
| where status <> "Healthy"
Microsoft (有志)

Discussion