コンテンツにスキップ
Dev Classmethod Jp Articles Aws Iot Device Defender Email

Security Hub に統合した IoT Device Defender の検出結果をメール通知してみた

  • URL: https://dev.classmethod.jp/articles/aws-iot-device-defender-email
  • 日付: 2026-06-19
  • Tier: Tier 2
  • 要旨: AWS IoT Device Defender Audit の検出結果を Security Hub 経由で取り込み、EventBridge → Step Functions → SNS を使ってユーザーフレンドリーなメール文面で通知する構成の実装記録。EventBridge に直接 SNS を設定するとメールが JSON のまま届くため、Step Functions を挟んで整形するアプローチを採用している。

詳細

構成:IoT Device Defender → Security Hub → EventBridge → Step Functions(cm-security-alert-mail-machine) → SNS メール

EventBridge ルールのイベントパターンで ProductArnarn:aws:securityhub:ap-northeast-1::product/aws/iot-device-defender-audit に固定し、Severity.LabelCRITICALHIGH で絞り込む。IoT Device Defender Detect の場合は重要度が MEDIUM 固定なので絞り込み不要。

入力テンプレートで <severity><title><resourceId> などを埋め込んでメール件名・本文を整形している。これにより EventBridge → SNS 直送の JSON 丸ごとメール問題を回避できる。

Security Hub 起点に統一することで、IoT Device Defender 以外のセキュリティサービスも同じ通知経路に乗せられ、通知インフラを集約できるメリットがある。