Azure WAF のログを収集する

以下でサポートされています。

このドキュメントでは、Azure Storage アカウントを使用して Azure ウェブ アプリケーション ファイアウォール(WAF)のログを Google Security Operations にエクスポートする方法について説明します。パーサーは JSON 形式のログを処理し、UDM に変換します。各レコードを反復処理し、特定のフィールドを UDM プロパティにマッピングすることで、records 配列を含むログを処理します。records 配列がない場合、パーサーはログを 1 つのイベントとして処理し、それに応じてフィールドを抽出してマッピングします。

始める前に

  • Google SecOps インスタンスがあることを確認します。
  • 有効な Azure テナントがあることを確認します。
  • Azure への特権アクセス権があることを確認します。

Azure Storage アカウントを構成する

  1. Azure コンソールで、[ストレージ アカウント] を検索します。
  2. [作成] をクリックします。
  3. 次の入力パラメータの値を指定します。
    • Subscription: サブスクリプションを選択します。
    • Resource Group: リソース グループを選択します。
    • リージョン: リージョンを選択します。
    • パフォーマンス: パフォーマンスを選択します(標準を推奨)。
    • 冗長性: 冗長性を選択します(GRS または LRS を推奨)。
    • ストレージ アカウント名: 新しいストレージ アカウントの名前を入力します。
  4. [Review + create] をクリックします。
  5. アカウントの概要を確認し、[作成] をクリックします。
  6. [ストレージ アカウントの概要] ページで、[セキュリティとネットワーキング] の [アクセスキー] サブメニューを選択します。
  7. [key1] または [key2] の横にある [Show] をクリックします。
  8. [クリップボードにコピー] をクリックして、鍵をコピーします。
  9. キーを安全な場所に保存して、後で使用できるようにします。
  10. [ストレージ アカウントの概要] ページで、[設定] の [エンドポイント] サブメニューを選択します。
  11. [クリップボードにコピー] をクリックして、Blob サービスのエンドポイント URL(https://<storageaccountname>.blob.core.windows.net など)をコピーします。
  12. エンドポイント URL を安全な場所に保存して、後で使用できるようにします。

Azure WAF ログのログ エクスポートを構成する

  1. 特権アカウントを使用して Azure Portal にログインします。
  2. [ウェブ アプリケーション ファイアウォール(WAF)ルール] に移動し、モニタリングする WAF を選択します。
  3. [Monitoring] > [Diagnostic Settings] を選択します。
  4. [+ 診断設定を追加] をクリックします。
    • 診断設定にわかりやすい名前を入力します。
  5. [allLogs] を選択します。
  6. 移行先として [ストレージ アカウントにアーカイブ] チェックボックスをオンにします。
    • サブスクリプションストレージ アカウントを指定します。
  7. [保存] をクリックします。

Azure WAF のログを取り込むように Google SecOps でフィードを構成する

  1. [SIEM 設定] > [フィード] に移動します。
  2. [新しく追加] をクリックします。
  3. [フィード名] フィールドに、フィードの名前を入力します(例: Azure WAF ログ)。
  4. [ソースタイプ] として [Microsoft Azure Blob Storage] を選択します。
  5. [ログタイプ] として [Azure WAF] を選択します。
  6. [次へ] をクリックします。
  7. 次の入力パラメータの値を指定します。

    • Azure URI: Blob エンドポイントの URL。
      • ENDPOINT_URL/BLOB_NAME
        • 次のように置き換えます。
          • ENDPOINT_URL: blob エンドポイント URL(https://<storageaccountname>.blob.core.windows.net
          • BLOB_NAME: blob の名前(<logname>-logs など)
    • URI is a: ログストリームの構成([単一ファイル] | [ディレクトリ] | [サブディレクトリを含むディレクトリ])に応じて URI TYPE を選択します。
    • Source deletion options: 必要に応じて削除オプションを選択します。

    • 共有キー: Azure Blob Storage へのアクセスキー。

    • Asset namespace: アセットの名前空間

    • Ingestion labels: このフィードのイベントに適用されるラベル。

  8. [次へ] をクリックします。

  9. [Finalize] 画面で新しいフィードの設定を確認し、[送信] をクリックします。

UDM マッピング テーブル

ログフィールド UDM マッピング ロジック
backendPoolName additional.fields[?key=='backendPoolName'].value.string_value この値は、未加工ログの backendPoolName フィールドから取得されます。
backendSettingName additional.fields[?key=='backendSettingName'].value.string_value この値は、未加工ログの backendSettingName フィールドから取得されます。
category metadata.product_event_type この値は、未加工ログの category フィールドから取得されます。
EventEnqueuedUtcTime additional.fields[?key=='EventEnqueuedUtcTime'].value.string_value records フィールドが存在する場合、値は未加工ログの EventEnqueuedUtcTime フィールドから取得されます。
EventProcessedUtcTime additional.fields[?key=='EventProcessedUtcTime'].value.string_value records フィールドが存在する場合、値は未加工ログの EventProcessedUtcTime フィールドから取得されます。
operationName additional.fields[?key=='operationName'].value.string_value この値は、未加工ログの operationName フィールドから取得されます。
properties.action additional.fields[?key=='action'].value.string_value records フィールドが存在する場合、値は未加工ログの properties.action フィールドから取得されます。
properties.action security_result.action_details records フィールドが存在しない場合、この値は未加工ログの properties.action フィールドから取得されます。
properties.clientIPproperties.clientIp principal.asset.ipprincipal.ip この値は、未加工ログの properties.clientIP フィールドまたは properties.clientIp フィールドから取得されます。優先度は clientIP です。
properties.clientPort principal.port この値は、未加工ログの properties.clientPort フィールドから取得されます。
properties.clientResponseTime principal.resource.attribute.labels[?key=='Client Response Time'].value records フィールドが存在しない場合、この値は未加工ログの properties.clientResponseTime フィールドから取得されます。
properties.details.data additional.fields[?key=='Properties data'].value.string_value records フィールドが存在する場合、値は未加工ログの properties.details.data フィールドから取得されます。
properties.details.file principal.process.file.full_path records フィールドが存在しない場合、この値は未加工ログの properties.details.file フィールドから取得されます。
properties.details.matches[].matchVariableNameproperties.details.matches[].matchVariableValue additional.fields[?key.startsWith('%{idx} ')].value.string_value この値は、未加工ログの properties.details.matches 配列から取得されます。UDM の key は、インデックス(idx)と matchVariableName を使用して作成されます。valuematchVariableValue から取得されます。
properties.details.message metadata.description この値は、バックスラッシュと引用符を削除した後に、未加工ログの properties.details.message フィールドから取得されます。
properties.details.msg metadata.description records フィールドが存在する場合、値は未加工ログの properties.details.msg フィールドから取得されます。
properties.httpMethod network.http.method この値は、未加工ログの properties.httpMethod フィールドから取得されます。
properties.httpStatus network.http.response_code この値は、未加工ログの properties.httpStatus フィールドから取得されます。
properties.httpVersion network.application_protocol properties.httpVersion フィールドに HTTP が含まれている場合、値 HTTP が割り当てられます。
properties.hostproperties.hostnameproperties.originalHost principal.asset.hostnameprincipal.hostname 値は properties.originalHostproperties.hostproperties.hostname のいずれかから取得され、優先順位は上記の順になります。
properties.policyId security_result.detection_fields[?key=='policyId'].value この値は、未加工ログの properties.policyId フィールドから取得されます。
properties.policyMode security_result.detection_fields[?key=='policyMode'].value records フィールドが存在する場合、値は未加工ログの properties.policyMode フィールドから取得されます。
properties.policy additional.fields[?key=='Properties policy'].value.string_value records フィールドが存在する場合、値は未加工ログの properties.policy フィールドから取得されます。
properties.receivedBytes network.received_bytes この値は、未加工ログの properties.receivedBytes フィールドから取得されます。
properties.requestUri target.url この値は、未加工ログの properties.requestUri フィールドから取得されます。
properties.ruleId security_result.rule_id この値は、未加工ログの properties.ruleId フィールドから取得されます。
properties.ruleName security_result.rule_name records フィールドが存在する場合、値は未加工ログの properties.ruleName フィールドから取得されます。
properties.ruleNameruleSetType security_result.rule_name この値は、properties.ruleName フィールドから取得されます。空の場合は、records フィールドが存在しない場合、未加工ログの ruleSetType フィールドから取得されます。
properties.ruleSetVersion security_result.detection_fields[?key=='ruleSetVersion'].value この値は、未加工ログの properties.ruleSetVersion フィールドから取得されます。
properties.sentBytes network.sent_bytes この値は、未加工ログの properties.sentBytes フィールドから取得されます。
properties.serverResponseLatency additional.fields[?key=='Server Response Latency'].value.string_value records フィールドが存在しない場合、この値は未加工ログの properties.serverResponseLatency フィールドから取得されます。
properties.serverRouted target.asset.iptarget.iptarget.port IP とポートは properties.serverRouted フィールドから抽出されます。
properties.sslCipher network.tls.cipher この値は、未加工ログの properties.sslCipher フィールドから取得されます。
properties.sslClientCertificateIssuerName network.tls.server.certificate.issuer この値は、未加工ログの properties.sslClientCertificateIssuerName フィールドから取得されます。
properties.sslProtocol network.tls.version この値は、未加工ログの properties.sslProtocol フィールドから取得されます。
properties.timeTaken additional.fields[?key=='Properties Timetaken'].value.string_value records フィールドが存在しない場合、この値は未加工ログの properties.timeTaken フィールドから取得されます。
properties.trackingReference additional.fields[?key=='trackingReference'].value.string_value records フィールドが存在する場合、値は未加工ログの properties.trackingReference フィールドから取得されます。
properties.transactionId network.session_id この値は、未加工ログの properties.transactionId フィールドから取得されます。
properties.userAgent network.http.user_agent この値は、未加工ログの properties.userAgent フィールドから取得されます。
properties.WAFEvaluationTime additional.fields[?key=='Properties WAFEvaluationTime'].value.string_value records フィールドが存在しない場合、この値は未加工ログの properties.WAFEvaluationTime フィールドから取得されます。
properties.WAFMode additional.fields[?key=='Properties WAFMode'].value.string_value records フィールドが存在しない場合、この値は未加工ログの properties.WAFMode フィールドから取得されます。
rec.category metadata.product_event_type records フィールドが存在する場合、値は未加工ログの rec.category フィールドから取得されます。
rec.operationName additional.fields[?key=='operationName'].value.string_value records フィールドが存在する場合、値は未加工ログの rec.operationName フィールドから取得されます。
rec.properties.clientIPrec.properties.clientIp principal.asset.ipprincipal.ip この値は、未加工ログの rec.properties.clientIP フィールドまたは rec.properties.clientIp フィールドから取得されます。records フィールドが存在する場合は、clientIP が優先されます。
rec.properties.clientPort principal.port records フィールドが存在する場合、値は未加工ログの rec.properties.clientPort フィールドから取得されます。
rec.properties.host principal.asset.hostnameprincipal.hostname records フィールドが存在する場合、値は未加工ログの rec.properties.host フィールドから取得されます。
rec.properties.policy additional.fields[?key=='Properties policy'].value.string_value records フィールドが存在する場合、値は未加工ログの rec.properties.policy フィールドから取得されます。
rec.properties.requestUri target.url records フィールドが存在する場合、値は未加工ログの rec.properties.requestUri フィールドから取得されます。
rec.properties.ruleName security_result.rule_name records フィールドが存在する場合、値は未加工ログの rec.properties.ruleName フィールドから取得されます。
rec.properties.trackingReference additional.fields[?key=='trackingReference'].value.string_value records フィールドが存在する場合、値は未加工ログの rec.properties.trackingReference フィールドから取得されます。
rec.resourceId target.resource.id records フィールドが存在する場合、値は未加工ログの rec.resourceId フィールドから取得されます。
rec.time metadata.event_timestamp records フィールドが存在する場合、値は未加工ログの rec.time フィールドから取得されます。
resourceId target.resource.id records フィールドが存在しない場合、この値は未加工ログの resourceId フィールドから取得されます。
timeStamp metadata.event_timestamp records フィールドが存在しない場合、この値は未加工ログの timeStamp フィールドから取得されます。
なし metadata.event_type プリンシパル(ホスト名またはクライアント IP)と宛先 IP の両方が存在する場合、値は NETWORK_CONNECTION に設定されます。プリンシパルは存在するが宛先 IP がない場合は、STATUS_UPDATE に設定されます。指定しない場合、デフォルトは GENERIC_EVENT または event_type フィールドの値になります。
なし metadata.log_type この値は AZURE_WAF にハードコードされています。
なし metadata.product_name この値は Azure WAF Logs にハードコードされています。
なし metadata.vendor_name この値は Microsoft にハードコードされています。
なし security_result.action properties.actionMatched の場合、値は ALLOW に設定され、properties.actionBlock の場合、BLOCK に設定されます。

変更点

2024-04-07

機能強化:

  • rec.properties.clientIpprincipal.ip にマッピングしました。
  • 状態データに rec_properties_trackingReferencerec_properties_hostrec_properties_policyModerec_properties_ruleNamerec_properties_policyrec_properties_details_msgrec_properties_clientIPrec_time を定義しました。

2023-07-14

機能強化:

  • JSON ログを処理する for ループを追加しました。

2023-02-28

機能強化:

  • properties.ruleNamesecurity_result.rule_name にマッピングしました。
  • properties.actionsecurity_result.action にマッピングしました。
  • properties.clientPortproperties.httpStatusproperties.receivedBytesproperties.sentBytesproperties.clientResponseTimeproperties.timeTaken の on_error チェックを追加しました。

2022-10-22

  • 新しく作成されたパーサー

さらにサポートが必要な場合 コミュニティ メンバーや Google SecOps のプロフェッショナルから回答を得ることができます。